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 3 // found in the LICENSE file. 4 5 #include "base/logging.h" 6 #include "components/password_manager/core/common/password_manager_ui.h" 7 8 namespace password_manager { 9 10 namespace ui { 11 IsPendingState(State state)12bool IsPendingState(State state) { 13 return state == PENDING_PASSWORD_AND_BUBBLE_STATE || 14 state == PENDING_PASSWORD_STATE; 15 } 16 IsAutomaticDisplayState(State state)17bool IsAutomaticDisplayState(State state) { 18 return state == PENDING_PASSWORD_AND_BUBBLE_STATE || 19 state == CONFIRMATION_STATE; 20 } 21 GetEndStateForAutomaticState(State state)22State GetEndStateForAutomaticState(State state) { 23 DCHECK(IsAutomaticDisplayState(state)); 24 switch (state) { 25 case PENDING_PASSWORD_AND_BUBBLE_STATE: 26 return PENDING_PASSWORD_STATE; 27 break; 28 case CONFIRMATION_STATE: 29 return MANAGE_STATE; 30 break; 31 default: 32 NOTREACHED(); 33 return INACTIVE_STATE; 34 } 35 } 36 37 } // namespace ui 38 39 } // namespace password_manager 40