| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL); | 634 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL); |
| 635 | 635 |
| 636 values->SetString("languagesLearnMoreURL", | 636 values->SetString("languagesLearnMoreURL", |
| 637 chrome::kLanguageSettingsLearnMoreUrl); | 637 chrome::kLanguageSettingsLearnMoreUrl); |
| 638 | 638 |
| 639 values->SetBoolean( | 639 values->SetBoolean( |
| 640 "easyUnlockAllowed", | 640 "easyUnlockAllowed", |
| 641 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed()); | 641 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed()); |
| 642 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl); | 642 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl); |
| 643 values->SetBoolean( | 643 values->SetBoolean("easyUnlockProximityDetectionAllowed", |
| 644 "easyUnlockProximityDetectionAllowed", | 644 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 645 CommandLine::ForCurrentProcess()->HasSwitch( | 645 proximity_auth::switches::kEnableProximityDetection)); |
| 646 proximity_auth::switches::kEnableProximityDetection)); | |
| 647 | 646 |
| 648 #if defined(OS_CHROMEOS) | 647 #if defined(OS_CHROMEOS) |
| 649 values->SetBoolean( | 648 values->SetBoolean("consumerManagementEnabled", |
| 650 "consumerManagementEnabled", | 649 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 651 CommandLine::ForCurrentProcess()->HasSwitch( | 650 chromeos::switches::kEnableConsumerManagement)); |
| 652 chromeos::switches::kEnableConsumerManagement)); | |
| 653 | 651 |
| 654 RegisterTitle(values, "thirdPartyImeConfirmOverlay", | 652 RegisterTitle(values, "thirdPartyImeConfirmOverlay", |
| 655 IDS_OPTIONS_SETTINGS_LANGUAGES_THIRD_PARTY_WARNING_TITLE); | 653 IDS_OPTIONS_SETTINGS_LANGUAGES_THIRD_PARTY_WARNING_TITLE); |
| 656 #endif | 654 #endif |
| 657 | 655 |
| 658 values->SetBoolean("showSetDefault", ShouldShowSetDefaultBrowser()); | 656 values->SetBoolean("showSetDefault", ShouldShowSetDefaultBrowser()); |
| 659 | 657 |
| 660 values->SetBoolean("allowAdvancedSettings", ShouldAllowAdvancedSettings()); | 658 values->SetBoolean("allowAdvancedSettings", ShouldAllowAdvancedSettings()); |
| 661 | 659 |
| 662 values->SetBoolean("websiteSettingsManagerEnabled", | 660 values->SetBoolean("websiteSettingsManagerEnabled", |
| 663 CommandLine::ForCurrentProcess()->HasSwitch( | 661 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 664 switches::kEnableWebsiteSettingsManager)); | 662 switches::kEnableWebsiteSettingsManager)); |
| 665 | 663 |
| 666 values->SetBoolean("usingNewProfilesUI", switches::IsNewAvatarMenu()); | 664 values->SetBoolean("usingNewProfilesUI", switches::IsNewAvatarMenu()); |
| 667 } | 665 } |
| 668 | 666 |
| 669 #if defined(ENABLE_PRINT_PREVIEW) | 667 #if defined(ENABLE_PRINT_PREVIEW) |
| 670 void BrowserOptionsHandler::RegisterCloudPrintValues( | 668 void BrowserOptionsHandler::RegisterCloudPrintValues( |
| 671 base::DictionaryValue* values) { | 669 base::DictionaryValue* values) { |
| 672 values->SetString("cloudPrintOptionLabel", | 670 values->SetString("cloudPrintOptionLabel", |
| 673 l10n_util::GetStringFUTF16( | 671 l10n_util::GetStringFUTF16( |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 869 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 872 content::Source<ThemeService>( | 870 content::Source<ThemeService>( |
| 873 ThemeServiceFactory::GetForProfile(profile))); | 871 ThemeServiceFactory::GetForProfile(profile))); |
| 874 registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, | 872 registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, |
| 875 content::Source<Profile>(profile)); | 873 content::Source<Profile>(profile)); |
| 876 AddTemplateUrlServiceObserver(); | 874 AddTemplateUrlServiceObserver(); |
| 877 | 875 |
| 878 #if defined(OS_WIN) | 876 #if defined(OS_WIN) |
| 879 ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))->AddObserver(this); | 877 ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))->AddObserver(this); |
| 880 | 878 |
| 881 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 879 const base::CommandLine& command_line = |
| 880 *base::CommandLine::ForCurrentProcess(); |
| 882 if (!command_line.HasSwitch(switches::kUserDataDir)) { | 881 if (!command_line.HasSwitch(switches::kUserDataDir)) { |
| 883 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 882 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 884 base::Bind(&BrowserOptionsHandler::CheckAutoLaunch, | 883 base::Bind(&BrowserOptionsHandler::CheckAutoLaunch, |
| 885 weak_ptr_factory_.GetWeakPtr(), | 884 weak_ptr_factory_.GetWeakPtr(), |
| 886 profile->GetPath())); | 885 profile->GetPath())); |
| 887 } | 886 } |
| 888 #endif | 887 #endif |
| 889 | 888 |
| 890 // No preferences below this point may be modified by guest profiles. | 889 // No preferences below this point may be modified by guest profiles. |
| 891 if (Profile::FromWebUI(web_ui())->IsGuestSession()) | 890 if (Profile::FromWebUI(web_ui())->IsGuestSession()) |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2089 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2091 const policy::PolicyMap& previous, | 2090 const policy::PolicyMap& previous, |
| 2092 const policy::PolicyMap& current) { | 2091 const policy::PolicyMap& current) { |
| 2093 std::set<std::string> different_keys; | 2092 std::set<std::string> different_keys; |
| 2094 current.GetDifferingKeys(previous, &different_keys); | 2093 current.GetDifferingKeys(previous, &different_keys); |
| 2095 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2094 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2096 SetupMetricsReportingCheckbox(); | 2095 SetupMetricsReportingCheckbox(); |
| 2097 } | 2096 } |
| 2098 | 2097 |
| 2099 } // namespace options | 2098 } // namespace options |
| OLD | NEW |