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.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> // For max(). | 9 #include <algorithm> // For max(). |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck | 98 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 102 #include "chrome/browser/web_applications/web_app_mac.h" | 102 #include "chrome/browser/web_applications/web_app_mac.h" |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
| 106 #include "base/win/windows_version.h" | 106 #include "base/win/windows_version.h" |
| 107 #include "chrome/browser/metrics/jumplist_metrics_win.h" | 107 #include "chrome/browser/metrics/jumplist_metrics_win.h" |
| 108 #include "chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h" | |
| 108 #endif | 109 #endif |
| 109 | 110 |
| 110 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 111 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 111 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 112 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 112 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" | 113 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" |
| 113 #include "chrome/browser/printing/print_dialog_cloud.h" | 114 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 114 #endif | 115 #endif |
| 115 | 116 |
| 116 #if BUILDFLAG(ENABLE_APP_LIST) | 117 #if BUILDFLAG(ENABLE_APP_LIST) |
| 117 #include "chrome/browser/ui/app_list/app_list_service.h" | 118 #include "chrome/browser/ui/app_list/app_list_service.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 if (!launched) { | 376 if (!launched) { |
| 376 LOG(ERROR) << "launch error"; | 377 LOG(ERROR) << "launch error"; |
| 377 return false; | 378 return false; |
| 378 } | 379 } |
| 379 } else { | 380 } else { |
| 380 in_synchronous_profile_launch_ = false; | 381 in_synchronous_profile_launch_ = false; |
| 381 } | 382 } |
| 382 | 383 |
| 383 profile_launch_observer.Get().AddLaunched(profile); | 384 profile_launch_observer.Get().AddLaunched(profile); |
| 384 | 385 |
| 386 #if defined(OS_WIN) | |
|
Peter Kasting
2017/06/14 17:39:16
Is this OS_WIN because we only ever want it to be
tmartino
2017/06/14 21:48:35
+1 regardless of where this code lives
ftirelo
2017/06/15 03:41:23
Done.
ftirelo
2017/06/15 03:41:24
Good idea. Done.
| |
| 387 // Reset settings for the current profile if it's tagged to be reset after a | |
| 388 // complete run of the Chrome Cleanup tool. | |
| 389 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { | |
| 390 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( | |
|
Peter Kasting
2017/06/14 17:39:16
It feels as if this isn't really part of "launchin
tmartino
2017/06/14 21:48:35
Spoke offline with ftirelo and alito. The major th
ftirelo
2017/06/15 03:41:23
Done.
ftirelo
2017/06/15 03:41:24
Done.
| |
| 391 {profile}, base::Bind([] {}), nullptr /* use default delegate */); | |
|
Peter Kasting
2017/06/14 17:39:16
Nit: Can you just use OnceClosure() for the penult
ftirelo
2017/06/15 03:41:23
Unfortunately, OnceClosure() will create an unboun
Peter Kasting
2017/06/15 06:28:19
Can we fix that? I thought the basic (non-Once) c
ftirelo
2017/06/15 17:06:36
I'm not sure of the consequences of the change and
| |
| 392 } | |
| 393 #endif | |
| 394 | |
| 385 #if defined(OS_CHROMEOS) | 395 #if defined(OS_CHROMEOS) |
| 386 chromeos::ProfileHelper::Get()->ProfileStartup(profile, process_startup); | 396 chromeos::ProfileHelper::Get()->ProfileStartup(profile, process_startup); |
| 387 #endif | 397 #endif |
| 388 return true; | 398 return true; |
| 389 } | 399 } |
| 390 | 400 |
| 391 // static | 401 // static |
| 392 bool StartupBrowserCreator::WasRestarted() { | 402 bool StartupBrowserCreator::WasRestarted() { |
| 393 // Stores the value of the preference kWasRestarted had when it was read. | 403 // Stores the value of the preference kWasRestarted had when it was read. |
| 394 static bool was_restarted = false; | 404 static bool was_restarted = false; |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1017 if (!entry->IsSigninRequired()) { | 1027 if (!entry->IsSigninRequired()) { |
| 1018 Profile* profile = profile_manager->GetProfile(entry->GetPath()); | 1028 Profile* profile = profile_manager->GetProfile(entry->GetPath()); |
| 1019 if (profile) | 1029 if (profile) |
| 1020 return profile; | 1030 return profile; |
| 1021 } | 1031 } |
| 1022 } | 1032 } |
| 1023 | 1033 |
| 1024 return nullptr; | 1034 return nullptr; |
| 1025 } | 1035 } |
| 1026 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 1036 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| OLD | NEW |