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

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 2906103002: Post-cleanup settings reset. (Closed)
Patch Set: Use base::DoNothing Created 3 years, 6 months 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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>
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <memory> 13 #include <memory>
14 14
15 #include "base/base_switches.h" 15 #include "base/base_switches.h"
16 #include "base/bind_helpers.h"
16 #include "base/command_line.h" 17 #include "base/command_line.h"
17 #include "base/environment.h" 18 #include "base/environment.h"
18 #include "base/files/file_enumerator.h" 19 #include "base/files/file_enumerator.h"
19 #include "base/files/file_path.h" 20 #include "base/files/file_path.h"
20 #include "base/files/file_util.h" 21 #include "base/files/file_util.h"
21 #include "base/i18n/rtl.h" 22 #include "base/i18n/rtl.h"
22 #include "base/location.h" 23 #include "base/location.h"
23 #include "base/macros.h" 24 #include "base/macros.h"
24 #include "base/metrics/histogram_macros.h" 25 #include "base/metrics/histogram_macros.h"
25 #include "base/path_service.h" 26 #include "base/path_service.h"
26 #include "base/scoped_native_library.h" 27 #include "base/scoped_native_library.h"
27 #include "base/strings/string_number_conversions.h" 28 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
29 #include "base/threading/sequenced_worker_pool.h" 30 #include "base/threading/sequenced_worker_pool.h"
30 #include "base/version.h" 31 #include "base/version.h"
31 #include "base/win/pe_image.h" 32 #include "base/win/pe_image.h"
32 #include "base/win/registry.h" 33 #include "base/win/registry.h"
33 #include "base/win/win_util.h" 34 #include "base/win/win_util.h"
34 #include "base/win/windows_version.h" 35 #include "base/win/windows_version.h"
35 #include "base/win/wrapped_window_proc.h" 36 #include "base/win/wrapped_window_proc.h"
37 #include "chrome/browser/browser_process.h"
36 #include "chrome/browser/conflicts/module_database_win.h" 38 #include "chrome/browser/conflicts/module_database_win.h"
37 #include "chrome/browser/conflicts/module_event_sink_impl_win.h" 39 #include "chrome/browser/conflicts/module_event_sink_impl_win.h"
38 #include "chrome/browser/first_run/first_run.h" 40 #include "chrome/browser/first_run/first_run.h"
39 #include "chrome/browser/install_verification/win/install_verification.h" 41 #include "chrome/browser/install_verification/win/install_verification.h"
42 #include "chrome/browser/profiles/profile_manager.h"
40 #include "chrome/browser/profiles/profile_shortcut_manager.h" 43 #include "chrome/browser/profiles/profile_shortcut_manager.h"
44 #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" 45 #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" 46 #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prom pt_controller.h"
43 #include "chrome/browser/shell_integration.h" 47 #include "chrome/browser/shell_integration.h"
44 #include "chrome/browser/ui/simple_message_box.h" 48 #include "chrome/browser/ui/simple_message_box.h"
45 #include "chrome/browser/ui/uninstall_browser_prompt.h" 49 #include "chrome/browser/ui/uninstall_browser_prompt.h"
46 #include "chrome/browser/win/browser_util.h" 50 #include "chrome/browser/win/browser_util.h"
47 #include "chrome/browser/win/chrome_elf_init.h" 51 #include "chrome/browser/win/chrome_elf_init.h"
48 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" 52 #include "chrome/chrome_watcher/chrome_watcher_main_api.h"
49 #include "chrome/common/chrome_constants.h" 53 #include "chrome/common/chrome_constants.h"
50 #include "chrome/common/chrome_features.h" 54 #include "chrome/common/chrome_features.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 365
362 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); 366 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr));
363 367
364 // Set up a task to verify installed modules in the current process. 368 // Set up a task to verify installed modules in the current process.
365 content::BrowserThread::PostAfterStartupTask( 369 content::BrowserThread::PostAfterStartupTask(
366 FROM_HERE, content::BrowserThread::GetBlockingPool(), 370 FROM_HERE, content::BrowserThread::GetBlockingPool(),
367 base::Bind(&VerifyInstallation)); 371 base::Bind(&VerifyInstallation));
368 372
369 InitializeChromeElf(); 373 InitializeChromeElf();
370 374
375 // Reset settings for the current profile if it's tagged to be reset after a
376 // complete run of the Chrome Cleanup tool.
377 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) {
378 // Using last opened profiles, because we want to find reset the profile
379 // that was open in the last Chrome run, which may not be open yet in
380 // the current run.
381 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles(
382 g_browser_process->profile_manager()->GetLastOpenedProfiles(),
383 base::BindOnce(&base::DoNothing),
384 base::MakeUnique<
385 safe_browsing::PostCleanupSettingsResetter::Delegate>());
386 }
387
371 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { 388 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) {
372 content::BrowserThread::PostAfterStartupTask( 389 content::BrowserThread::PostAfterStartupTask(
373 FROM_HERE, 390 FROM_HERE,
374 content::BrowserThread::GetTaskRunnerForThread( 391 content::BrowserThread::GetTaskRunnerForThread(
375 content::BrowserThread::UI), 392 content::BrowserThread::UI),
376 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); 393 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay));
377 } 394 }
378 395
379 // Record UMA data about whether the fault-tolerant heap is enabled. 396 // Record UMA data about whether the fault-tolerant heap is enabled.
380 // Use a delayed task to minimize the impact on startup time. 397 // Use a delayed task to minimize the impact on startup time.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 if (resource_id) 565 if (resource_id)
549 return l10n_util::GetStringUTF16(resource_id); 566 return l10n_util::GetStringUTF16(resource_id);
550 return base::string16(); 567 return base::string16();
551 } 568 }
552 569
553 // static 570 // static
554 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 571 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
555 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 572 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
556 installer::SetTranslationDelegate(&delegate); 573 installer::SetTranslationDelegate(&delegate);
557 } 574 }
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698