| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "chrome/common/translate/translate_errors.h" |
| 11 | 12 |
| 12 // The model for the Translate bubble UX. This manages the user's manipulation | 13 // The model for the Translate bubble UX. This manages the user's manipulation |
| 13 // of the bubble and offers the data to show on the bubble. | 14 // of the bubble and offers the data to show on the bubble. |
| 14 class TranslateBubbleModel { | 15 class TranslateBubbleModel { |
| 15 public: | 16 public: |
| 16 enum ViewState { | 17 enum ViewState { |
| 17 // The view state before translating. | 18 // The view state before translating. |
| 18 VIEW_STATE_BEFORE_TRANSLATE, | 19 VIEW_STATE_BEFORE_TRANSLATE, |
| 19 | 20 |
| 20 // The view state during translating. | 21 // The view state during translating. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 virtual ~TranslateBubbleModel() {} | 35 virtual ~TranslateBubbleModel() {} |
| 35 | 36 |
| 36 // Returns the current view state. | 37 // Returns the current view state. |
| 37 virtual ViewState GetViewState() const = 0; | 38 virtual ViewState GetViewState() const = 0; |
| 38 | 39 |
| 39 // Transitions the view state. | 40 // Transitions the view state. |
| 40 virtual void SetViewState(ViewState view_state) = 0; | 41 virtual void SetViewState(ViewState view_state) = 0; |
| 41 | 42 |
| 43 // Returns the error type. |
| 44 virtual TranslateErrors::Type GetErrorType() const = 0; |
| 45 |
| 46 // Sets the error type. |
| 47 virtual void SetErrorType(TranslateErrors::Type error_type) = 0; |
| 48 |
| 42 // Goes back from the 'Advanced' view state. | 49 // Goes back from the 'Advanced' view state. |
| 43 virtual void GoBackFromAdvanced() = 0; | 50 virtual void GoBackFromAdvanced() = 0; |
| 44 | 51 |
| 45 // Returns the number of languages supported. | 52 // Returns the number of languages supported. |
| 46 virtual int GetNumberOfLanguages() const = 0; | 53 virtual int GetNumberOfLanguages() const = 0; |
| 47 | 54 |
| 48 // Returns the displayable name for the language at |index|. | 55 // Returns the displayable name for the language at |index|. |
| 49 virtual string16 GetLanguageNameAt(int index) const = 0; | 56 virtual string16 GetLanguageNameAt(int index) const = 0; |
| 50 | 57 |
| 51 // Returns the original language index. | 58 // Returns the original language index. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 virtual void Translate() = 0; | 87 virtual void Translate() = 0; |
| 81 | 88 |
| 82 // Reverts translation. | 89 // Reverts translation. |
| 83 virtual void RevertTranslation() = 0; | 90 virtual void RevertTranslation() = 0; |
| 84 | 91 |
| 85 // Processes when the user declines translation. | 92 // Processes when the user declines translation. |
| 86 virtual void TranslationDeclined() = 0; | 93 virtual void TranslationDeclined() = 0; |
| 87 }; | 94 }; |
| 88 | 95 |
| 89 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ | 96 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| OLD | NEW |