| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_FULL)); | 540 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_FULL)); |
| 540 magnifier_list->Append(option_full.release()); | 541 magnifier_list->Append(option_full.release()); |
| 541 | 542 |
| 542 scoped_ptr<base::ListValue> option_partial(new base::ListValue); | 543 scoped_ptr<base::ListValue> option_partial(new base::ListValue); |
| 543 option_partial->AppendInteger(ash::MAGNIFIER_PARTIAL); | 544 option_partial->AppendInteger(ash::MAGNIFIER_PARTIAL); |
| 544 option_partial->Append(new base::StringValue(l10n_util::GetStringUTF16( | 545 option_partial->Append(new base::StringValue(l10n_util::GetStringUTF16( |
| 545 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_PARTIAL))); | 546 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_PARTIAL))); |
| 546 magnifier_list->Append(option_partial.release()); | 547 magnifier_list->Append(option_partial.release()); |
| 547 | 548 |
| 548 values->Set("magnifierList", magnifier_list.release()); | 549 values->Set("magnifierList", magnifier_list.release()); |
| 550 |
| 551 scoped_ptr<base::FundamentalValue> app_list_hotword_shown( |
| 552 new base::FundamentalValue( |
| 553 HotwordService::DoesHotwordSupportLanguage(profile))); |
| 554 values->Set("appListHotwordShown", app_list_hotword_shown.release()); |
| 549 #endif | 555 #endif |
| 550 | 556 |
| 551 #if defined(OS_MACOSX) | 557 #if defined(OS_MACOSX) |
| 552 values->SetString("macPasswordsWarning", | 558 values->SetString("macPasswordsWarning", |
| 553 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); | 559 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); |
| 554 values->SetBoolean("multiple_profiles", | 560 values->SetBoolean("multiple_profiles", |
| 555 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); | 561 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); |
| 556 #endif | 562 #endif |
| 557 | 563 |
| 558 if (ShouldShowMultiProfilesUserList(helper::GetDesktopType(web_ui()))) | 564 if (ShouldShowMultiProfilesUserList(helper::GetDesktopType(web_ui()))) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 SetupAccessibilityFeatures(); | 866 SetupAccessibilityFeatures(); |
| 861 policy::BrowserPolicyConnectorChromeOS* connector = | 867 policy::BrowserPolicyConnectorChromeOS* connector = |
| 862 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 868 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 863 if (!connector->IsEnterpriseManaged() && | 869 if (!connector->IsEnterpriseManaged() && |
| 864 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && | 870 !chromeos::UserManager::Get()->IsLoggedInAsGuest() && |
| 865 !chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 871 !chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
| 866 web_ui()->CallJavascriptFunction( | 872 web_ui()->CallJavascriptFunction( |
| 867 "BrowserOptions.enableFactoryResetSection"); | 873 "BrowserOptions.enableFactoryResetSection"); |
| 868 } | 874 } |
| 869 | 875 |
| 876 Profile* profile = Profile::FromWebUI(web_ui()); |
| 870 OnAccountPictureManagedChanged( | 877 OnAccountPictureManagedChanged( |
| 871 policy::ProfilePolicyConnectorFactory::GetForProfile( | 878 policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
| 872 Profile::FromWebUI(web_ui()))-> | |
| 873 policy_service()->GetPolicies( | 879 policy_service()->GetPolicies( |
| 874 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 880 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
| 875 std::string())) | 881 std::string())) |
| 876 .Get(policy::key::kUserAvatarImage)); | 882 .Get(policy::key::kUserAvatarImage)); |
| 877 #endif | 883 #endif |
| 878 } | 884 } |
| 879 | 885 |
| 880 // static | 886 // static |
| 881 void BrowserOptionsHandler::CheckAutoLaunch( | 887 void BrowserOptionsHandler::CheckAutoLaunch( |
| 882 base::WeakPtr<BrowserOptionsHandler> weak_this, | 888 base::WeakPtr<BrowserOptionsHandler> weak_this, |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 1711 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
| 1706 bool has_users = !Profile::FromWebUI(web_ui())-> | 1712 bool has_users = !Profile::FromWebUI(web_ui())-> |
| 1707 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); | 1713 GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); |
| 1708 base::FundamentalValue has_users_value(has_users); | 1714 base::FundamentalValue has_users_value(has_users); |
| 1709 web_ui()->CallJavascriptFunction( | 1715 web_ui()->CallJavascriptFunction( |
| 1710 "BrowserOptions.updateManagesSupervisedUsers", | 1716 "BrowserOptions.updateManagesSupervisedUsers", |
| 1711 has_users_value); | 1717 has_users_value); |
| 1712 } | 1718 } |
| 1713 | 1719 |
| 1714 } // namespace options | 1720 } // namespace options |
| OLD | NEW |