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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_window.h" | 10 #include "apps/app_window.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" | 98 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" |
99 #endif | 99 #endif |
100 | 100 |
101 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
102 #include "ash/ash_switches.h" | 102 #include "ash/ash_switches.h" |
103 #include "ash/desktop_background/user_wallpaper_delegate.h" | 103 #include "ash/desktop_background/user_wallpaper_delegate.h" |
104 #include "ash/magnifier/magnifier_constants.h" | 104 #include "ash/magnifier/magnifier_constants.h" |
105 #include "ash/shell.h" | 105 #include "ash/shell.h" |
106 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 106 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
107 #include "chrome/browser/chromeos/chromeos_utils.h" | 107 #include "chrome/browser/chromeos/chromeos_utils.h" |
108 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
109 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 108 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
110 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 109 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
111 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 110 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
112 #include "chrome/browser/chromeos/reset/metrics.h" | 111 #include "chrome/browser/chromeos/reset/metrics.h" |
113 #include "chrome/browser/chromeos/settings/cros_settings.h" | 112 #include "chrome/browser/chromeos/settings/cros_settings.h" |
114 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 113 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
115 #include "chrome/browser/chromeos/system/timezone_util.h" | 114 #include "chrome/browser/chromeos/system/timezone_util.h" |
116 #include "chrome/browser/policy/profile_policy_connector.h" | 115 #include "chrome/browser/policy/profile_policy_connector.h" |
117 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 116 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
118 #include "chrome/browser/ui/browser_window.h" | 117 #include "chrome/browser/ui/browser_window.h" |
119 #include "chromeos/dbus/dbus_thread_manager.h" | 118 #include "chromeos/dbus/dbus_thread_manager.h" |
120 #include "chromeos/dbus/power_manager_client.h" | 119 #include "chromeos/dbus/power_manager_client.h" |
121 #include "components/policy/core/common/policy_map.h" | 120 #include "components/policy/core/common/policy_map.h" |
122 #include "components/policy/core/common/policy_namespace.h" | 121 #include "components/policy/core/common/policy_namespace.h" |
123 #include "components/policy/core/common/policy_service.h" | 122 #include "components/policy/core/common/policy_service.h" |
124 #include "components/user_manager/user.h" | 123 #include "components/user_manager/user.h" |
| 124 #include "components/user_manager/user_manager.h" |
125 #include "policy/policy_constants.h" | 125 #include "policy/policy_constants.h" |
126 #include "policy/proto/device_management_backend.pb.h" | 126 #include "policy/proto/device_management_backend.pb.h" |
127 #include "ui/gfx/image/image_skia.h" | 127 #include "ui/gfx/image/image_skia.h" |
128 #endif // defined(OS_CHROMEOS) | 128 #endif // defined(OS_CHROMEOS) |
129 | 129 |
130 #if defined(OS_WIN) | 130 #if defined(OS_WIN) |
131 #include "chrome/browser/extensions/settings_api_helpers.h" | 131 #include "chrome/browser/extensions/settings_api_helpers.h" |
132 #include "chrome/installer/util/auto_launch_util.h" | 132 #include "chrome/installer/util/auto_launch_util.h" |
133 #include "content/public/browser/browser_url_handler.h" | 133 #include "content/public/browser/browser_url_handler.h" |
134 #endif // defined(OS_WIN) | 134 #endif // defined(OS_WIN) |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 SetupManageCertificatesSection(); | 935 SetupManageCertificatesSection(); |
936 SetupManagingSupervisedUsers(); | 936 SetupManagingSupervisedUsers(); |
937 SetupEasyUnlock(); | 937 SetupEasyUnlock(); |
938 SetupExtensionControlledIndicators(); | 938 SetupExtensionControlledIndicators(); |
939 | 939 |
940 #if defined(OS_CHROMEOS) | 940 #if defined(OS_CHROMEOS) |
941 SetupAccessibilityFeatures(); | 941 SetupAccessibilityFeatures(); |
942 policy::BrowserPolicyConnectorChromeOS* connector = | 942 policy::BrowserPolicyConnectorChromeOS* connector = |
943 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 943 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
944 if (!connector->IsEnterpriseManaged() && | 944 if (!connector->IsEnterpriseManaged() && |
945 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && | 945 !user_manager::UserManager::Get()->IsLoggedInAsGuest() && |
946 !chromeos::UserManager::Get()->IsLoggedInAsSupervisedUser()) { | 946 !user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) { |
947 web_ui()->CallJavascriptFunction( | 947 web_ui()->CallJavascriptFunction( |
948 "BrowserOptions.enableFactoryResetSection"); | 948 "BrowserOptions.enableFactoryResetSection"); |
949 } | 949 } |
950 | 950 |
951 Profile* profile = Profile::FromWebUI(web_ui()); | 951 Profile* profile = Profile::FromWebUI(web_ui()); |
952 OnAccountPictureManagedChanged( | 952 OnAccountPictureManagedChanged( |
953 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> | 953 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
954 policy_service()->GetPolicies( | 954 policy_service()->GetPolicies( |
955 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 955 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
956 std::string())) | 956 std::string())) |
957 .Get(policy::key::kUserAvatarImage)); | 957 .Get(policy::key::kUserAvatarImage)); |
958 | 958 |
959 OnWallpaperManagedChanged( | 959 OnWallpaperManagedChanged( |
960 chromeos::WallpaperManager::Get()->IsPolicyControlled( | 960 chromeos::WallpaperManager::Get()->IsPolicyControlled( |
961 chromeos::UserManager::Get()->GetActiveUser()->email())); | 961 user_manager::UserManager::Get()->GetActiveUser()->email())); |
962 #endif | 962 #endif |
963 } | 963 } |
964 | 964 |
965 // static | 965 // static |
966 void BrowserOptionsHandler::CheckAutoLaunch( | 966 void BrowserOptionsHandler::CheckAutoLaunch( |
967 base::WeakPtr<BrowserOptionsHandler> weak_this, | 967 base::WeakPtr<BrowserOptionsHandler> weak_this, |
968 const base::FilePath& profile_path) { | 968 const base::FilePath& profile_path) { |
969 #if defined(OS_WIN) | 969 #if defined(OS_WIN) |
970 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 970 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
971 | 971 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 1344 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
1345 void BrowserOptionsHandler::ThemesSetNative(const base::ListValue* args) { | 1345 void BrowserOptionsHandler::ThemesSetNative(const base::ListValue* args) { |
1346 content::RecordAction(UserMetricsAction("Options_GtkThemeSet")); | 1346 content::RecordAction(UserMetricsAction("Options_GtkThemeSet")); |
1347 Profile* profile = Profile::FromWebUI(web_ui()); | 1347 Profile* profile = Profile::FromWebUI(web_ui()); |
1348 ThemeServiceFactory::GetForProfile(profile)->UseSystemTheme(); | 1348 ThemeServiceFactory::GetForProfile(profile)->UseSystemTheme(); |
1349 } | 1349 } |
1350 #endif | 1350 #endif |
1351 | 1351 |
1352 #if defined(OS_CHROMEOS) | 1352 #if defined(OS_CHROMEOS) |
1353 void BrowserOptionsHandler::UpdateAccountPicture() { | 1353 void BrowserOptionsHandler::UpdateAccountPicture() { |
1354 std::string email = chromeos::UserManager::Get()->GetLoggedInUser()->email(); | 1354 std::string email = |
| 1355 user_manager::UserManager::Get()->GetLoggedInUser()->email(); |
1355 if (!email.empty()) { | 1356 if (!email.empty()) { |
1356 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture"); | 1357 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture"); |
1357 base::StringValue email_value(email); | 1358 base::StringValue email_value(email); |
1358 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture", | 1359 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture", |
1359 email_value); | 1360 email_value); |
1360 } | 1361 } |
1361 } | 1362 } |
1362 | 1363 |
1363 void BrowserOptionsHandler::OnAccountPictureManagedChanged(bool managed) { | 1364 void BrowserOptionsHandler::OnAccountPictureManagedChanged(bool managed) { |
1364 web_ui()->CallJavascriptFunction("BrowserOptions.setAccountPictureManaged", | 1365 web_ui()->CallJavascriptFunction("BrowserOptions.setAccountPictureManaged", |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 extension = extensions::GetExtensionOverridingProxy( | 1887 extension = extensions::GetExtensionOverridingProxy( |
1887 Profile::FromWebUI(web_ui())); | 1888 Profile::FromWebUI(web_ui())); |
1888 AppendExtensionData("proxy", extension, &extension_controlled); | 1889 AppendExtensionData("proxy", extension, &extension_controlled); |
1889 | 1890 |
1890 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1891 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
1891 extension_controlled); | 1892 extension_controlled); |
1892 #endif // defined(OS_WIN) | 1893 #endif // defined(OS_WIN) |
1893 } | 1894 } |
1894 | 1895 |
1895 } // namespace options | 1896 } // namespace options |
OLD | NEW |