Chromium Code Reviews| Index: chrome/browser/ui/translate/translate_bubble_model.h |
| diff --git a/chrome/browser/ui/translate/translate_bubble_model.h b/chrome/browser/ui/translate/translate_bubble_model.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..845a7c945e69654a3f53f23c03ff0cacee32ae21 |
| --- /dev/null |
| +++ b/chrome/browser/ui/translate/translate_bubble_model.h |
| @@ -0,0 +1,79 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| +#define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/strings/string16.h" |
| + |
| +// The model for the Translate bubble UX. This manages the user's manipulation |
| +// of the bubble and offers the data to show on the bubble. |
| +class TranslateBubbleModel { |
| + public: |
| + enum ViewState { |
| + BEFORE_TRANSLATE, |
| + TRANSLATING, |
| + AFTER_TRANSLATE, |
| + ERROR, |
| + ADVANCED, |
|
sky
2013/10/16 14:32:36
Document ADVANCED. It's not clear how the user get
hajimehoshi
2013/10/17 05:45:42
Done.
|
| + }; |
| + |
| + virtual ~TranslateBubbleModel() {} |
| + |
| + // Returns the current view state. |
| + virtual ViewState GetViewState() const = 0; |
| + |
| + // Transitions the view state. |
| + virtual void SetViewState(ViewState view_state) = 0; |
| + |
| + // Goes back from the 'Advanced' view state. |
| + virtual void GoBackFromAdvanced() = 0; |
| + |
| + // Returns the number of languages supported. |
| + virtual int GetNumberOfLanguages() const = 0; |
| + |
| + // Returns the displayable name for the language at |index|. |
| + virtual string16 GetLanguageNameAt(int index) const = 0; |
| + |
| + // Returns the original language index. |
| + virtual int GetOriginalLanguageIndex() const = 0; |
| + |
| + // Sets the original language index. |
| + virtual void SetOriginalLanguageIndex(int index) = 0; |
| + |
| + // Returns the target language index. |
| + virtual int GetTargetLanguageIndex() const = 0; |
| + |
| + // Sets the target language index. |
| + virtual void SetTargetLanguageIndex(int index) = 0; |
| + |
| + // Sets the value if the user doesn't want to have the page translated in the |
| + // current page's language. |
| + virtual void SetNeverTranslateLanguage(bool value) = 0; |
| + |
| + // Sets the value if the user doesn't want to have the page translated the |
| + // current page's domain. |
| + virtual void SetNeverTranslateSite(bool value) = 0; |
| + |
| + // Returns true if the webpage in the current original language should be |
| + // translated into the current target language automatically. |
| + virtual bool ShouldAlwaysTranslate() const = 0; |
| + |
| + // Sets the value if the webpage in the current original language should be |
| + // translated into the current target language automatically. |
| + virtual void SetAlwaysTranslate(bool value) = 0; |
| + |
| + // Starts translating the current page. |
| + virtual void Translate() = 0; |
| + |
| + // Reverts translation. |
| + virtual void RevertTranslation() = 0; |
| + |
| + // Processes when the user declines translation. |
| + virtual void TranslationDeclined() = 0; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_MODEL_H_ |