georgesak | a3ae61c7 | 2015-04-02 01:04:26 | [diff] [blame] | 1 | // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/sessions/session_restore_delegate.h" |
| 6 | |
georgesak | fbcd45d | 2015-04-07 15:08:24 | [diff] [blame] | 7 | #include "base/metrics/field_trial.h" |
georgesak | 98702bbb | 2015-04-03 17:59:22 | [diff] [blame] | 8 | #include "chrome/browser/sessions/session_restore_stats_collector.h" |
georgesak | a3ae61c7 | 2015-04-02 01:04:26 | [diff] [blame] | 9 | #include "chrome/browser/sessions/tab_loader.h" |
georgesak | 189ed37 | 2015-05-08 03:53:30 | [diff] [blame^] | 10 | #include "chrome/common/url_constants.h" |
georgesak | bf4674a | 2015-04-13 18:50:31 | [diff] [blame] | 11 | #include "components/favicon/content/content_favicon_driver.h" |
georgesak | a3ae61c7 | 2015-04-02 01:04:26 | [diff] [blame] | 12 | |
georgesak | 189ed37 | 2015-05-08 03:53:30 | [diff] [blame^] | 13 | namespace { |
| 14 | |
| 15 | bool IsInternalPage(const GURL& url) { |
| 16 | // There are many chrome:// UI URLs, but only look for the ones that users |
| 17 | // are likely to have open. Most of the benefit is from the NTP URL. |
| 18 | const char* const kReloadableUrlPrefixes[] = { |
| 19 | chrome::kChromeUIDownloadsURL, |
| 20 | chrome::kChromeUIHistoryURL, |
| 21 | chrome::kChromeUINewTabURL, |
| 22 | chrome::kChromeUISettingsURL, |
| 23 | }; |
| 24 | // Prefix-match against the table above. Use strncmp to avoid allocating |
| 25 | // memory to convert the URL prefix constants into std::strings. |
|
|