diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 02:52:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 02:52:53 +0000 |
commit | 6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c (patch) | |
tree | a75584b11b8ef188b4eb3376b9146e063823a916 /chrome/browser/prerender | |
parent | bf3ee201c1ca5112f7fd173fc4785aa52920c5c0 (diff) | |
download | chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.zip chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.gz chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.bz2 |
Move NotificationObserver, NotificationSource, and NotificationDetails to content/public/browser.
This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header.
BUG=98716
TBR=joi
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender')
-rw-r--r-- | chrome/browser/prerender/prerender_browsertest.cc | 16 | ||||
-rw-r--r-- | chrome/browser/prerender/prerender_contents.cc | 22 | ||||
-rw-r--r-- | chrome/browser/prerender/prerender_contents.h | 14 | ||||
-rw-r--r-- | chrome/browser/prerender/prerender_manager.cc | 15 |
4 files changed, 35 insertions, 32 deletions
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index 84c0471..020424e 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -228,7 +228,7 @@ class TestPrerenderContents : public PrerenderContents { notification_registrar().Add( this, content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, - Source<RenderWidgetHost>(new_render_view_host)); + content::Source<RenderWidgetHost>(new_render_view_host)); new_render_view_host_ = new_render_view_host; @@ -236,12 +236,13 @@ class TestPrerenderContents : public PrerenderContents { } virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE { + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE { if (type == content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED) { - EXPECT_EQ(new_render_view_host_, Source<RenderWidgetHost>(source).ptr()); - bool is_visible = *Details<bool>(details).ptr(); + EXPECT_EQ(new_render_view_host_, + content::Source<RenderWidgetHost>(source).ptr()); + bool is_visible = *content::Details<bool>(details).ptr(); if (!is_visible) { was_hidden_ = true; @@ -723,7 +724,8 @@ class PrerenderBrowserTest : public InProcessBrowserTest { page_load_observer.reset( new ui_test_utils::WindowedNotificationObserver( content::NOTIFICATION_LOAD_STOP, - Source<NavigationController>(&tab_contents->controller()))); + content::Source<NavigationController>( + &tab_contents->controller()))); } // ui_test_utils::NavigateToURL waits until DidStopLoading is called on @@ -1726,7 +1728,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) { ASSERT_TRUE(prerender_contents != NULL); ui_test_utils::WindowedNotificationObserver favicon_update_watcher( chrome::NOTIFICATION_FAVICON_UPDATED, - Source<TabContents>(prerender_contents->prerender_contents()-> + content::Source<TabContents>(prerender_contents->prerender_contents()-> tab_contents())); NavigateToDestURL(); favicon_update_watcher.Wait(); diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index ef3885e..0c16105 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -299,22 +299,22 @@ void PrerenderContents::StartPrerendering( // APP_TERMINATING before non-OTR profiles are destroyed). // TODO(tburkard): figure out if this is needed. notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, - Source<Profile>(profile_)); + content::Source<Profile>(profile_)); // Register to inform new RenderViews that we're prerendering. notification_registrar_.Add( this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, - Source<TabContents>(new_contents)); + content::Source<TabContents>(new_contents)); // Register for redirect notifications sourced from |this|. notification_registrar_.Add( this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, - Source<RenderViewHostDelegate>(GetRenderViewHostDelegate())); + content::Source<RenderViewHostDelegate>(GetRenderViewHostDelegate())); // Register for new windows from any source. notification_registrar_.Add( this, content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, - Source<TabContents>(new_contents)); + content::Source<TabContents>(new_contents)); DCHECK(load_start_time_.is_null()); load_start_time_ = base::TimeTicks::Now(); @@ -381,8 +381,8 @@ PrerenderContents::~PrerenderContents() { } void PrerenderContents::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_PROFILE_DESTROYED: Destroy(FINAL_STATUS_PROFILE_DESTROYED); @@ -398,10 +398,10 @@ void PrerenderContents::Observe(int type, // to be remembered for future matching, and if it redirects to // an https resource, it needs to be canceled. If a subresource // is redirected, nothing changes. - DCHECK(Source<RenderViewHostDelegate>(source).ptr() == + DCHECK(content::Source<RenderViewHostDelegate>(source).ptr() == GetRenderViewHostDelegate()); ResourceRedirectDetails* resource_redirect_details = - Details<ResourceRedirectDetails>(details).ptr(); + content::Details<ResourceRedirectDetails>(details).ptr(); CHECK(resource_redirect_details); if (resource_redirect_details->resource_type() == ResourceType::MAIN_FRAME) { @@ -413,10 +413,10 @@ void PrerenderContents::Observe(int type, case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB: { if (prerender_contents_.get()) { - DCHECK_EQ(Source<TabContents>(source).ptr(), + DCHECK_EQ(content::Source<TabContents>(source).ptr(), prerender_contents_->tab_contents()); - Details<RenderViewHost> new_render_view_host(details); + content::Details<RenderViewHost> new_render_view_host(details); OnRenderViewHostCreated(new_render_view_host.ptr()); // When a new RenderView is created for a prerendering TabContents, @@ -443,7 +443,7 @@ void PrerenderContents::Observe(int type, case content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED: { if (prerender_contents_.get()) { - CHECK(Source<TabContents>(source).ptr() == + CHECK(content::Source<TabContents>(source).ptr() == prerender_contents_->tab_contents()); // Since we don't want to permit child windows that would have a // window.opener property, terminate prerendering. diff --git a/chrome/browser/prerender/prerender_contents.h b/chrome/browser/prerender/prerender_contents.h index 874502e..f508998 100644 --- a/chrome/browser/prerender/prerender_contents.h +++ b/chrome/browser/prerender/prerender_contents.h @@ -16,7 +16,7 @@ #include "chrome/browser/prerender/prerender_final_status.h" #include "content/browser/tab_contents/tab_contents_observer.h" #include "content/browser/renderer_host/render_view_host_delegate.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_registrar.h" class Profile; class RenderViewHost; @@ -44,7 +44,7 @@ class PrerenderTracker; // NavigationController because is has no facility for navigating (other than // programatically view window.location.href) or RenderViewHostManager because // it is never allowed to navigate across a SiteInstance boundary. -class PrerenderContents : public NotificationObserver, +class PrerenderContents : public content::NotificationObserver, public TabContentsObserver { public: // PrerenderContents::Create uses the currently registered Factory to create @@ -143,10 +143,10 @@ class PrerenderContents : public NotificationObserver, RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewGone() OVERRIDE; - // NotificationObserver + // content::NotificationObserver virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) OVERRIDE; + const content::NotificationSource& source, + const content::NotificationDetails& details) OVERRIDE; // Adds an alias URL, for one of the many redirections. If the URL can not // be prerendered - for example, it's an ftp URL - |this| will be destroyed @@ -203,7 +203,7 @@ class PrerenderContents : public NotificationObserver, // once the RenderViewHost has a RenderView and RenderWidgetHostView. virtual void OnRenderViewHostCreated(RenderViewHost* new_render_view_host); - NotificationRegistrar& notification_registrar() { + content::NotificationRegistrar& notification_registrar() { return notification_registrar_; } @@ -255,7 +255,7 @@ class PrerenderContents : public NotificationObserver, int32 page_id_; GURL url_; GURL icon_url_; - NotificationRegistrar notification_registrar_; + content::NotificationRegistrar notification_registrar_; // A vector of URLs that this prerendered page matches against. // This array can contain more than element as a result of redirects, diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index cf02a58..4acfdac 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -41,8 +41,8 @@ #include "content/browser/tab_contents/render_view_host_manager.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" #include "content/common/notification_service.h" namespace prerender { @@ -162,14 +162,15 @@ struct PrerenderManager::NavigationRecord { } }; -class PrerenderManager::MostVisitedSites : public NotificationObserver { +class PrerenderManager::MostVisitedSites + : public content::NotificationObserver { public: explicit MostVisitedSites(Profile* profile) : profile_(profile) { history::TopSites* top_sites = GetTopSites(); if (top_sites) { registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED, - Source<history::TopSites>(top_sites)); + content::Source<history::TopSites>(top_sites)); } UpdateMostVisited(); @@ -192,8 +193,8 @@ class PrerenderManager::MostVisitedSites : public NotificationObserver { } void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { DCHECK_EQ(type, chrome::NOTIFICATION_TOP_SITES_CHANGED); UpdateMostVisited(); } @@ -211,7 +212,7 @@ class PrerenderManager::MostVisitedSites : public NotificationObserver { CancelableRequestConsumer topsites_consumer_; Profile* profile_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; std::set<GURL> urls_; }; |