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

Side by Side Diff: chrome/browser/ui/webui/settings/settings_default_browser_handler.cc

Issue 1832853003: DefaultBrowserWorker now fully supports opening the settings for Win10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sky comments + refactoring Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/webui/settings/settings_default_browser_handler.h" 5 #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "components/prefs/pref_service.h" 10 #include "components/prefs/pref_service.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Notify the user in the future if Chrome ceases to be the user's chosen 66 // Notify the user in the future if Chrome ceases to be the user's chosen
67 // default browser. 67 // default browser.
68 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( 68 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean(
69 prefs::kCheckDefaultBrowser, true); 69 prefs::kCheckDefaultBrowser, true);
70 } 70 }
71 71
72 base::FundamentalValue is_default(state == shell_integration::IS_DEFAULT); 72 base::FundamentalValue is_default(state == shell_integration::IS_DEFAULT);
73 base::FundamentalValue can_be_default( 73 base::FundamentalValue can_be_default(
74 state != shell_integration::UNKNOWN_DEFAULT && 74 state != shell_integration::UNKNOWN_DEFAULT &&
75 !IsDisabledByPolicy(default_browser_policy_) && 75 !IsDisabledByPolicy(default_browser_policy_) &&
76 shell_integration::CanSetAsDefaultBrowser() != 76 shell_integration::CanSetAsDefaultBrowser());
77 shell_integration::SET_DEFAULT_NOT_ALLOWED);
78 77
79 web_ui()->CallJavascriptFunction("Settings.updateDefaultBrowserState", 78 web_ui()->CallJavascriptFunction("Settings.updateDefaultBrowserState",
80 is_default, can_be_default); 79 is_default, can_be_default);
81 } 80 }
82 81
83 } // namespace settings 82 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698