- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / translate / translate_bubble_view_state_transition.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_VIEW_STATE_TRANSITION_H_
6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_VIEW_STATE_TRANSITION_H_
7
8 #include "base/basictypes.h"
9 #include "chrome/browser/ui/translate/translate_bubble_model.h"
10
11 // The class which manages the transition of the view state of the Translate
12 // bubble.
13 class TranslateBubbleViewStateTransition {
14  public:
15   explicit TranslateBubbleViewStateTransition(
16       TranslateBubbleModel::ViewState view_state);
17
18   TranslateBubbleModel::ViewState view_state() const { return view_state_; }
19
20   // Transitions the view state.
21   void SetViewState(TranslateBubbleModel::ViewState view_state);
22
23   // Goes back from the 'Advanced' view state.
24   void GoBackFromAdvanced();
25
26  private:
27   // The current view type.
28   TranslateBubbleModel::ViewState view_state_;
29
30   // The view type. When the current view type is not 'Advanced' view, this is
31   // equivalent to |view_state_|. Otherwise, this is the previous view type
32   // before the user opens the 'Advanced' view. This is used to navigate when
33   // pressing 'Cancel' button on the 'Advanced' view.
34   TranslateBubbleModel::ViewState view_state_before_advanced_view_;
35
36   DISALLOW_COPY_AND_ASSIGN(TranslateBubbleViewStateTransition);
37 };
38
39 #endif  // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_VIEW_STATE_TRANSITION_H_