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

Unified Diff: chrome/browser/ui/startup/default_browser_prompt.cc

Issue 1344593002: Remove redundant handling of the default_browser_setting_enabled policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/default_browser_prompt.cc
diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc
index 353c3c7bf6297306cd1dceb3d863ad00f86b0e93..67199bf78eebac98fb2960f5c88f74f681ae8266 100644
--- a/chrome/browser/ui/startup/default_browser_prompt.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt.cc
@@ -244,30 +244,21 @@ void RegisterDefaultBrowserPromptPrefs(PrefRegistrySimple* registry) {
}
void ShowDefaultBrowserPrompt(Profile* profile, HostDesktopType desktop_type) {
- // We do not check if we are the default browser if:
- // - There is a policy in control of this setting.
- // We check if we are the default browser but do not prompt if:
- // - The user said "don't ask me again" on the infobar earlier.
- // - The "suppress_default_browser_prompt_for_version" master preference is
- // set to the current version.
- bool show_prompt =
- profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser);
-
+ // Do not check if Chrome is the default browser if there is a policy in
+ // control of this setting.
if (g_browser_process->local_state()->IsManagedPreference(
prefs::kDefaultBrowserSettingEnabled)) {
- if (g_browser_process->local_state()->GetBoolean(
- prefs::kDefaultBrowserSettingEnabled)) {
- content::BrowserThread::PostTask(
- content::BrowserThread::FILE, FROM_HERE,
- base::Bind(
- base::IgnoreResult(&ShellIntegration::SetAsDefaultBrowser)));
- } else {
- // TODO(pastarmovj): We can't really do anything meaningful here yet but
- // just prevent showing the infobar.
- }
+ // Handling of the browser.default_browser_setting_enabled policy setting is
+ // taken care of in BrowserProcessImpl.
return;
}
+ // Check if Chrome is the default browser but do not prompt if:
+ // - The user said "don't ask me again" on the infobar earlier.
+ // - The "suppress_default_browser_prompt_for_version" master preference is
+ // set to the current version.
+ bool show_prompt =
+ profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser);
if (show_prompt) {
const std::string disable_version_string =
g_browser_process->local_state()->GetString(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698