Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 863063002: Don't allow profile deletion in Metro mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ifdefs Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 #include "chrome/browser/ui/browser_window.h" 122 #include "chrome/browser/ui/browser_window.h"
123 #include "chromeos/dbus/dbus_thread_manager.h" 123 #include "chromeos/dbus/dbus_thread_manager.h"
124 #include "chromeos/dbus/power_manager_client.h" 124 #include "chromeos/dbus/power_manager_client.h"
125 #include "components/user_manager/user.h" 125 #include "components/user_manager/user.h"
126 #include "components/user_manager/user_manager.h" 126 #include "components/user_manager/user_manager.h"
127 #include "ui/chromeos/accessibility_types.h" 127 #include "ui/chromeos/accessibility_types.h"
128 #include "ui/gfx/image/image_skia.h" 128 #include "ui/gfx/image/image_skia.h"
129 #endif // defined(OS_CHROMEOS) 129 #endif // defined(OS_CHROMEOS)
130 130
131 #if defined(OS_WIN) 131 #if defined(OS_WIN)
132 #include "base/win/metro.h"
132 #include "chrome/browser/extensions/settings_api_helpers.h" 133 #include "chrome/browser/extensions/settings_api_helpers.h"
133 #include "chrome/installer/util/auto_launch_util.h" 134 #include "chrome/installer/util/auto_launch_util.h"
134 #include "content/public/browser/browser_url_handler.h" 135 #include "content/public/browser/browser_url_handler.h"
135 #endif // defined(OS_WIN) 136 #endif // defined(OS_WIN)
136 137
137 #if defined(ENABLE_SERVICE_DISCOVERY) 138 #if defined(ENABLE_SERVICE_DISCOVERY)
138 #include "chrome/browser/local_discovery/privet_notifications.h" 139 #include "chrome/browser/local_discovery/privet_notifications.h"
139 #endif 140 #endif
140 141
141 using base::UserMetricsAction; 142 using base::UserMetricsAction;
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool allow_deletion = true;
614 #if defined(OS_WIN)
615 allow_deletion = !base::win::IsMetroProcess();
Evan Stade 2015/01/27 00:06:58 you don't care about isSupervised any more?
noms (inactive) 2015/01/27 00:36:10 This is more like an extra check on top of isSuper
Evan Stade 2015/01/27 01:59:36 I would rather the logic all be in one place. b
noms (inactive) 2015/01/28 02:20:13 Done.
616 #endif
617 values->SetBoolean("allowProfileDeletion", allow_deletion);
618
611 values->SetBoolean("profileIsGuest", 619 values->SetBoolean("profileIsGuest",
612 Profile::FromWebUI(web_ui())->IsOffTheRecord()); 620 Profile::FromWebUI(web_ui())->IsOffTheRecord());
613 621
614 values->SetBoolean("profileIsSupervised", 622 values->SetBoolean("profileIsSupervised",
615 Profile::FromWebUI(web_ui())->IsSupervised()); 623 Profile::FromWebUI(web_ui())->IsSupervised());
616 624
617 #if !defined(OS_CHROMEOS) 625 #if !defined(OS_CHROMEOS)
618 values->SetBoolean( 626 values->SetBoolean(
619 "gpuEnabledAtStart", 627 "gpuEnabledAtStart",
620 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); 628 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref());
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, 2105 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns,
2098 const policy::PolicyMap& previous, 2106 const policy::PolicyMap& previous,
2099 const policy::PolicyMap& current) { 2107 const policy::PolicyMap& current) {
2100 std::set<std::string> different_keys; 2108 std::set<std::string> different_keys;
2101 current.GetDifferingKeys(previous, &different_keys); 2109 current.GetDifferingKeys(previous, &different_keys);
2102 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) 2110 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled))
2103 SetupMetricsReportingCheckbox(); 2111 SetupMetricsReportingCheckbox();
2104 } 2112 }
2105 2113
2106 } // namespace options 2114 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/webui/signin/user_manager_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698