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

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: nits 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..a0b8ddcfd2ccad52da261b1a4cb4b1c69e6217bc
--- /dev/null
+++ b/chrome/browser/ui/translate/translate_bubble_model.h
@@ -0,0 +1,66 @@
+// 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"
+
+class TranslateBubbleModel {
+ public:
+ enum ViewType {
+ BEFORE_TRANSLATE,
+ TRANSLATING,
+ AFTER_TRANSLATE,
+ ERROR,
+ ADVANCED,
+ };
+
+ virtual ~TranslateBubbleModel() {}
+
+ // 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 current language is blocked.
+ virtual void SetLanguageBlocked(bool value) = 0;
+
+ // Sets the value if the current webpage is blacklisted.
+ virtual void SetSiteBlacklist(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_

Powered by Google App Engine
This is Rietveld 408576698