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

Unified Diff: chrome/common/profile_management_switches.cc

Issue 235813002: Add profile-switches to signin-internals; move switches to component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/profile_management_switches.h ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/profile_management_switches.cc
diff --git a/chrome/common/profile_management_switches.cc b/chrome/common/profile_management_switches.cc
deleted file mode 100644
index 1c837441d32b655bd4dc31f2f5bd57f4c0e06708..0000000000000000000000000000000000000000
--- a/chrome/common/profile_management_switches.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/profile_management_switches.h"
-
-#include "base/command_line.h"
-#include "base/metrics/field_trial.h"
-#include "chrome/common/chrome_switches.h"
-
-namespace {
-
-const char kNewProfileManagementFieldTrialName[] = "NewProfileManagement";
-
-bool CheckProfileManagementFlag(std::string command_switch, bool active_state) {
- // Individiual flag settings take precedence.
- if (CommandLine::ForCurrentProcess()->HasSwitch(command_switch)) {
- return true;
- }
-
- // --new-profile-management flag always affects all switches.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNewProfileManagement)) {
- return active_state;
- }
-
- // NewProfileManagement experiment acts like above flag.
- std::string trial_type =
- base::FieldTrialList::FindFullName(kNewProfileManagementFieldTrialName);
- if (!trial_type.empty()) {
- if (trial_type == "Enabled")
- return active_state;
- if (trial_type == "Disabled")
- return !active_state;
- }
-
- return false;
-}
-
-} // namespace
-
-namespace switches {
-
-bool IsEnableWebBasedSignin() {
- return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, false);
-}
-
-bool IsGoogleProfileInfo() {
- return CheckProfileManagementFlag(switches::kGoogleProfileInfo, true);
-}
-
-bool IsNewProfileManagement() {
- return CheckProfileManagementFlag(switches::kNewProfileManagement, true);
-}
-
-bool IsNewAvatarMenu() {
- bool is_new_avatar_menu =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu);
- return is_new_avatar_menu || IsNewProfileManagement();
-}
-
-bool IsNewProfileManagementPreviewEnabled() {
- bool is_new_avatar_menu =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu);
- return is_new_avatar_menu && IsNewProfileManagement();
-}
-
-bool IsFastUserSwitching() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kFastUserSwitching);
-}
-
-} // namespace switches
« no previous file with comments | « chrome/common/profile_management_switches.h ('k') | chrome/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698