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

Unified Diff: chrome/browser/tab_contents/language_state.h

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: view id on tests 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/tab_contents/language_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/language_state.h
diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h
index b5ac059c29f4c0e1c831066b95c5ce5fe1c230f4..2663c4ed2e606da1cabc04d022fecd8a2f4a0e2c 100644
--- a/chrome/browser/tab_contents/language_state.h
+++ b/chrome/browser/tab_contents/language_state.h
@@ -9,9 +9,12 @@
#include "base/basictypes.h"
+class LanguageStateObserver;
+
namespace content {
-class NavigationController;
struct LoadCommittedDetails;
+class NavigationController;
+class WebContents;
}
// This class holds the language state of the current page.
@@ -71,6 +74,17 @@ class LanguageState {
// navigation.
bool in_page_navigation() const { return in_page_navigation_; }
+ // Whether the translate is enabled. This value is supposed to be used for the
+ // Translate icon on the Omnibox.
+ bool translate_enabled() const { return translate_enabled_; }
+ void SetTranslateEnabled(bool value);
+
+ // Whether the current page's language is different from the previous
+ // language.
+ bool HasLanguageChanged() const;
+
+ void set_observer(LanguageStateObserver* observer) { observer_ = observer; }
+
private:
// The languages this page is in. Note that current_lang_ is different from
// original_lang_ when the page has been translated.
@@ -109,6 +123,11 @@ class LanguageState {
// Whether the current navigation is a fragment navigation (in page).
bool in_page_navigation_;
+ // Whether the Translate is enabled.
+ bool translate_enabled_;
+
+ LanguageStateObserver* observer_;
+
DISALLOW_COPY_AND_ASSIGN(LanguageState);
};
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/tab_contents/language_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698