Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4777)

Unified Diff: chrome/browser/sessions/session_restore_delegate.cc

Issue 2034573002: [Cleanup] Factor out common code. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wherein we relearn that "commit -a" doesn't add new files. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/session_restore_delegate.cc
diff --git a/chrome/browser/sessions/session_restore_delegate.cc b/chrome/browser/sessions/session_restore_delegate.cc
index f562d944ff296405d9484b1807926f66a1bed211..55d4001227ce74ec06d450daa5b2504f5e0ea255 100644
--- a/chrome/browser/sessions/session_restore_delegate.cc
+++ b/chrome/browser/sessions/session_restore_delegate.cc
@@ -11,33 +11,11 @@
#include "base/metrics/field_trial.h"
#include "chrome/browser/sessions/session_restore_stats_collector.h"
#include "chrome/browser/sessions/tab_loader.h"
+#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/url_constants.h"
#include "components/favicon/content/content_favicon_driver.h"
#include "content/public/browser/web_contents.h"
-namespace {
-
-bool IsInternalPage(const GURL& url) {
- // There are many chrome:// UI URLs, but only look for the ones that users
- // are likely to have open. Most of the benefit is from the NTP URL.
- const char* const kReloadableUrlPrefixes[] = {
- chrome::kChromeUIDownloadsURL,
- chrome::kChromeUIHistoryURL,
- chrome::kChromeUINewTabURL,
- chrome::kChromeUISettingsURL,
- };
- // Prefix-match against the table above. Use strncmp to avoid allocating
- // memory to convert the URL prefix constants into std::strings.
- for (size_t i = 0; i < arraysize(kReloadableUrlPrefixes); ++i) {
- if (!strncmp(url.spec().c_str(), kReloadableUrlPrefixes[i],
- strlen(kReloadableUrlPrefixes[i])))
- return true;
- }
- return false;
-}
-
-} // namespace
-
SessionRestoreDelegate::RestoredTab::RestoredTab(content::WebContents* contents,
bool is_active,
bool is_app,
@@ -45,9 +23,9 @@ SessionRestoreDelegate::RestoredTab::RestoredTab(content::WebContents* contents,
: contents_(contents),
is_active_(is_active),
is_app_(is_app),
- is_internal_page_(IsInternalPage(contents->GetLastCommittedURL())),
- is_pinned_(is_pinned) {
-}
+ is_internal_page_(
+ chrome::IsInternalPage(contents->GetLastCommittedURL())),
+ is_pinned_(is_pinned) {}
bool SessionRestoreDelegate::RestoredTab::operator<(
const RestoredTab& right) const {

Powered by Google App Engine
This is Rietveld 408576698