| 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/ui/webui/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #include "content/public/common/page_zoom.h" | 100 #include "content/public/common/page_zoom.h" |
| 101 #include "extensions/browser/extension_registry.h" | 101 #include "extensions/browser/extension_registry.h" |
| 102 #include "google_apis/gaia/gaia_auth_util.h" | 102 #include "google_apis/gaia/gaia_auth_util.h" |
| 103 #include "google_apis/gaia/google_service_auth_error.h" | 103 #include "google_apis/gaia/google_service_auth_error.h" |
| 104 #include "policy/policy_constants.h" | 104 #include "policy/policy_constants.h" |
| 105 #include "third_party/skia/include/core/SkBitmap.h" | 105 #include "third_party/skia/include/core/SkBitmap.h" |
| 106 #include "ui/base/l10n/l10n_util.h" | 106 #include "ui/base/l10n/l10n_util.h" |
| 107 #include "ui/base/webui/web_ui_util.h" | 107 #include "ui/base/webui/web_ui_util.h" |
| 108 | 108 |
| 109 #if !defined(OS_CHROMEOS) | 109 #if !defined(OS_CHROMEOS) |
| 110 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| 110 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" | 111 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" |
| 111 #endif | 112 #endif |
| 112 | 113 |
| 113 #if defined(OS_CHROMEOS) | 114 #if defined(OS_CHROMEOS) |
| 114 #include "ash/ash_switches.h" | 115 #include "ash/ash_switches.h" |
| 115 #include "ash/desktop_background/user_wallpaper_delegate.h" | 116 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 116 #include "ash/shell.h" | 117 #include "ash/shell.h" |
| 117 #include "ash/system/chromeos/devicetype_utils.h" | 118 #include "ash/system/chromeos/devicetype_utils.h" |
| 118 #include "chrome/browser/browser_process_platform_part.h" | 119 #include "chrome/browser/browser_process_platform_part.h" |
| 119 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 120 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 return; | 1118 return; |
| 1118 | 1119 |
| 1119 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); | 1120 content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser")); |
| 1120 UMA_HISTOGRAM_COUNTS("Settings.StartSetAsDefault", true); | 1121 UMA_HISTOGRAM_COUNTS("Settings.StartSetAsDefault", true); |
| 1121 | 1122 |
| 1122 // Callback takes care of updating UI. | 1123 // Callback takes care of updating UI. |
| 1123 default_browser_worker_->StartSetAsDefault(); | 1124 default_browser_worker_->StartSetAsDefault(); |
| 1124 | 1125 |
| 1125 // If the user attempted to make Chrome the default browser, notify | 1126 // If the user attempted to make Chrome the default browser, notify |
| 1126 // them when this changes. | 1127 // them when this changes. |
| 1127 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1128 chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui())); |
| 1128 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void BrowserOptionsHandler::SetDefaultWebClientUIState( | 1131 void BrowserOptionsHandler::SetDefaultWebClientUIState( |
| 1132 shell_integration::DefaultWebClientUIState state) { | 1132 shell_integration::DefaultWebClientUIState state) { |
| 1133 int status_string_id; | 1133 int status_string_id; |
| 1134 | 1134 |
| 1135 if (state == shell_integration::STATE_IS_DEFAULT) { | 1135 if (state == shell_integration::STATE_IS_DEFAULT) { |
| 1136 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; | 1136 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT; |
| 1137 // Notify the user in the future if Chrome ceases to be the user's chosen | 1137 // Notify the user in the future if Chrome ceases to be the user's chosen |
| 1138 // default browser. | 1138 // default browser. |
| 1139 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1139 chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui())); |
| 1140 prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); | |
| 1141 } else if (state == shell_integration::STATE_NOT_DEFAULT) { | 1140 } else if (state == shell_integration::STATE_NOT_DEFAULT) { |
| 1142 if (shell_integration::CanSetAsDefaultBrowser() == | 1141 if (shell_integration::CanSetAsDefaultBrowser() == |
| 1143 shell_integration::SET_DEFAULT_NOT_ALLOWED) { | 1142 shell_integration::SET_DEFAULT_NOT_ALLOWED) { |
| 1144 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; | 1143 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_SXS; |
| 1145 } else { | 1144 } else { |
| 1146 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; | 1145 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT; |
| 1147 } | 1146 } |
| 1148 } else if (state == shell_integration::STATE_UNKNOWN) { | 1147 } else if (state == shell_integration::STATE_UNKNOWN) { |
| 1149 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; | 1148 status_string_id = IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN; |
| 1150 } else { | 1149 } else { |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 | 2128 |
| 2130 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2129 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
| 2131 #if defined(OS_CHROMEOS) | 2130 #if defined(OS_CHROMEOS) |
| 2132 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2131 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
| 2133 #else | 2132 #else |
| 2134 return true; | 2133 return true; |
| 2135 #endif | 2134 #endif |
| 2136 } | 2135 } |
| 2137 | 2136 |
| 2138 } // namespace options | 2137 } // namespace options |
| OLD | NEW |