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 15 matching lines...) Expand all Loading... | |
| 26 #include "base/scoped_native_library.h" | 26 #include "base/scoped_native_library.h" |
| 27 #include "base/strings/string_number_conversions.h" | 27 #include "base/strings/string_number_conversions.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/threading/sequenced_worker_pool.h" | 29 #include "base/threading/sequenced_worker_pool.h" |
| 30 #include "base/version.h" | 30 #include "base/version.h" |
| 31 #include "base/win/pe_image.h" | 31 #include "base/win/pe_image.h" |
| 32 #include "base/win/registry.h" | 32 #include "base/win/registry.h" |
| 33 #include "base/win/win_util.h" | 33 #include "base/win/win_util.h" |
| 34 #include "base/win/windows_version.h" | 34 #include "base/win/windows_version.h" |
| 35 #include "base/win/wrapped_window_proc.h" | 35 #include "base/win/wrapped_window_proc.h" |
| 36 #include "chrome/browser/browser_process.h" | |
| 36 #include "chrome/browser/conflicts/module_database_win.h" | 37 #include "chrome/browser/conflicts/module_database_win.h" |
| 37 #include "chrome/browser/conflicts/module_event_sink_impl_win.h" | 38 #include "chrome/browser/conflicts/module_event_sink_impl_win.h" |
| 38 #include "chrome/browser/first_run/first_run.h" | 39 #include "chrome/browser/first_run/first_run.h" |
| 39 #include "chrome/browser/install_verification/win/install_verification.h" | 40 #include "chrome/browser/install_verification/win/install_verification.h" |
| 41 #include "chrome/browser/profiles/profile_manager.h" | |
| 40 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 42 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 43 #include "chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h" | |
| 41 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_config.h" | 44 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_config.h" |
| 42 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_controller.h" | 45 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_controller.h" |
| 43 #include "chrome/browser/shell_integration.h" | 46 #include "chrome/browser/shell_integration.h" |
| 44 #include "chrome/browser/ui/simple_message_box.h" | 47 #include "chrome/browser/ui/simple_message_box.h" |
| 45 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 48 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 46 #include "chrome/browser/win/browser_util.h" | 49 #include "chrome/browser/win/browser_util.h" |
| 47 #include "chrome/browser/win/chrome_elf_init.h" | 50 #include "chrome/browser/win/chrome_elf_init.h" |
| 48 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" | 51 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" |
| 49 #include "chrome/common/chrome_constants.h" | 52 #include "chrome/common/chrome_constants.h" |
| 50 #include "chrome/common/chrome_features.h" | 53 #include "chrome/common/chrome_features.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 | 364 |
| 362 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); | 365 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); |
| 363 | 366 |
| 364 // Set up a task to verify installed modules in the current process. | 367 // Set up a task to verify installed modules in the current process. |
| 365 content::BrowserThread::PostAfterStartupTask( | 368 content::BrowserThread::PostAfterStartupTask( |
| 366 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 369 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| 367 base::Bind(&VerifyInstallation)); | 370 base::Bind(&VerifyInstallation)); |
| 368 | 371 |
| 369 InitializeChromeElf(); | 372 InitializeChromeElf(); |
| 370 | 373 |
| 374 // Reset settings for the current profile if it's tagged to be reset after a | |
| 375 // complete run of the Chrome Cleanup tool. | |
| 376 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { | |
| 377 // Using last opened profiles, because we want to find reset the profile | |
| 378 // that was open in the last Chrome run, which may not be open yet in | |
| 379 // the current run. | |
| 380 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( | |
| 381 g_browser_process->profile_manager()->GetLastOpenedProfiles(), | |
| 382 base::BindOnce([] {}), | |
|
Nico
2017/06/15 20:57:31
does `base::OnceClosure()` do the same thing? if s
Peter Kasting
2017/06/15 20:59:58
See replies to me saying the same thing earlier.
ftirelo
2017/06/15 23:36:33
Acknowledged.
ftirelo
2017/06/15 23:36:33
I think it should. Let's discuss separately in a f
| |
| 383 base::MakeUnique< | |
| 384 safe_browsing::PostCleanupSettingsResetter::Delegate>()); | |
| 385 } | |
| 386 | |
| 371 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { | 387 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { |
| 372 content::BrowserThread::PostAfterStartupTask( | 388 content::BrowserThread::PostAfterStartupTask( |
| 373 FROM_HERE, | 389 FROM_HERE, |
| 374 content::BrowserThread::GetTaskRunnerForThread( | 390 content::BrowserThread::GetTaskRunnerForThread( |
| 375 content::BrowserThread::UI), | 391 content::BrowserThread::UI), |
| 376 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); | 392 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); |
| 377 } | 393 } |
| 378 | 394 |
| 379 // Record UMA data about whether the fault-tolerant heap is enabled. | 395 // Record UMA data about whether the fault-tolerant heap is enabled. |
| 380 // Use a delayed task to minimize the impact on startup time. | 396 // Use a delayed task to minimize the impact on startup time. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 if (resource_id) | 564 if (resource_id) |
| 549 return l10n_util::GetStringUTF16(resource_id); | 565 return l10n_util::GetStringUTF16(resource_id); |
| 550 return base::string16(); | 566 return base::string16(); |
| 551 } | 567 } |
| 552 | 568 |
| 553 // static | 569 // static |
| 554 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 570 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 555 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 571 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 556 installer::SetTranslationDelegate(&delegate); | 572 installer::SetTranslationDelegate(&delegate); |
| 557 } | 573 } |
| OLD | NEW |