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