| 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/shell_window.h" | 10 #include "apps/shell_window.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 { "autoclickDelayVeryShort", | 372 { "autoclickDelayVeryShort", |
| 373 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_SHORT }, | 373 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_SHORT }, |
| 374 { "autoclickDelayShort", | 374 { "autoclickDelayShort", |
| 375 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_SHORT }, | 375 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_SHORT }, |
| 376 { "autoclickDelayLong", | 376 { "autoclickDelayLong", |
| 377 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_LONG }, | 377 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_LONG }, |
| 378 { "autoclickDelayVeryLong", | 378 { "autoclickDelayVeryLong", |
| 379 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_LONG }, | 379 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_LONG }, |
| 380 { "enableContentProtectionAttestation", | 380 { "enableContentProtectionAttestation", |
| 381 IDS_OPTIONS_ENABLE_CONTENT_PROTECTION_ATTESTATION }, | 381 IDS_OPTIONS_ENABLE_CONTENT_PROTECTION_ATTESTATION }, |
| 382 { "enableHotwordAppList", IDS_OPTIONS_ENABLE_HOTWORD_APP_LIST }, |
| 382 { "factoryResetHeading", IDS_OPTIONS_FACTORY_RESET_HEADING }, | 383 { "factoryResetHeading", IDS_OPTIONS_FACTORY_RESET_HEADING }, |
| 383 { "factoryResetTitle", IDS_OPTIONS_FACTORY_RESET }, | 384 { "factoryResetTitle", IDS_OPTIONS_FACTORY_RESET }, |
| 384 { "factoryResetRestart", IDS_OPTIONS_FACTORY_RESET_BUTTON }, | 385 { "factoryResetRestart", IDS_OPTIONS_FACTORY_RESET_BUTTON }, |
| 385 { "factoryResetDataRestart", IDS_RELAUNCH_BUTTON }, | 386 { "factoryResetDataRestart", IDS_RELAUNCH_BUTTON }, |
| 386 { "factoryResetWarning", IDS_OPTIONS_FACTORY_RESET_WARNING }, | 387 { "factoryResetWarning", IDS_OPTIONS_FACTORY_RESET_WARNING }, |
| 387 { "factoryResetHelpUrl", IDS_FACTORY_RESET_HELP_URL }, | 388 { "factoryResetHelpUrl", IDS_FACTORY_RESET_HELP_URL }, |
| 388 { "changePicture", IDS_OPTIONS_CHANGE_PICTURE }, | 389 { "changePicture", IDS_OPTIONS_CHANGE_PICTURE }, |
| 389 { "changePictureCaption", IDS_OPTIONS_CHANGE_PICTURE_CAPTION }, | 390 { "changePictureCaption", IDS_OPTIONS_CHANGE_PICTURE_CAPTION }, |
| 390 { "datetimeTitle", IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME }, | 391 { "datetimeTitle", IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME }, |
| 391 { "deviceGroupDescription", IDS_OPTIONS_DEVICE_GROUP_DESCRIPTION }, | 392 { "deviceGroupDescription", IDS_OPTIONS_DEVICE_GROUP_DESCRIPTION }, |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 SetupAccessibilityFeatures(); | 861 SetupAccessibilityFeatures(); |
| 861 policy::BrowserPolicyConnectorChromeOS* connector = | 862 policy::BrowserPolicyConnectorChromeOS* connector = |
| 862 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 863 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 863 if (!connector->IsEnterpriseManaged() && | 864 if (!connector->IsEnterpriseManaged() && |
| 864 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && | 865 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && |
| 865 !chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 866 !chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
| 866 web_ui()->CallJavascriptFunction( | 867 web_ui()->CallJavascriptFunction( |
| 867 "BrowserOptions.enableFactoryResetSection"); | 868 "BrowserOptions.enableFactoryResetSection"); |
| 868 } | 869 } |
| 869 | 870 |
| 871 Profile* profile = Profile::FromWebUI(web_ui()); |
| 870 OnAccountPictureManagedChanged( | 872 OnAccountPictureManagedChanged( |
| 871 policy::ProfilePolicyConnectorFactory::GetForProfile( | 873 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
| 872 Profile::FromWebUI(web_ui()))-> | |
| 873 policy_service()->GetPolicies( | 874 policy_service()->GetPolicies( |
| 874 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 875 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
| 875 std::string())) | 876 std::string())) |
| 876 .Get(policy::key::kUserAvatarImage)); | 877 .Get(policy::key::kUserAvatarImage)); |
| 878 |
| 879 if (HotwordService::DoesLanguageSupportHotword(profile)) |
| 880 web_ui()->CallJavascriptFunction("BrowserOptions.showAppListHotword"); |
| 877 #endif | 881 #endif |
| 878 } | 882 } |
| 879 | 883 |
| 880 // static | 884 // static |
| 881 void BrowserOptionsHandler::CheckAutoLaunch( | 885 void BrowserOptionsHandler::CheckAutoLaunch( |
| 882 base::WeakPtr<BrowserOptionsHandler> weak_this, | 886 base::WeakPtr<BrowserOptionsHandler> weak_this, |
| 883 const base::FilePath& profile_path) { | 887 const base::FilePath& profile_path) { |
| 884 #if defined(OS_WIN) | 888 #if defined(OS_WIN) |
| 885 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 886 | 890 |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 1709 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
| 1706 bool has_users = !Profile::FromWebUI(web_ui())-> | 1710 bool has_users = !Profile::FromWebUI(web_ui())-> |
| 1707 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); | 1711 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); |
| 1708 base::FundamentalValue has_users_value(has_users); | 1712 base::FundamentalValue has_users_value(has_users); |
| 1709 web_ui()->CallJavascriptFunction( | 1713 web_ui()->CallJavascriptFunction( |
| 1710 "BrowserOptions.updateManagesSupervisedUsers", | 1714 "BrowserOptions.updateManagesSupervisedUsers", |
| 1711 has_users_value); | 1715 has_users_value); |
| 1712 } | 1716 } |
| 1713 | 1717 |
| 1714 } // namespace options | 1718 } // namespace options |
| OLD | NEW |