This source file includes following definitions.
- view_state_before_advanced_view_
- SetViewState
- GoBackFromAdvanced
#include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h"
#include "base/logging.h"
TranslateBubbleViewStateTransition::TranslateBubbleViewStateTransition(
TranslateBubbleModel::ViewState view_state)
: view_state_(view_state),
view_state_before_advanced_view_(view_state) {
DCHECK_NE(TranslateBubbleModel::VIEW_STATE_ADVANCED, view_state_);
}
void TranslateBubbleViewStateTransition::SetViewState(
TranslateBubbleModel::ViewState view_state) {
view_state_ = view_state;
if (view_state != TranslateBubbleModel::VIEW_STATE_ADVANCED)
view_state_before_advanced_view_ = view_state;
}
void TranslateBubbleViewStateTransition::GoBackFromAdvanced() {
DCHECK(view_state_ == TranslateBubbleModel::VIEW_STATE_ADVANCED);
SetViewState(view_state_before_advanced_view_);
}