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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 #if defined(OS_WIN) | 131 #if defined(OS_WIN) |
132 #include "chrome/browser/extensions/settings_api_helpers.h" | 132 #include "chrome/browser/extensions/settings_api_helpers.h" |
133 #include "chrome/installer/util/auto_launch_util.h" | 133 #include "chrome/installer/util/auto_launch_util.h" |
134 #include "content/public/browser/browser_url_handler.h" | 134 #include "content/public/browser/browser_url_handler.h" |
135 #endif // defined(OS_WIN) | 135 #endif // defined(OS_WIN) |
136 | 136 |
137 #if defined(ENABLE_SERVICE_DISCOVERY) | 137 #if defined(ENABLE_SERVICE_DISCOVERY) |
138 #include "chrome/browser/local_discovery/privet_notifications.h" | 138 #include "chrome/browser/local_discovery/privet_notifications.h" |
139 #endif | 139 #endif |
140 | 140 |
| 141 #if defined(USE_ASH) |
| 142 #include "ash/shell.h" |
| 143 #endif |
| 144 |
141 using base::UserMetricsAction; | 145 using base::UserMetricsAction; |
142 using content::BrowserContext; | 146 using content::BrowserContext; |
143 using content::BrowserThread; | 147 using content::BrowserThread; |
144 using content::DownloadManager; | 148 using content::DownloadManager; |
145 using content::OpenURLParams; | 149 using content::OpenURLParams; |
146 using content::Referrer; | 150 using content::Referrer; |
147 using extensions::Extension; | 151 using extensions::Extension; |
148 using extensions::ExtensionRegistry; | 152 using extensions::ExtensionRegistry; |
149 | 153 |
150 namespace { | 154 namespace { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 #if defined(OS_MACOSX) | 605 #if defined(OS_MACOSX) |
602 values->SetString("macPasswordsWarning", | 606 values->SetString("macPasswordsWarning", |
603 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); | 607 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); |
604 values->SetBoolean("multiple_profiles", | 608 values->SetBoolean("multiple_profiles", |
605 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); | 609 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); |
606 #endif | 610 #endif |
607 | 611 |
608 if (ShouldShowMultiProfilesUserList()) | 612 if (ShouldShowMultiProfilesUserList()) |
609 values->Set("profilesInfo", GetProfilesInfoList().release()); | 613 values->Set("profilesInfo", GetProfilesInfoList().release()); |
610 | 614 |
| 615 // Profile deletion is not allowed for supervised users, or any users |
| 616 // using Metro mode. |
| 617 bool allow_deletion = !Profile::FromWebUI(web_ui())->IsSupervised(); |
| 618 #if defined(USE_ASH) |
| 619 allow_deletion = allow_deletion && !ash::Shell::HasInstance(); |
| 620 #endif |
| 621 values->SetBoolean("allowProfileDeletion", allow_deletion); |
| 622 |
611 values->SetBoolean("profileIsGuest", | 623 values->SetBoolean("profileIsGuest", |
612 Profile::FromWebUI(web_ui())->IsOffTheRecord()); | 624 Profile::FromWebUI(web_ui())->IsOffTheRecord()); |
613 | 625 |
614 values->SetBoolean("profileIsSupervised", | 626 values->SetBoolean("profileIsSupervised", |
615 Profile::FromWebUI(web_ui())->IsSupervised()); | 627 Profile::FromWebUI(web_ui())->IsSupervised()); |
616 | 628 |
617 #if !defined(OS_CHROMEOS) | 629 #if !defined(OS_CHROMEOS) |
618 values->SetBoolean( | 630 values->SetBoolean( |
619 "gpuEnabledAtStart", | 631 "gpuEnabledAtStart", |
620 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); | 632 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, | 2109 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2098 const policy::PolicyMap& previous, | 2110 const policy::PolicyMap& previous, |
2099 const policy::PolicyMap& current) { | 2111 const policy::PolicyMap& current) { |
2100 std::set<std::string> different_keys; | 2112 std::set<std::string> different_keys; |
2101 current.GetDifferingKeys(previous, &different_keys); | 2113 current.GetDifferingKeys(previous, &different_keys); |
2102 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2114 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2103 SetupMetricsReportingCheckbox(); | 2115 SetupMetricsReportingCheckbox(); |
2104 } | 2116 } |
2105 | 2117 |
2106 } // namespace options | 2118 } // namespace options |
OLD | NEW |