| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "components/signin/core/common/signin_switches.h" | 10 #include "components/signin/core/common/signin_switches.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Consistent identity args take precedent over new profile management args. | 74 // Consistent identity args take precedent over new profile management args. |
| 75 if (not_new_avatar_menu) { | 75 if (not_new_avatar_menu) { |
| 76 return STATE_OLD_AVATAR_MENU; | 76 return STATE_OLD_AVATAR_MENU; |
| 77 } else if (is_consistent_identity) { | 77 } else if (is_consistent_identity) { |
| 78 return STATE_ACCOUNT_CONSISTENCY; | 78 return STATE_ACCOUNT_CONSISTENCY; |
| 79 } else if (is_new_profile_management) { | 79 } else if (is_new_profile_management) { |
| 80 return STATE_NEW_PROFILE_MANAGEMENT; | 80 return STATE_NEW_PROFILE_MANAGEMENT; |
| 81 } else if (is_new_avatar_menu) { | 81 } else if (is_new_avatar_menu) { |
| 82 return STATE_NEW_AVATAR_MENU; | 82 return STATE_NEW_AVATAR_MENU; |
| 83 } else if (not_new_profile_management) { | 83 } else if (not_new_profile_management) { |
| 84 return STATE_NEW_AVATAR_MENU; | 84 return STATE_OLD_AVATAR_MENU; |
| 85 } else if (not_consistent_identity) { | 85 } else if (not_consistent_identity) { |
| 86 return STATE_NEW_AVATAR_MENU; | 86 return STATE_OLD_AVATAR_MENU; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Set the default state | 89 // Set the default state |
| 90 #if defined(OS_ANDROID) | 90 #if defined(OS_ANDROID) |
| 91 State state = STATE_ACCOUNT_CONSISTENCY; | 91 State state = STATE_ACCOUNT_CONSISTENCY; |
| 92 #else | 92 #else |
| 93 State state = STATE_OLD_AVATAR_MENU; | 93 State state = STATE_OLD_AVATAR_MENU; |
| 94 #endif | 94 #endif |
| 95 | 95 |
| 96 if (!trial_type.empty()) { | 96 if (!trial_type.empty()) { |
| 97 if (trial_type == "Enabled") { | 97 if (trial_type == "Enabled") { |
| 98 state = STATE_NEW_PROFILE_MANAGEMENT; | 98 state = STATE_NEW_PROFILE_MANAGEMENT; |
| 99 } else if (trial_type == "AccountConsistency") { | 99 } else if (trial_type == "AccountConsistency") { |
| 100 state = STATE_ACCOUNT_CONSISTENCY; | 100 state = STATE_ACCOUNT_CONSISTENCY; |
| 101 } else if (trial_type == "NewAvatarMenu") { |
| 102 state = STATE_NEW_AVATAR_MENU; |
| 101 } else { | 103 } else { |
| 102 state = STATE_OLD_AVATAR_MENU; | 104 state = STATE_OLD_AVATAR_MENU; |
| 103 } | 105 } |
| 104 } | 106 } |
| 105 | 107 |
| 106 return state; | 108 return state; |
| 107 } | 109 } |
| 108 | 110 |
| 109 bool CheckFlag(std::string command_switch, State min_state) { | 111 bool CheckFlag(std::string command_switch, State min_state) { |
| 110 // Individiual flag settings take precedence. | 112 // Individiual flag settings take precedence. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 command_line->AppendSwitch(switches::kEnableNewProfileManagement); | 166 command_line->AppendSwitch(switches::kEnableNewProfileManagement); |
| 165 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); | 167 DCHECK(!command_line->HasSwitch(switches::kDisableNewProfileManagement)); |
| 166 } | 168 } |
| 167 | 169 |
| 168 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { | 170 void EnableAccountConsistencyForTesting(base::CommandLine* command_line) { |
| 169 command_line->AppendSwitch(switches::kEnableAccountConsistency); | 171 command_line->AppendSwitch(switches::kEnableAccountConsistency); |
| 170 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); | 172 DCHECK(!command_line->HasSwitch(switches::kDisableAccountConsistency)); |
| 171 } | 173 } |
| 172 | 174 |
| 173 } // namespace switches | 175 } // namespace switches |
| OLD | NEW |