Chromium Code Reviews| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/environment.h" | 14 #include "base/environment.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/prefs/scoped_user_pref_update.h" | 19 #include "base/prefs/scoped_user_pref_update.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/value_conversions.h" | 23 #include "base/value_conversions.h" |
| 24 #include "base/values.h" | 24 #include "base/values.h" |
| 25 #include "base/win/metro.h" | |
| 25 #include "chrome/browser/auto_launch_trial.h" | 26 #include "chrome/browser/auto_launch_trial.h" |
| 26 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/chrome_notification_types.h" | 28 #include "chrome/browser/chrome_notification_types.h" |
| 28 #include "chrome/browser/custom_home_pages_table_model.h" | 29 #include "chrome/browser/custom_home_pages_table_model.h" |
| 29 #include "chrome/browser/download/download_prefs.h" | 30 #include "chrome/browser/download/download_prefs.h" |
| 30 #include "chrome/browser/gpu/gpu_mode_manager.h" | 31 #include "chrome/browser/gpu/gpu_mode_manager.h" |
| 31 #include "chrome/browser/lifetime/application_lifetime.h" | 32 #include "chrome/browser/lifetime/application_lifetime.h" |
| 32 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 33 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 33 #include "chrome/browser/metrics/metrics_reporting_state.h" | 34 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 34 #include "chrome/browser/net/prediction_options.h" | 35 #include "chrome/browser/net/prediction_options.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 601 #if defined(OS_MACOSX) | 602 #if defined(OS_MACOSX) |
| 602 values->SetString("macPasswordsWarning", | 603 values->SetString("macPasswordsWarning", |
| 603 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); | 604 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); |
| 604 values->SetBoolean("multiple_profiles", | 605 values->SetBoolean("multiple_profiles", |
| 605 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); | 606 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); |
| 606 #endif | 607 #endif |
| 607 | 608 |
| 608 if (ShouldShowMultiProfilesUserList()) | 609 if (ShouldShowMultiProfilesUserList()) |
| 609 values->Set("profilesInfo", GetProfilesInfoList().release()); | 610 values->Set("profilesInfo", GetProfilesInfoList().release()); |
| 610 | 611 |
| 612 // Profile deletion is not allowed in Metro mode. | |
| 613 values->SetBoolean("allowProfileDeletion", !base::win::IsMetroProcess()); | |
|
Evan Stade
2015/01/26 17:55:26
don't you need some ifdefs
noms (inactive)
2015/01/26 23:08:14
Gah, sorry about that. Dropped that ball. Done.
tapted
2015/01/26 23:36:07
I'm pretty sure base::win::IsMetroProcess() only r
noms (inactive)
2015/01/28 02:20:13
Sigh. It had such a promising name. I changed it t
| |
| 614 | |
| 611 values->SetBoolean("profileIsGuest", | 615 values->SetBoolean("profileIsGuest", |
| 612 Profile::FromWebUI(web_ui())->IsOffTheRecord()); | 616 Profile::FromWebUI(web_ui())->IsOffTheRecord()); |
| 613 | 617 |
| 614 values->SetBoolean("profileIsSupervised", | 618 values->SetBoolean("profileIsSupervised", |
| 615 Profile::FromWebUI(web_ui())->IsSupervised()); | 619 Profile::FromWebUI(web_ui())->IsSupervised()); |
| 616 | 620 |
| 617 #if !defined(OS_CHROMEOS) | 621 #if !defined(OS_CHROMEOS) |
| 618 values->SetBoolean( | 622 values->SetBoolean( |
| 619 "gpuEnabledAtStart", | 623 "gpuEnabledAtStart", |
| 620 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); | 624 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2097 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2101 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2098 const policy::PolicyMap& previous, | 2102 const policy::PolicyMap& previous, |
| 2099 const policy::PolicyMap& current) { | 2103 const policy::PolicyMap& current) { |
| 2100 std::set<std::string> different_keys; | 2104 std::set<std::string> different_keys; |
| 2101 current.GetDifferingKeys(previous, &different_keys); | 2105 current.GetDifferingKeys(previous, &different_keys); |
| 2102 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2106 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2103 SetupMetricsReportingCheckbox(); | 2107 SetupMetricsReportingCheckbox(); |
| 2104 } | 2108 } |
| 2105 | 2109 |
| 2106 } // namespace options | 2110 } // namespace options |
| OLD | NEW |