| OLD | NEW |
| (Empty) | |
| 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_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/strings/string16.h" |
| 11 |
| 12 class TranslateBubbleModel { |
| 13 public: |
| 14 enum ViewType { |
| 15 BEFORE_TRANSLATE, |
| 16 TRANSLATING, |
| 17 AFTER_TRANSLATE, |
| 18 ERROR, |
| 19 ADVANCED, |
| 20 }; |
| 21 |
| 22 virtual ~TranslateBubbleModel() {} |
| 23 |
| 24 // Returns the number of languages supported. |
| 25 virtual int GetNumberOfLanguages() const = 0; |
| 26 |
| 27 // Returns the displayable name for the language at |index|. |
| 28 virtual string16 GetLanguageNameAt(int index) const = 0; |
| 29 |
| 30 // Returns the original language index. |
| 31 virtual int GetOriginalLanguageIndex() const = 0; |
| 32 |
| 33 // Sets the original language index. |
| 34 virtual void SetOriginalLanguageIndex(int index) = 0; |
| 35 |
| 36 // Returns the target language index. |
| 37 virtual int GetTargetLanguageIndex() const = 0; |
| 38 |
| 39 // Sets the target language index. |
| 40 virtual void SetTargetLanguageIndex(int index) = 0; |
| 41 |
| 42 // Sets the value if the current language is blocked. |
| 43 virtual void SetLanguageBlocked(bool value) = 0; |
| 44 |
| 45 // Sets the value if the current webpage is blacklisted. |
| 46 virtual void SetSiteBlacklist(bool value) = 0; |
| 47 |
| 48 // Returns true if the webpage in the current original language should be |
| 49 // translated into the current target language automatically. |
| 50 virtual bool ShouldAlwaysTranslate() const = 0; |
| 51 |
| 52 // Sets the value if the webpage in the current original language should be |
| 53 // translated into the current target language automatically. |
| 54 virtual void SetAlwaysTranslate(bool value) = 0; |
| 55 |
| 56 // Starts translating the current page. |
| 57 virtual void Translate() = 0; |
| 58 |
| 59 // Reverts translation. |
| 60 virtual void RevertTranslation() = 0; |
| 61 |
| 62 // Processes when the user declines translation. |
| 63 virtual void TranslationDeclined() = 0; |
| 64 }; |
| 65 |
| 66 #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| OLD | NEW |