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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 2570573002: Convert RLZ to a buildflag header (Closed)
Patch Set: iOS Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #include "content/public/browser/notification_registrar.h" 96 #include "content/public/browser/notification_registrar.h"
97 #include "content/public/browser/storage_partition.h" 97 #include "content/public/browser/storage_partition.h"
98 #include "content/public/browser/web_contents.h" 98 #include "content/public/browser/web_contents.h"
99 #include "content/public/common/content_switches.h" 99 #include "content/public/common/content_switches.h"
100 #include "extensions/browser/extension_prefs.h" 100 #include "extensions/browser/extension_prefs.h"
101 #include "extensions/browser/extension_registry.h" 101 #include "extensions/browser/extension_registry.h"
102 #include "extensions/common/constants.h" 102 #include "extensions/common/constants.h"
103 #include "extensions/common/extension.h" 103 #include "extensions/common/extension.h"
104 #include "extensions/common/extension_set.h" 104 #include "extensions/common/extension_set.h"
105 #include "net/base/network_change_notifier.h" 105 #include "net/base/network_change_notifier.h"
106 #include "rlz/features/features.h"
106 #include "ui/base/l10n/l10n_util.h" 107 #include "ui/base/l10n/l10n_util.h"
107 108
108 #if defined(OS_MACOSX) 109 #if defined(OS_MACOSX)
109 #include "base/mac/mac_util.h" 110 #include "base/mac/mac_util.h"
110 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" 111 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h"
111 #endif 112 #endif
112 113
113 #if defined(OS_WIN) 114 #if defined(OS_WIN)
114 #include "base/win/windows_version.h" 115 #include "base/win/windows_version.h"
115 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" 116 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
116 #include "chrome/browser/search_engines/template_url_service_factory.h" 117 #include "chrome/browser/search_engines/template_url_service_factory.h"
117 #include "chrome/browser/shell_integration_win.h" 118 #include "chrome/browser/shell_integration_win.h"
118 #endif 119 #endif
119 120
120 #if defined(ENABLE_RLZ) 121 #if BUILDFLAG(ENABLE_RLZ)
121 #include "components/rlz/rlz_tracker.h" // nogncheck 122 #include "components/rlz/rlz_tracker.h" // nogncheck
122 #endif 123 #endif
123 124
124 using content::ChildProcessSecurityPolicy; 125 using content::ChildProcessSecurityPolicy;
125 using content::WebContents; 126 using content::WebContents;
126 using extensions::Extension; 127 using extensions::Extension;
127 128
128 namespace { 129 namespace {
129 130
130 // Utility functions ---------------------------------------------------------- 131 // Utility functions ----------------------------------------------------------
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 add_types |= TabStripModel::ADD_FORCE_INDEX; 465 add_types |= TabStripModel::ADD_FORCE_INDEX;
465 if (tabs[i].is_pinned) 466 if (tabs[i].is_pinned)
466 add_types |= TabStripModel::ADD_PINNED; 467 add_types |= TabStripModel::ADD_PINNED;
467 468
468 chrome::NavigateParams params(browser, tabs[i].url, 469 chrome::NavigateParams params(browser, tabs[i].url,
469 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); 470 ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
470 params.disposition = first_tab ? WindowOpenDisposition::NEW_FOREGROUND_TAB 471 params.disposition = first_tab ? WindowOpenDisposition::NEW_FOREGROUND_TAB
471 : WindowOpenDisposition::NEW_BACKGROUND_TAB; 472 : WindowOpenDisposition::NEW_BACKGROUND_TAB;
472 params.tabstrip_add_types = add_types; 473 params.tabstrip_add_types = add_types;
473 474
474 #if defined(ENABLE_RLZ) 475 #if BUILDFLAG(ENABLE_RLZ)
475 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { 476 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) {
476 params.extra_headers = rlz::RLZTracker::GetAccessPointHttpHeader( 477 params.extra_headers = rlz::RLZTracker::GetAccessPointHttpHeader(
477 rlz::RLZTracker::ChromeHomePage()); 478 rlz::RLZTracker::ChromeHomePage());
478 } 479 }
479 #endif // defined(ENABLE_RLZ) 480 #endif // BUILDFLAG(ENABLE_RLZ)
480 481
481 chrome::Navigate(&params); 482 chrome::Navigate(&params);
482 483
483 first_tab = false; 484 first_tab = false;
484 } 485 }
485 if (!browser->tab_strip_model()->GetActiveWebContents()) { 486 if (!browser->tab_strip_model()->GetActiveWebContents()) {
486 // TODO(sky): this is a work around for 110909. Figure out why it's needed. 487 // TODO(sky): this is a work around for 110909. Figure out why it's needed.
487 if (!browser->tab_strip_model()->count()) 488 if (!browser->tab_strip_model()->count())
488 chrome::AddTabAt(browser, GURL(), -1, true); 489 chrome::AddTabAt(browser, GURL(), -1, true);
489 else 490 else
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 #if defined(OS_WIN) 1223 #if defined(OS_WIN)
1223 TriggeredProfileResetter* triggered_profile_resetter = 1224 TriggeredProfileResetter* triggered_profile_resetter =
1224 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); 1225 TriggeredProfileResetterFactory::GetForBrowserContext(profile_);
1225 // TriggeredProfileResetter instance will be nullptr for incognito profiles. 1226 // TriggeredProfileResetter instance will be nullptr for incognito profiles.
1226 if (triggered_profile_resetter) { 1227 if (triggered_profile_resetter) {
1227 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); 1228 has_reset_trigger = triggered_profile_resetter->HasResetTrigger();
1228 } 1229 }
1229 #endif // defined(OS_WIN) 1230 #endif // defined(OS_WIN)
1230 return has_reset_trigger; 1231 return has_reset_trigger;
1231 } 1232 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/webui/chromeos/login/eula_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698