summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/tabs/tabs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/api/tabs/tabs.cc')
-rw-r--r--chrome/browser/extensions/api/tabs/tabs.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc
index b7152d1..20053f9 100644
--- a/chrome/browser/extensions/api/tabs/tabs.cc
+++ b/chrome/browser/extensions/api/tabs/tabs.cc
@@ -1825,16 +1825,17 @@ bool DetectTabLanguageFunction::RunImpl() {
AddRef(); // Balanced in GotLanguage()
- TranslateTabHelper* helper = contents->translate_tab_helper();
- if (!helper->language_state().original_language().empty()) {
+ TranslateTabHelper* translate_tab_helper =
+ TranslateTabHelper::FromWebContents(contents->web_contents());
+ if (!translate_tab_helper->language_state().original_language().empty()) {
// Delay the callback invocation until after the current JS call has
// returned.
MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
&DetectTabLanguageFunction::GotLanguage, this,
- helper->language_state().original_language()));
+ translate_tab_helper->language_state().original_language()));
return true;
}
- // The tab contents does not know its language yet. Let's wait until it
+ // The tab contents does not know its language yet. Let's wait until it
// receives it, or until the tab is closed/navigates to some other page.
registrar_.Add(this, chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED,
content::Source<WebContents>(contents->web_contents()));