| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/profile_management_switches.h" | 5 #include "components/signin/core/common/profile_management_switches.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "components/signin/core/common/signin_switches.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const char kNewProfileManagementFieldTrialName[] = "NewProfileManagement"; | 13 const char kNewProfileManagementFieldTrialName[] = "NewProfileManagement"; |
| 14 | 14 |
| 15 bool CheckProfileManagementFlag(std::string command_switch, bool active_state) { | 15 bool CheckProfileManagementFlag(std::string command_switch, bool active_state) { |
| 16 // Individiual flag settings take precedence. | 16 // Individiual flag settings take precedence. |
| 17 if (CommandLine::ForCurrentProcess()->HasSwitch(command_switch)) { | 17 if (CommandLine::ForCurrentProcess()->HasSwitch(command_switch)) { |
| 18 return true; | 18 return true; |
| 19 } | 19 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 namespace switches { | 42 namespace switches { |
| 43 | 43 |
| 44 bool IsEnableWebBasedSignin() { | 44 bool IsEnableWebBasedSignin() { |
| 45 return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, false); | 45 return CheckProfileManagementFlag(switches::kEnableWebBasedSignin, false); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool IsFastUserSwitching() { |
| 49 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 50 switches::kFastUserSwitching); |
| 51 } |
| 52 |
| 48 bool IsGoogleProfileInfo() { | 53 bool IsGoogleProfileInfo() { |
| 49 return CheckProfileManagementFlag(switches::kGoogleProfileInfo, true); | 54 return CheckProfileManagementFlag(switches::kGoogleProfileInfo, true); |
| 50 } | 55 } |
| 51 | 56 |
| 52 bool IsNewProfileManagement() { | |
| 53 return CheckProfileManagementFlag(switches::kNewProfileManagement, true); | |
| 54 } | |
| 55 | |
| 56 bool IsNewAvatarMenu() { | 57 bool IsNewAvatarMenu() { |
| 57 bool is_new_avatar_menu = | 58 bool is_new_avatar_menu = |
| 58 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu); | 59 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu); |
| 59 return is_new_avatar_menu || IsNewProfileManagement(); | 60 return is_new_avatar_menu || IsNewProfileManagement(); |
| 60 } | 61 } |
| 61 | 62 |
| 63 bool IsNewProfileManagement() { |
| 64 return CheckProfileManagementFlag(switches::kNewProfileManagement, true); |
| 65 } |
| 66 |
| 62 bool IsNewProfileManagementPreviewEnabled() { | 67 bool IsNewProfileManagementPreviewEnabled() { |
| 63 bool is_new_avatar_menu = | 68 bool is_new_avatar_menu = |
| 64 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu); | 69 CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewAvatarMenu); |
| 65 return is_new_avatar_menu && IsNewProfileManagement(); | 70 return is_new_avatar_menu && IsNewProfileManagement(); |
| 66 } | 71 } |
| 67 | 72 |
| 68 bool IsFastUserSwitching() { | |
| 69 return CommandLine::ForCurrentProcess()->HasSwitch( | |
| 70 switches::kFastUserSwitching); | |
| 71 } | |
| 72 | |
| 73 } // namespace switches | 73 } // namespace switches |
| OLD | NEW |