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 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ |
6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ | 6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/translate/translate_bubble_model.h" | 10 #include "chrome/browser/ui/translate/translate_bubble_model.h" |
11 #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h" | 11 #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h" |
12 | 12 |
13 class TranslateUIDelegate; | 13 class TranslateUIDelegate; |
14 | 14 |
15 // The standard implementation of TranslateBubbleModel. | 15 // The standard implementation of TranslateBubbleModel. |
16 class TranslateBubbleModelImpl : public TranslateBubbleModel { | 16 class TranslateBubbleModelImpl : public TranslateBubbleModel { |
17 public: | 17 public: |
18 TranslateBubbleModelImpl(TranslateBubbleModel::ViewState view_type, | 18 TranslateBubbleModelImpl(TranslateBubbleModel::ViewState view_type, |
19 scoped_ptr<TranslateUIDelegate> ui_delegate); | 19 scoped_ptr<TranslateUIDelegate> ui_delegate); |
20 virtual ~TranslateBubbleModelImpl(); | 20 virtual ~TranslateBubbleModelImpl(); |
21 | 21 |
22 // TranslateBubbleModel methods. | 22 // TranslateBubbleModel methods. |
23 virtual TranslateBubbleModel::ViewState GetViewState() const OVERRIDE; | 23 virtual TranslateBubbleModel::ViewState GetViewState() const OVERRIDE; |
24 virtual void SetViewState(TranslateBubbleModel::ViewState view_state) | 24 virtual void SetViewState(TranslateBubbleModel::ViewState view_state) |
25 OVERRIDE; | 25 OVERRIDE; |
| 26 virtual TranslateErrors::Type GetErrorType() const OVERRIDE; |
| 27 virtual void SetErrorType(TranslateErrors::Type error_type) OVERRIDE; |
26 virtual void GoBackFromAdvanced() OVERRIDE; | 28 virtual void GoBackFromAdvanced() OVERRIDE; |
27 virtual int GetNumberOfLanguages() const OVERRIDE; | 29 virtual int GetNumberOfLanguages() const OVERRIDE; |
28 virtual string16 GetLanguageNameAt(int index) const OVERRIDE; | 30 virtual string16 GetLanguageNameAt(int index) const OVERRIDE; |
29 virtual int GetOriginalLanguageIndex() const OVERRIDE; | 31 virtual int GetOriginalLanguageIndex() const OVERRIDE; |
30 virtual void UpdateOriginalLanguageIndex(int index) OVERRIDE; | 32 virtual void UpdateOriginalLanguageIndex(int index) OVERRIDE; |
31 virtual int GetTargetLanguageIndex() const OVERRIDE; | 33 virtual int GetTargetLanguageIndex() const OVERRIDE; |
32 virtual void UpdateTargetLanguageIndex(int index) OVERRIDE; | 34 virtual void UpdateTargetLanguageIndex(int index) OVERRIDE; |
33 virtual void SetNeverTranslateLanguage(bool value) OVERRIDE; | 35 virtual void SetNeverTranslateLanguage(bool value) OVERRIDE; |
34 virtual void SetNeverTranslateSite(bool value) OVERRIDE; | 36 virtual void SetNeverTranslateSite(bool value) OVERRIDE; |
35 virtual bool ShouldAlwaysTranslate() const OVERRIDE; | 37 virtual bool ShouldAlwaysTranslate() const OVERRIDE; |
36 virtual void SetAlwaysTranslate(bool value) OVERRIDE; | 38 virtual void SetAlwaysTranslate(bool value) OVERRIDE; |
37 virtual void Translate() OVERRIDE; | 39 virtual void Translate() OVERRIDE; |
38 virtual void RevertTranslation() OVERRIDE; | 40 virtual void RevertTranslation() OVERRIDE; |
39 virtual void TranslationDeclined() OVERRIDE; | 41 virtual void TranslationDeclined() OVERRIDE; |
40 | 42 |
41 private: | 43 private: |
42 scoped_ptr<TranslateUIDelegate> ui_delegate_; | 44 scoped_ptr<TranslateUIDelegate> ui_delegate_; |
43 TranslateBubbleViewStateTransition view_state_transition_; | 45 TranslateBubbleViewStateTransition view_state_transition_; |
44 | 46 |
45 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleModelImpl); | 47 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleModelImpl); |
46 }; | 48 }; |
47 | 49 |
48 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ | 50 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_IMPL_H_ |
OLD | NEW |