diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 03:07:55 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 03:07:55 +0000 |
commit | 86ab86b73e4167c4bcf19c16bf08ca9a780fb48b (patch) | |
tree | 9154a52a53f85e739c59f43fe34a3cc7963cc06f /chrome/browser/automation | |
parent | fccf2fb4583e78321e5da59dfba0c8b2021f914e (diff) | |
download | chromium_src-86ab86b73e4167c4bcf19c16bf08ca9a780fb48b.zip chromium_src-86ab86b73e4167c4bcf19c16bf08ca9a780fb48b.tar.gz chromium_src-86ab86b73e4167c4bcf19c16bf08ca9a780fb48b.tar.bz2 |
Move notification_source from content/common to content/browser/public and put it into the content namespace.
BUG=98716
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_browser_tracker.cc | 6 | ||||
-rw-r--r-- | chrome/browser/automation/automation_resource_tracker.h | 22 | ||||
-rw-r--r-- | chrome/browser/automation/automation_tab_tracker.cc | 28 |
3 files changed, 29 insertions, 27 deletions
diff --git a/chrome/browser/automation/automation_browser_tracker.cc b/chrome/browser/automation/automation_browser_tracker.cc index f5a0873..8c4a6f4 100644 --- a/chrome/browser/automation/automation_browser_tracker.cc +++ b/chrome/browser/automation/automation_browser_tracker.cc @@ -5,7 +5,7 @@ #include "chrome/browser/automation/automation_browser_tracker.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" AutomationBrowserTracker::AutomationBrowserTracker( IPC::Message::Sender* automation) @@ -16,10 +16,10 @@ AutomationBrowserTracker::~AutomationBrowserTracker() {} void AutomationBrowserTracker::AddObserver(Browser* resource) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, - Source<Browser>(resource)); + content::Source<Browser>(resource)); } void AutomationBrowserTracker::RemoveObserver(Browser* resource) { registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_CLOSED, - Source<Browser>(resource)); + content::Source<Browser>(resource)); } diff --git a/chrome/browser/automation/automation_resource_tracker.h b/chrome/browser/automation/automation_resource_tracker.h index 1559670..b75af06 100644 --- a/chrome/browser/automation/automation_resource_tracker.h +++ b/chrome/browser/automation/automation_resource_tracker.h @@ -9,9 +9,9 @@ #include <map> #include "base/basictypes.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" +#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "ipc/ipc_message.h" @@ -69,7 +69,7 @@ class AutomationResourceTrackerImpl { // close notifications. template <class T> class AutomationResourceTracker : public AutomationResourceTrackerImpl, - public NotificationObserver { + public content::NotificationObserver { public: explicit AutomationResourceTracker(IPC::Message::Sender* automation) : AutomationResourceTrackerImpl(automation) {} @@ -117,14 +117,14 @@ class AutomationResourceTracker : public AutomationResourceTrackerImpl, return GetHandleImpl(resource); } - // NotificationObserver implementation--the only thing that this tracker - // does in response to notifications is to tell the AutomationProxy + // content::NotificationObserver implementation--the only thing that this + // tracker does in response to notifications is to tell the AutomationProxy // that the associated handle is now invalid. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { - T resource = - Source<typename AutomationResourceTraits<T>::ValueType>(source).ptr(); + const content::NotificationSource& source, + const content::NotificationDetails& details) { + T resource = content::Source<typename AutomationResourceTraits<T>:: + ValueType>(source).ptr(); CloseResource(resource); } @@ -147,7 +147,7 @@ class AutomationResourceTracker : public AutomationResourceTrackerImpl, RemoveObserver(static_cast<T>(const_cast<void*>(resource))); } - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; private: DISALLOW_COPY_AND_ASSIGN(AutomationResourceTracker); diff --git a/chrome/browser/automation/automation_tab_tracker.cc b/chrome/browser/automation/automation_tab_tracker.cc index d8ed59a..03e3320 100644 --- a/chrome/browser/automation/automation_tab_tracker.cc +++ b/chrome/browser/automation/automation_tab_tracker.cc @@ -6,7 +6,7 @@ #include "content/browser/tab_contents/navigation_controller.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_source.h" +#include "content/public/browser/notification_source.h" AutomationTabTracker::AutomationTabTracker(IPC::Message::Sender* automation) : AutomationResourceTracker<NavigationController*>(automation) { @@ -19,38 +19,40 @@ void AutomationTabTracker::AddObserver(NavigationController* resource) { // This tab could either be a regular tab or an external tab // Register for both notifications. registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Add(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); // We also want to know about navigations so we can keep track of the last // navigation time. registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); } void AutomationTabTracker::RemoveObserver(NavigationController* resource) { registrar_.Remove(this, content::NOTIFICATION_TAB_CLOSING, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Remove(this, chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, - Source<NavigationController>(resource)); + content::Source<NavigationController>(resource)); } -void AutomationTabTracker::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { +void AutomationTabTracker::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case content::NOTIFICATION_LOAD_STOP: - last_navigation_times_[Source<NavigationController>(source).ptr()] = - base::Time::Now(); + last_navigation_times_[ + content::Source<NavigationController>(source).ptr()] = + base::Time::Now(); return; case chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED: case content::NOTIFICATION_TAB_CLOSING: { std::map<NavigationController*, base::Time>::iterator iter = last_navigation_times_.find( - Source<NavigationController>(source).ptr()); + content::Source<NavigationController>(source).ptr()); if (iter != last_navigation_times_.end()) last_navigation_times_.erase(iter); } |