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 void MaybePostSettingsResetPrompt() { |
| 235 if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { |
| 236 content::BrowserThread::PostAfterStartupTask( |
| 237 FROM_HERE, |
| 238 content::BrowserThread::GetTaskRunnerForThread( |
| 239 content::BrowserThread::UI), |
| 240 base::Bind(safe_browsing::MaybeShowSettingsResetPromptWithDelay)); |
| 241 } |
| 242 } |
| 243 |
234 } // namespace | 244 } // namespace |
235 | 245 |
236 void ShowCloseBrowserFirstMessageBox() { | 246 void ShowCloseBrowserFirstMessageBox() { |
237 int message_id = IDS_UNINSTALL_CLOSE_APP; | 247 int message_id = IDS_UNINSTALL_CLOSE_APP; |
238 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 248 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
239 (shell_integration::GetDefaultBrowser() == | 249 (shell_integration::GetDefaultBrowser() == |
240 shell_integration::IS_DEFAULT)) { | 250 shell_integration::IS_DEFAULT)) { |
241 message_id = IDS_UNINSTALL_CLOSE_APP_IMMERSIVE; | 251 message_id = IDS_UNINSTALL_CLOSE_APP_IMMERSIVE; |
242 } | 252 } |
243 chrome::ShowWarningMessageBox(NULL, | 253 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)); | 379 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice(nullptr)); |
370 | 380 |
371 // Set up a task to verify installed modules in the current process. | 381 // Set up a task to verify installed modules in the current process. |
372 content::BrowserThread::PostAfterStartupTask( | 382 content::BrowserThread::PostAfterStartupTask( |
373 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 383 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
374 base::Bind(&VerifyInstallation)); | 384 base::Bind(&VerifyInstallation)); |
375 | 385 |
376 InitializeChromeElf(); | 386 InitializeChromeElf(); |
377 | 387 |
378 // Reset settings for the current profile if it's tagged to be reset after a | 388 // Reset settings for the current profile if it's tagged to be reset after a |
379 // complete run of the Chrome Cleanup tool. | 389 // complete run of the Chrome Cleanup tool. If post-cleanup settings reset is |
| 390 // enabled, we delay checks for settings reset prompt until the scheduled |
| 391 // reset is finished. |
380 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { | 392 if (safe_browsing::PostCleanupSettingsResetter::IsEnabled()) { |
381 // Using last opened profiles, because we want to find reset the profile | 393 // 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 | 394 // that was open in the last Chrome run, which may not be open yet in |
383 // the current run. | 395 // the current run. |
384 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( | 396 safe_browsing::PostCleanupSettingsResetter().ResetTaggedProfiles( |
385 g_browser_process->profile_manager()->GetLastOpenedProfiles(), | 397 g_browser_process->profile_manager()->GetLastOpenedProfiles(), |
386 base::BindOnce(&base::DoNothing), | 398 base::BindOnce(&MaybePostSettingsResetPrompt), |
387 base::MakeUnique< | 399 base::MakeUnique< |
388 safe_browsing::PostCleanupSettingsResetter::Delegate>()); | 400 safe_browsing::PostCleanupSettingsResetter::Delegate>()); |
389 } | 401 } else { |
390 | 402 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 } | 403 } |
398 | 404 |
399 // Record UMA data about whether the fault-tolerant heap is enabled. | 405 // Record UMA data about whether the fault-tolerant heap is enabled. |
400 // Use a delayed task to minimize the impact on startup time. | 406 // Use a delayed task to minimize the impact on startup time. |
401 content::BrowserThread::PostDelayedTask( | 407 content::BrowserThread::PostDelayedTask( |
402 content::BrowserThread::UI, | 408 content::BrowserThread::UI, |
403 FROM_HERE, | 409 FROM_HERE, |
404 base::Bind(&DetectFaultTolerantHeap), | 410 base::Bind(&DetectFaultTolerantHeap), |
405 base::TimeDelta::FromMinutes(1)); | 411 base::TimeDelta::FromMinutes(1)); |
406 } | 412 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 if (resource_id) | 574 if (resource_id) |
569 return l10n_util::GetStringUTF16(resource_id); | 575 return l10n_util::GetStringUTF16(resource_id); |
570 return base::string16(); | 576 return base::string16(); |
571 } | 577 } |
572 | 578 |
573 // static | 579 // static |
574 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 580 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
575 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 581 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
576 installer::SetTranslationDelegate(&delegate); | 582 installer::SetTranslationDelegate(&delegate); |
577 } | 583 } |
OLD | NEW |