summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/language_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents/language_state.h')
-rw-r--r--chrome/browser/tab_contents/language_state.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h
index f428229..8cbdfd7 100644
--- a/chrome/browser/tab_contents/language_state.h
+++ b/chrome/browser/tab_contents/language_state.h
@@ -30,7 +30,10 @@ class LanguageState {
void DidNavigate(bool reload, bool in_page_navigation);
// Should be called when the language of the page has been determined.
- void LanguageDetermined(const std::string& page_language);
+ // |page_translatable| when false indicates that the browser should not offer
+ // to translate the page.
+ void LanguageDetermined(const std::string& page_language,
+ bool page_translatable);
// Returns the language the current page should be translated to, based on the
// previous page languages and the transition. This should be called after
@@ -48,6 +51,8 @@ class LanguageState {
}
const std::string& current_language() const { return current_lang_; }
+ bool page_translatable() const { return page_translatable_; }
+
// Whether the page is currently in the process of being translated.
bool translation_pending() const { return translation_pending_; }
void set_translation_pending(bool value) { translation_pending_ = value; }
@@ -75,6 +80,11 @@ class LanguageState {
// The navigation controller of the tab we are associated with.
NavigationController* navigation_controller_;
+ // Whether it is OK to offer to translate the page. Some pages explictly
+ // specify that they should not be translated by the browser (this is the case
+ // for GMail for example, which provides its own translation features).
+ bool page_translatable_;
+
// Whether a translation is currently pending (TabContents waiting for the
// PAGE_TRANSLATED notification). This is needed to avoid sending duplicate
// translate requests to a page. TranslateManager initiates translations