| OLD | NEW |
| 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/browser/ui/startup/default_browser_prompt.h" | 9 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (state == shell_integration::IS_DEFAULT) { | 65 if (state == shell_integration::IS_DEFAULT) { |
| 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 chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui())); | 68 chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui())); |
| 69 } | 69 } |
| 70 | 70 |
| 71 base::FundamentalValue is_default(state == shell_integration::IS_DEFAULT); | 71 base::FundamentalValue is_default(state == shell_integration::IS_DEFAULT); |
| 72 base::FundamentalValue can_be_default( | 72 base::FundamentalValue can_be_default( |
| 73 state != shell_integration::UNKNOWN_DEFAULT && | 73 state != shell_integration::UNKNOWN_DEFAULT && |
| 74 !IsDisabledByPolicy(default_browser_policy_) && | 74 !IsDisabledByPolicy(default_browser_policy_) && |
| 75 shell_integration::CanSetAsDefaultBrowser() != | 75 shell_integration::CanSetAsDefaultBrowser()); |
| 76 shell_integration::SET_DEFAULT_NOT_ALLOWED); | |
| 77 | 76 |
| 78 web_ui()->CallJavascriptFunction("Settings.updateDefaultBrowserState", | 77 web_ui()->CallJavascriptFunction("Settings.updateDefaultBrowserState", |
| 79 is_default, can_be_default); | 78 is_default, can_be_default); |
| 80 } | 79 } |
| 81 | 80 |
| 82 } // namespace settings | 81 } // namespace settings |
| OLD | NEW |