Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 extension_id, extensions::ExtensionRegistry::EVERYTHING); | 272 extension_id, extensions::ExtensionRegistry::EVERYTHING); |
| 273 return extension && extension->is_platform_app() ? extension : NULL; | 273 return extension && extension->is_platform_app() ? extension : NULL; |
| 274 } | 274 } |
| 275 | 275 |
| 276 // Appends the contents of |from| to the end of |to|. | 276 // Appends the contents of |from| to the end of |to|. |
| 277 void AppendTabs(const StartupTabs& from, StartupTabs* to) { | 277 void AppendTabs(const StartupTabs& from, StartupTabs* to) { |
| 278 if (!from.empty()) | 278 if (!from.empty()) |
| 279 to->insert(to->end(), from.begin(), from.end()); | 279 to->insert(to->end(), from.begin(), from.end()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 // Determines whether the Consolidated startup flow should be used, based on | |
| 283 // OS, OS version, and the kUseConsolidatedStartupFlow Feature. | |
| 284 bool UseConsolidatedFlow() { | |
|
tmartino
2016/12/15 19:00:10
Whoops, one more thing. We haven't launch-reviewed
Patrick Monette
2016/12/15 20:17:35
Done.
| |
| 285 #if defined(OS_WIN) | |
| 286 // TODO(tmartino): Enable for Windows 10+ once relevant Win 10-specific logic | |
| 287 // is added to StartupTabProvider. | |
| 288 if (base::win::GetVersion() >= base::win::VERSION_WIN10) | |
| 289 return false; | |
| 290 #endif // defined(OS_WIN) | |
| 291 return base::FeatureList::IsEnabled(features::kUseConsolidatedStartupFlow); | |
| 292 } | |
| 293 | |
| 294 } // namespace | 282 } // namespace |
| 295 | 283 |
| 296 namespace internals { | 284 namespace internals { |
| 297 | 285 |
| 298 GURL GetTriggeredResetSettingsURL() { | 286 GURL GetTriggeredResetSettingsURL() { |
| 299 return GURL( | 287 return GURL( |
| 300 chrome::GetSettingsUrl(chrome::kTriggeredResetProfileSettingsSubPage)); | 288 chrome::GetSettingsUrl(chrome::kTriggeredResetProfileSettingsSubPage)); |
| 301 } | 289 } |
| 302 | 290 |
| 303 GURL GetWelcomePageURL() { | 291 GURL GetWelcomePageURL() { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 // URLs in that case. The user should see the window as an app, | 358 // URLs in that case. The user should see the window as an app, |
| 371 // not as chrome. | 359 // not as chrome. |
| 372 // Special case is when app switches are passed but we do want to restore | 360 // Special case is when app switches are passed but we do want to restore |
| 373 // session. In that case open app window + focus it after session is restored. | 361 // session. In that case open app window + focus it after session is restored. |
| 374 if (OpenApplicationWindow(profile)) { | 362 if (OpenApplicationWindow(profile)) { |
| 375 RecordLaunchModeHistogram(LM_AS_WEBAPP); | 363 RecordLaunchModeHistogram(LM_AS_WEBAPP); |
| 376 } else { | 364 } else { |
| 377 RecordLaunchModeHistogram(urls_to_open.empty() ? | 365 RecordLaunchModeHistogram(urls_to_open.empty() ? |
| 378 LM_TO_BE_DECIDED : LM_WITH_URLS); | 366 LM_TO_BE_DECIDED : LM_WITH_URLS); |
| 379 | 367 |
| 380 if (UseConsolidatedFlow()) | 368 if (base::FeatureList::IsEnabled(features::kUseConsolidatedStartupFlow)) |
| 381 ProcessLaunchUrlsUsingConsolidatedFlow(process_startup, urls_to_open); | 369 ProcessLaunchUrlsUsingConsolidatedFlow(process_startup, urls_to_open); |
| 382 else | 370 else |
| 383 ProcessLaunchURLs(process_startup, urls_to_open); | 371 ProcessLaunchURLs(process_startup, urls_to_open); |
| 384 | 372 |
| 385 if (command_line_.HasSwitch(switches::kInstallChromeApp)) { | 373 if (command_line_.HasSwitch(switches::kInstallChromeApp)) { |
| 386 install_chrome_app::InstallChromeApp( | 374 install_chrome_app::InstallChromeApp( |
| 387 command_line_.GetSwitchValueASCII(switches::kInstallChromeApp)); | 375 command_line_.GetSwitchValueASCII(switches::kInstallChromeApp)); |
| 388 } | 376 } |
| 389 | 377 |
| 390 // If this is an app launch, but we didn't open an app window, it may | 378 // If this is an app launch, but we didn't open an app window, it may |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1222 #if defined(OS_WIN) | 1210 #if defined(OS_WIN) |
| 1223 TriggeredProfileResetter* triggered_profile_resetter = | 1211 TriggeredProfileResetter* triggered_profile_resetter = |
| 1224 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1212 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
| 1225 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1213 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
| 1226 if (triggered_profile_resetter) { | 1214 if (triggered_profile_resetter) { |
| 1227 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1215 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
| 1228 } | 1216 } |
| 1229 #endif // defined(OS_WIN) | 1217 #endif // defined(OS_WIN) |
| 1230 return has_reset_trigger; | 1218 return has_reset_trigger; |
| 1231 } | 1219 } |
| OLD | NEW |