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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 SetupManageCertificatesSection(); | 889 SetupManageCertificatesSection(); |
890 SetupManagingSupervisedUsers(); | 890 SetupManagingSupervisedUsers(); |
891 SetupEasyUnlock(); | 891 SetupEasyUnlock(); |
892 SetupExtensionControlledIndicators(); | 892 SetupExtensionControlledIndicators(); |
893 | 893 |
894 #if defined(OS_CHROMEOS) | 894 #if defined(OS_CHROMEOS) |
895 SetupAccessibilityFeatures(); | 895 SetupAccessibilityFeatures(); |
896 policy::BrowserPolicyConnectorChromeOS* connector = | 896 policy::BrowserPolicyConnectorChromeOS* connector = |
897 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 897 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
898 if (!connector->IsEnterpriseManaged() && | 898 if (!connector->IsEnterpriseManaged() && |
899 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && | 899 !chromeos::GetUserManager()->IsLoggedInAsGuest() && |
900 !chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 900 !chromeos::GetUserManager()->IsLoggedInAsLocallyManagedUser()) { |
901 web_ui()->CallJavascriptFunction( | 901 web_ui()->CallJavascriptFunction( |
902 "BrowserOptions.enableFactoryResetSection"); | 902 "BrowserOptions.enableFactoryResetSection"); |
903 } | 903 } |
904 | 904 |
905 Profile* profile = Profile::FromWebUI(web_ui()); | 905 Profile* profile = Profile::FromWebUI(web_ui()); |
906 OnAccountPictureManagedChanged( | 906 OnAccountPictureManagedChanged( |
907 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> | 907 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
908 policy_service()->GetPolicies( | 908 policy_service()->GetPolicies( |
909 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 909 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
910 std::string())) | 910 std::string())) |
911 .Get(policy::key::kUserAvatarImage)); | 911 .Get(policy::key::kUserAvatarImage)); |
912 | 912 |
913 OnWallpaperManagedChanged( | 913 OnWallpaperManagedChanged( |
914 chromeos::WallpaperManager::Get()->IsPolicyControlled( | 914 chromeos::WallpaperManager::Get()->IsPolicyControlled( |
915 chromeos::UserManager::Get()->GetActiveUser()->email())); | 915 chromeos::GetUserManager()->GetActiveUser()->email())); |
916 #endif | 916 #endif |
917 } | 917 } |
918 | 918 |
919 // static | 919 // static |
920 void BrowserOptionsHandler::CheckAutoLaunch( | 920 void BrowserOptionsHandler::CheckAutoLaunch( |
921 base::WeakPtr<BrowserOptionsHandler> weak_this, | 921 base::WeakPtr<BrowserOptionsHandler> weak_this, |
922 const base::FilePath& profile_path) { | 922 const base::FilePath& profile_path) { |
923 #if defined(OS_WIN) | 923 #if defined(OS_WIN) |
924 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 924 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
925 | 925 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 1297 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
1298 void BrowserOptionsHandler::ThemesSetNative(const base::ListValue* args) { | 1298 void BrowserOptionsHandler::ThemesSetNative(const base::ListValue* args) { |
1299 content::RecordAction(UserMetricsAction("Options_GtkThemeSet")); | 1299 content::RecordAction(UserMetricsAction("Options_GtkThemeSet")); |
1300 Profile* profile = Profile::FromWebUI(web_ui()); | 1300 Profile* profile = Profile::FromWebUI(web_ui()); |
1301 ThemeServiceFactory::GetForProfile(profile)->UseSystemTheme(); | 1301 ThemeServiceFactory::GetForProfile(profile)->UseSystemTheme(); |
1302 } | 1302 } |
1303 #endif | 1303 #endif |
1304 | 1304 |
1305 #if defined(OS_CHROMEOS) | 1305 #if defined(OS_CHROMEOS) |
1306 void BrowserOptionsHandler::UpdateAccountPicture() { | 1306 void BrowserOptionsHandler::UpdateAccountPicture() { |
1307 std::string email = chromeos::UserManager::Get()->GetLoggedInUser()->email(); | 1307 std::string email = chromeos::GetUserManager()->GetLoggedInUser()->email(); |
1308 if (!email.empty()) { | 1308 if (!email.empty()) { |
1309 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture"); | 1309 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture"); |
1310 base::StringValue email_value(email); | 1310 base::StringValue email_value(email); |
1311 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture", | 1311 web_ui()->CallJavascriptFunction("BrowserOptions.updateAccountPicture", |
1312 email_value); | 1312 email_value); |
1313 } | 1313 } |
1314 } | 1314 } |
1315 | 1315 |
1316 void BrowserOptionsHandler::OnAccountPictureManagedChanged(bool managed) { | 1316 void BrowserOptionsHandler::OnAccountPictureManagedChanged(bool managed) { |
1317 web_ui()->CallJavascriptFunction("BrowserOptions.setAccountPictureManaged", | 1317 web_ui()->CallJavascriptFunction("BrowserOptions.setAccountPictureManaged", |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 extension = extensions::GetExtensionOverridingProxy( | 1800 extension = extensions::GetExtensionOverridingProxy( |
1801 Profile::FromWebUI(web_ui())); | 1801 Profile::FromWebUI(web_ui())); |
1802 AppendExtensionData("proxy", extension, &extension_controlled); | 1802 AppendExtensionData("proxy", extension, &extension_controlled); |
1803 | 1803 |
1804 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1804 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
1805 extension_controlled); | 1805 extension_controlled); |
1806 #endif // defined(OS_WIN) | 1806 #endif // defined(OS_WIN) |
1807 } | 1807 } |
1808 | 1808 |
1809 } // namespace options | 1809 } // namespace options |
OLD | NEW |