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/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 // process a manual notification is sent before wiring up the ModuleWatcher. | 224 // process a manual notification is sent before wiring up the ModuleWatcher. |
| 225 module_database->OnProcessStarted(process_id, creation_time, | 225 module_database->OnProcessStarted(process_id, creation_time, |
| 226 content::PROCESS_TYPE_BROWSER); | 226 content::PROCESS_TYPE_BROWSER); |
| 227 *module_watcher = ModuleWatcher::Create( | 227 *module_watcher = ModuleWatcher::Create( |
| 228 base::Bind(&OnModuleEvent, process_id, creation_time)); | 228 base::Bind(&OnModuleEvent, process_id, creation_time)); |
| 229 *shell_extension_enumerator_ = base::MakeUnique<ShellExtensionEnumerator>( | 229 *shell_extension_enumerator_ = base::MakeUnique<ShellExtensionEnumerator>( |
| 230 base::Bind(&ModuleDatabase::OnShellExtensionEnumerated, | 230 base::Bind(&ModuleDatabase::OnShellExtensionEnumerated, |
| 231 base::Unretained(module_database))); | 231 base::Unretained(module_database))); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // Posts the settings reset prompt to be shown after startup if feature | |
|
csharp
2017/07/06 17:09:01
nit: I'm not sure if this comment adds much, since
| |
| 235 // kSettingsResetPrompt is enabled. | |
| 236 void MaybePostSettingsResetPrompt() { | |
| 237 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { | |
| 238 content::BrowserThread::PostAfterStartupTask( | |
| 239 FROM_HERE, | |
| 240 content::BrowserThread::GetTaskRunnerForThread( | |
| 241 content::BrowserThread::UI), | |
| 242 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); | |
| 243 } | |
| 244 } | |
| 245 | |
| 234 } // namespace | 246 } // namespace |
| 235 | 247 |
| 236 void ShowCloseBrowserFirstMessageBox() { | 248 void ShowCloseBrowserFirstMessageBox() { |
| 237 int message_id = IDS_UNINSTALL_CLOSE_APP; | 249 int message_id = IDS_UNINSTALL_CLOSE_APP; |
| 238 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 250 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 239 (shell_integration::GetDefaultBrowser() == | 251 (shell_integration::GetDefaultBrowser() == |
| 240 shell_integration::IS_DEFAULT)) { | 252 shell_integration::IS_DEFAULT)) { |
| 241 message_id = IDS_UNINSTALL_CLOSE_APP_IMMERSIVE; | 253 message_id = IDS_UNINSTALL_CLOSE_APP_IMMERSIVE; |
| 242 } | 254 } |
| 243 chrome::ShowWarningMessageBox(NULL, | 255 chrome::ShowWarningMessageBox(NULL, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); | 381 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); |
| 370 | 382 |
| 371 // Set up a task to verify installed modules in the current process. | 383 // Set up a task to verify installed modules in the current process. |
| 372 content::BrowserThread::PostAfterStartupTask( | 384 content::BrowserThread::PostAfterStartupTask( |
| 373 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 385 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| 374 base::Bind(&VerifyInstallation)); | 386 base::Bind(&VerifyInstallation)); |
| 375 | 387 |
| 376 InitializeChromeElf(); | 388 InitializeChromeElf(); |
| 377 | 389 |
| 378 // Reset settings for the current profile if it's tagged to be reset after a | 390 // Reset settings for the current profile if it's tagged to be reset after a |
| 379 // complete run of the Chrome Cleanup tool. | 391 // complete run of the Chrome Cleanup tool. If post-cleanup settings reset is |
| 392 // enabled, we delay checks for settings reset prompt until the scheduled | |
| 393 // reset is finished. | |
| 380 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { | 394 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { |
| 381 // Using last opened profiles, because we want to find reset the profile | 395 // Using last opened profiles, because we want to find reset the profile |
| 382 // that was open in the last Chrome run, which may not be open yet in | 396 // that was open in the last Chrome run, which may not be open yet in |
| 383 // the current run. | 397 // the current run. |
| 384 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( | 398 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( |
| 385 g_browser_process->profile_manager()->GetLastOpenedProfiles(), | 399 g_browser_process->profile_manager()->GetLastOpenedProfiles(), |
| 386 base::BindOnce(&base::DoNothing), | 400 base::BindOnce(&MaybePostSettingsResetPrompt), |
| 387 base::MakeUnique< | 401 base::MakeUnique< |
| 388 safe_browsing::PostCleanupSettingsResetter::Delegate>()); | 402 safe_browsing::PostCleanupSettingsResetter::Delegate>()); |
| 389 } | 403 } else { |
| 390 | 404 MaybePostSettingsResetPrompt(); |
| 391 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { | |
| 392 content::BrowserThread::PostAfterStartupTask( | |
| 393 FROM_HERE, | |
| 394 content::BrowserThread::GetTaskRunnerForThread( | |
| 395 content::BrowserThread::UI), | |
| 396 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); | |
| 397 } | 405 } |
| 398 | 406 |
| 399 // Record UMA data about whether the fault-tolerant heap is enabled. | 407 // Record UMA data about whether the fault-tolerant heap is enabled. |
| 400 // Use a delayed task to minimize the impact on startup time. | 408 // Use a delayed task to minimize the impact on startup time. |
| 401 content::BrowserThread::PostDelayedTask( | 409 content::BrowserThread::PostDelayedTask( |
| 402 content::BrowserThread::UI, | 410 content::BrowserThread::UI, |
| 403 FROM_HERE, | 411 FROM_HERE, |
| 404 base::Bind(&DetectFaultTolerantHeap), | 412 base::Bind(&DetectFaultTolerantHeap), |
| 405 base::TimeDelta::FromMinutes(1)); | 413 base::TimeDelta::FromMinutes(1)); |
| 406 } | 414 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 568 if (resource_id) | 576 if (resource_id) |
| 569 return l10n_util::GetStringUTF16(resource_id); | 577 return l10n_util::GetStringUTF16(resource_id); |
| 570 return base::string16(); | 578 return base::string16(); |
| 571 } | 579 } |
| 572 | 580 |
| 573 // static | 581 // static |
| 574 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 582 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 575 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 583 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 576 installer::SetTranslationDelegate(&delegate); | 584 installer::SetTranslationDelegate(&delegate); |
| 577 } | 585 } |
| OLD | NEW |