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 "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 base::DictionaryValue dict; | 96 base::DictionaryValue dict; |
97 dict.SetBoolean("isDefault", state == shell_integration::IS_DEFAULT); | 97 dict.SetBoolean("isDefault", state == shell_integration::IS_DEFAULT); |
98 dict.SetBoolean("canBeDefault", | 98 dict.SetBoolean("canBeDefault", |
99 shell_integration::CanSetAsDefaultBrowser()); | 99 shell_integration::CanSetAsDefaultBrowser()); |
100 dict.SetBoolean("isUnknownError", | 100 dict.SetBoolean("isUnknownError", |
101 state == shell_integration::UNKNOWN_DEFAULT); | 101 state == shell_integration::UNKNOWN_DEFAULT); |
102 dict.SetBoolean("isDisabledByPolicy", DefaultBrowserIsDisabledByPolicy()); | 102 dict.SetBoolean("isDisabledByPolicy", DefaultBrowserIsDisabledByPolicy()); |
103 | 103 |
104 CallJavascriptFunction("cr.webUIListenerCallback", | 104 FireWebUIListener("settings.updateDefaultBrowserState", dict); |
105 base::Value("settings.updateDefaultBrowserState"), | |
106 dict); | |
107 } | 105 } |
108 | 106 |
109 } // namespace settings | 107 } // namespace settings |
OLD | NEW |