summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google/google_url_tracker.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-02 06:08:32 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-02 06:08:32 +0000
commitfbc5e5f97c0bd570130471c85c207aee528eef4c (patch)
tree6988a8d7eb9f6995da952e08c3e806b66a394f6f /chrome/browser/google/google_url_tracker.cc
parentd270ff2dbac86886aa6a30b7fca6391b10498649 (diff)
downloadchromium_src-fbc5e5f97c0bd570130471c85c207aee528eef4c.zip
chromium_src-fbc5e5f97c0bd570130471c85c207aee528eef4c.tar.gz
chromium_src-fbc5e5f97c0bd570130471c85c207aee528eef4c.tar.bz2
Convert chrome users of NavigationController::tab_contents() to use GetWebContents() instead.
BUG=98716 TBR=joi Review URL: http://codereview.chromium.org/8986009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google/google_url_tracker.cc')
-rw-r--r--chrome/browser/google/google_url_tracker.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index 6daa8e9..ae1c539 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -21,9 +21,9 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_controller.h"
-#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "net/base/load_flags.h"
@@ -34,6 +34,7 @@
using content::OpenURLParams;
using content::Referrer;
+using content::WebContents;
namespace {
@@ -313,7 +314,7 @@ void GoogleURLTracker::RedoSearch() {
if (new_search_url.is_valid()) {
OpenURLParams params(new_search_url, Referrer(), CURRENT_TAB,
content::PAGE_TRANSITION_GENERATED, false);
- controller_->tab_contents()->OpenURL(params);
+ controller_->GetWebContents()->OpenURL(params);
}
}
@@ -331,7 +332,7 @@ void GoogleURLTracker::Observe(int type,
case content::NOTIFICATION_NAV_ENTRY_COMMITTED:
case content::NOTIFICATION_TAB_CLOSED:
OnNavigationCommittedOrTabClosed(
- content::Source<NavigationController>(source).ptr()->tab_contents(),
+ content::Source<NavigationController>(source).ptr()->GetWebContents(),
type);
break;
@@ -370,12 +371,12 @@ void GoogleURLTracker::OnNavigationPending(
}
void GoogleURLTracker::OnNavigationCommittedOrTabClosed(
- TabContents* tab_contents,
+ WebContents* web_contents,
int type) {
registrar_.RemoveAll();
if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
- ShowGoogleURLInfoBarIfNecessary(tab_contents);
+ ShowGoogleURLInfoBarIfNecessary(web_contents);
} else {
controller_ = NULL;
infobar_ = NULL;
@@ -383,16 +384,16 @@ void GoogleURLTracker::OnNavigationCommittedOrTabClosed(
}
void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary(
- TabContents* tab_contents) {
+ WebContents* web_contents) {
if (!need_to_prompt_)
return;
DCHECK(!fetched_google_url_.is_empty());
// |tab_contents| can be NULL during tests.
InfoBarTabHelper* infobar_helper = NULL;
- if (tab_contents) {
+ if (web_contents) {
TabContentsWrapper* wrapper =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
+ TabContentsWrapper::GetCurrentWrapperForContents(web_contents);
infobar_helper = wrapper->infobar_tab_helper();
}
infobar_ = (*infobar_creator_)(infobar_helper, this, fetched_google_url_);