diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 07:02:04 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 07:02:04 +0000 |
commit | ad23a09a27c2863e56810a849beca09cb5e2b6d8 (patch) | |
tree | c9527aeb0e9c0190f621011624ed0f4e7eecf035 /chrome/browser/translate | |
parent | e18637fbd2e55fb610d92bc061f10a0629826377 (diff) | |
download | chromium_src-ad23a09a27c2863e56810a849beca09cb5e2b6d8.zip chromium_src-ad23a09a27c2863e56810a849beca09cb5e2b6d8.tar.gz chromium_src-ad23a09a27c2863e56810a849beca09cb5e2b6d8.tar.bz2 |
Convert a few methods in NavigationController to return a content::NavigationEntry, in preparation for creating an interface around NavigationController.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/9008034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
4 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc index 662d674..af19ca6 100644 --- a/chrome/browser/translate/options_menu_model.cc +++ b/chrome/browser/translate/options_menu_model.cc @@ -10,7 +10,7 @@ #include "chrome/browser/infobars/infobar_tab_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/translate/translate_infobar_delegate.h" -#include "content/browser/tab_contents/navigation_entry.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -100,7 +100,7 @@ bool OptionsMenuModel::IsCommandIdEnabled(int command_id) const { DCHECK(translate_infobar_delegate_ != NULL); DCHECK(translate_infobar_delegate_->owner() != NULL); DCHECK(translate_infobar_delegate_->owner()->web_contents() != NULL); - NavigationEntry* entry = translate_infobar_delegate_->owner()-> + content::NavigationEntry* entry = translate_infobar_delegate_->owner()-> web_contents()->GetController().GetActiveEntry(); // Delegate and tab contents should never be NULL, but active entry // can be NULL when running tests. We want to return false if NULL. diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index c379e10..cb285d2 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -15,9 +15,9 @@ #include "chrome/browser/translate/translate_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_constants.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_entry.h" #include "grit/generated_resources.h" #include "grit/theme_resources_standard.h" #include "ui/base/l10n/l10n_util.h" @@ -399,7 +399,7 @@ TranslateInfoBarDelegate* } std::string TranslateInfoBarDelegate::GetPageHost() { - NavigationEntry* entry = + content::NavigationEntry* entry = owner()->web_contents()->GetController().GetActiveEntry(); return entry ? entry->GetURL().HostNoBrackets() : std::string(); } diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 61dcb77..dd1ec5a 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -35,9 +35,9 @@ #include "chrome/common/translate_errors.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" @@ -262,7 +262,7 @@ void TranslateManager::Observe(int type, content::Source<NavigationController>(source).ptr(); content::LoadCommittedDetails* load_details = content::Details<content::LoadCommittedDetails>(details).ptr(); - NavigationEntry* entry = controller->GetActiveEntry(); + content::NavigationEntry* entry = controller->GetActiveEntry(); if (!entry) { NOTREACHED(); return; @@ -402,7 +402,7 @@ void TranslateManager::OnURLFetchComplete(const content::URLFetcher* source) { // The tab went away while we were retrieving the script. continue; } - NavigationEntry* entry = tab->GetController().GetActiveEntry(); + content::NavigationEntry* entry = tab->GetController().GetActiveEntry(); if (!entry || entry->GetPageID() != request.page_id) { // We navigated away from the page the translation was triggered on. continue; @@ -468,7 +468,7 @@ void TranslateManager::InitiateTranslation(WebContents* tab, if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableTranslate)) return; - NavigationEntry* entry = tab->GetController().GetActiveEntry(); + content::NavigationEntry* entry = tab->GetController().GetActiveEntry(); if (!entry) { // This can happen for popups created with window.open(""). return; @@ -553,7 +553,8 @@ void TranslateManager::InitiateTranslationPosted( void TranslateManager::TranslatePage(WebContents* web_contents, const std::string& source_lang, const std::string& target_lang) { - NavigationEntry* entry = web_contents->GetController().GetActiveEntry(); + content::NavigationEntry* entry = + web_contents->GetController().GetActiveEntry(); if (!entry) { NOTREACHED(); return; @@ -585,7 +586,8 @@ void TranslateManager::TranslatePage(WebContents* web_contents, } void TranslateManager::RevertTranslation(WebContents* web_contents) { - NavigationEntry* entry = web_contents->GetController().GetActiveEntry(); + content::NavigationEntry* entry = + web_contents->GetController().GetActiveEntry(); if (!entry) { NOTREACHED(); return; @@ -631,7 +633,7 @@ void TranslateManager::DoTranslatePage(WebContents* tab, const std::string& translate_script, const std::string& source_lang, const std::string& target_lang) { - NavigationEntry* entry = tab->GetController().GetActiveEntry(); + content::NavigationEntry* entry = tab->GetController().GetActiveEntry(); if (!entry) { NOTREACHED(); return; diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 7d5260d..13d2235 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -26,9 +26,9 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/browser/renderer_host/mock_render_process_host.h" -#include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_registrar.h" #include "content/test/notification_observer_mock.h" |