Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4841)

Unified Diff: chrome/browser/ui/translate/translate_bubble_model.h

Issue 26775007: Translate: Add TranslateBubbleView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebasing) Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..af12a910b3e3f7179a017954ce9ae5bbc2605521
--- /dev/null
+++ b/chrome/browser/ui/translate/translate_bubble_model.h
@@ -0,0 +1,89 @@
+// 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 {
+ // The view state before translating.
+ VIEW_STATE_BEFORE_TRANSLATE,
+
+ // The view state during translating.
+ VIEW_STATE_TRANSLATING,
+
+ // The view state after translating.
+ VIEW_STATE_AFTER_TRANSLATE,
+
+ // The view state when an error of Translate happens.
+ VIEW_STATE_ERROR,
+
+ // The view state when the detailed settings is shown. This view appears
+ // when the user click a link 'Advanced' on other views.
+ VIEW_STATE_ADVANCED,
+ };
+
+ 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_
« no previous file with comments | « chrome/browser/ui/translate/language_combobox_model.cc ('k') | chrome/browser/ui/translate/translate_bubble_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698