diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 21:37:09 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 21:37:09 +0000 |
commit | ea049a01f82647dc12e4001c8be03e4124faaff3 (patch) | |
tree | 0bb59450d13be2f37e404cfd2374ea27fba7461f /chrome/browser/translate/translate_manager.h | |
parent | 5ca3ddf71cb1db27e206c4d048770ad21e5688c9 (diff) | |
download | chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.zip chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.tar.gz chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.tar.bz2 |
Convert a bunch of WebContentsObservers to use web_contents() instead of tab_contents(), as well as all the dependent code.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/8982008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_manager.h')
-rw-r--r-- | chrome/browser/translate/translate_manager.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index 60dcb1c..54687a9 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -27,6 +27,10 @@ class PrefService; class TabContents; class TranslateInfoBarDelegate; +namespace content { +class WebContents; +} + // The TranslateManager class is responsible for showing an info-bar when a page // in a language different than the user language is loaded. It triggers the // page translation the user requests. @@ -53,18 +57,18 @@ class TranslateManager : public content::NotificationObserver, // Translates the page contents from |source_lang| to |target_lang|. // The actual translation might be performed asynchronously if the translate // script is not yet available. - void TranslatePage(TabContents* tab_contents, + void TranslatePage(content::WebContents* web_contents, const std::string& source_lang, const std::string& target_lang); - // Reverts the contents of the page in |tab_contents| to its original + // Reverts the contents of the page in |web_contents| to its original // language. - void RevertTranslation(TabContents* tab_contents); + void RevertTranslation(content::WebContents* web_contents); // Reports to the Google translate server that a page language was incorrectly // detected. This call is initiated by the user selecting the "report" menu // under options in the translate infobar. - void ReportLanguageDetectionError(TabContents* tab_contents); + void ReportLanguageDetectionError(content::WebContents* web_contents); // Clears the translate script, so it will be fetched next time we translate. void ClearTranslateScript() { translate_script_.clear(); } @@ -139,7 +143,7 @@ class TranslateManager : public content::NotificationObserver, const std::string& page_lang); // Sends a translation request to the RenderView of |tab_contents|. - void DoTranslatePage(TabContents* tab_contents, + void DoTranslatePage(content::WebContents* web_contents, const std::string& translate_script, const std::string& source_lang, const std::string& target_lang); @@ -161,7 +165,8 @@ class TranslateManager : public content::NotificationObserver, // Shows the specified translate |infobar| in the given |tab|. If a current // translate infobar is showing, it just replaces it with the new one. - void ShowInfoBar(TabContents* tab, TranslateInfoBarDelegate* infobar); + void ShowInfoBar(content::WebContents* tab, + TranslateInfoBarDelegate* infobar); // Returns the language to translate to. The language returned is the // first language found in the following list that is supported by the @@ -173,7 +178,7 @@ class TranslateManager : public content::NotificationObserver, // Returns the translate info bar showing in |tab| or NULL if none is showing. static TranslateInfoBarDelegate* GetTranslateInfoBarDelegate( - TabContents* tab); + content::WebContents* tab); content::NotificationRegistrar notification_registrar_; |