summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 19:11:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 19:11:00 +0000
commitd3e1219e63411ebad59a739dbabd62e2db5e65e9 (patch)
tree0641eca6f06dac0ce385a5d39c8c6a78a78bbb64
parent01b2d864e04841863865c90c419dd221e28e6af4 (diff)
downloadchromium_src-d3e1219e63411ebad59a739dbabd62e2db5e65e9.zip
chromium_src-d3e1219e63411ebad59a739dbabd62e2db5e65e9.tar.gz
chromium_src-d3e1219e63411ebad59a739dbabd62e2db5e65e9.tar.bz2
TabContentsWrapper -> TabContents, part 15.
Google. BUG=131026 TEST=no change Review URL: https://chromiumcodereview.appspot.com/10544074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141453 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/google/google_url_tracker.cc26
-rw-r--r--chrome/browser/google/google_url_tracker.h2
-rw-r--r--chrome/browser/google/google_url_tracker_unittest.cc11
3 files changed, 16 insertions, 23 deletions
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index afbea2f..c32e4f4 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -385,30 +385,27 @@ void GoogleURLTracker::Observe(int type,
case content::NOTIFICATION_NAV_ENTRY_PENDING: {
content::NavigationController* controller =
content::Source<content::NavigationController>(source).ptr();
- TabContentsWrapper* tab_contents =
- TabContentsWrapper::GetCurrentWrapperForContents(
- controller->GetWebContents());
+ TabContents* tab_contents =
+ TabContents::FromWebContents(controller->GetWebContents());
OnNavigationPending(source,
- content::Source<TabContentsWrapper>(tab_contents),
+ content::Source<TabContents>(tab_contents),
tab_contents->infobar_tab_helper(),
controller->GetPendingEntry()->GetURL());
break;
}
case content::NOTIFICATION_NAV_ENTRY_COMMITTED: {
- TabContentsWrapper* tab_contents =
- TabContentsWrapper::GetCurrentWrapperForContents(
- content::Source<content::NavigationController>(source)->
- GetWebContents());
+ TabContents* tab_contents = TabContents::FromWebContents(
+ content::Source<content::NavigationController>(source)->
+ GetWebContents());
OnNavigationCommittedOrTabClosed(source,
- content::Source<TabContentsWrapper>(tab_contents),
+ content::Source<TabContents>(tab_contents),
tab_contents->infobar_tab_helper(), true);
break;
}
case chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED: {
- TabContentsWrapper* tab_contents =
- content::Source<TabContentsWrapper>(source).ptr();
+ TabContents* tab_contents = content::Source<TabContents>(source).ptr();
OnNavigationCommittedOrTabClosed(
content::Source<content::NavigationController>(
&tab_contents->web_contents()->GetController()), source,
@@ -417,12 +414,11 @@ void GoogleURLTracker::Observe(int type,
}
case chrome::NOTIFICATION_INSTANT_COMMITTED: {
- TabContentsWrapper* tab_contents =
- content::Source<TabContentsWrapper>(source).ptr();
+ TabContents* tab_contents = content::Source<TabContents>(source).ptr();
content::WebContents* web_contents = tab_contents->web_contents();
content::Source<content::NavigationController> source(
&web_contents->GetController());
- content::Source<TabContentsWrapper> tab_contents_source(tab_contents);
+ content::Source<TabContents> tab_contents_source(tab_contents);
InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper();
OnNavigationPending(source, tab_contents_source, infobar_helper,
web_contents->GetURL());
diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h
index 365496d..50d52fb 100644
--- a/chrome/browser/google/google_url_tracker.h
+++ b/chrome/browser/google/google_url_tracker.h
@@ -144,7 +144,7 @@ class GoogleURLTracker : public net::URLFetcherDelegate,
// listeners, to indicate that we've received the "load now pending"
// notification. |navigation_controller_source| and |tab_contents_source| are
// NotificationSources pointing to the associated NavigationController and
- // TabContentsWrapper, respectively, for this load; |infobar_helper| is the
+ // TabContents, respectively, for this load; |infobar_helper| is the
// InfoBarTabHelper of the associated tab; and |search_url| is the actual
// search performed by the user, which if necessary we'll re-do on a new
// domain later. This function creates a (still-invisible) InfoBarDelegate
diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc
index a22bc97..dd52008 100644
--- a/chrome/browser/google/google_url_tracker_unittest.cc
+++ b/chrome/browser/google/google_url_tracker_unittest.cc
@@ -21,7 +21,6 @@
#include "testing/gtest/include/gtest/gtest.h"
class TabContents;
-typedef TabContents TabContentsWrapper;
// TestNotificationObserver ---------------------------------------------------
@@ -244,8 +243,7 @@ void GoogleURLTrackerTest::SetSearchPending(const GURL& search_url,
google_url_tracker_->OnNavigationPending(
content::Source<content::NavigationController>(
reinterpret_cast<content::NavigationController*>(unique_id)),
- content::Source<TabContentsWrapper>(
- reinterpret_cast<TabContentsWrapper*>(unique_id)),
+ content::Source<TabContents>(reinterpret_cast<TabContents*>(unique_id)),
reinterpret_cast<InfoBarTabHelper*>(unique_id), search_url);
}
}
@@ -256,16 +254,15 @@ void GoogleURLTrackerTest::CommitSearch(int unique_id) {
if (google_url_tracker_->registrar_.IsRegistered(google_url_tracker_.get(),
content::NOTIFICATION_NAV_ENTRY_COMMITTED, source)) {
google_url_tracker_->OnNavigationCommittedOrTabClosed(source,
- content::Source<TabContentsWrapper>(
- reinterpret_cast<TabContentsWrapper*>(unique_id)),
+ content::Source<TabContents>(reinterpret_cast<TabContents*>(unique_id)),
reinterpret_cast<InfoBarTabHelper*>(unique_id), true);
}
}
void GoogleURLTrackerTest::CloseTab(int unique_id) {
unique_ids_seen_.erase(unique_id);
- content::Source<TabContentsWrapper> source(
- reinterpret_cast<TabContentsWrapper*>(unique_id));
+ content::Source<TabContents> source(
+ reinterpret_cast<TabContents*>(unique_id));
InfoBarTabHelper* infobar_helper =
reinterpret_cast<InfoBarTabHelper*>(unique_id);
if (google_url_tracker_->registrar_.IsRegistered(google_url_tracker_.get(),