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/debugger | |
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/debugger')
-rw-r--r-- | chrome/browser/debugger/devtools_sanity_unittest.cc | 27 | ||||
-rw-r--r-- | chrome/browser/debugger/devtools_window.cc | 23 | ||||
-rw-r--r-- | chrome/browser/debugger/devtools_window.h | 14 |
3 files changed, 34 insertions, 30 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 5bc66b0..86e1050 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -26,30 +26,30 @@ #include "content/browser/worker_host/worker_process_host.h" #include "content/browser/worker_host/worker_service.h" #include "content/browser/worker_host/worker_service_observer.h" -#include "content/common/notification_registrar.h" -#include "content/common/notification_service.h" #include "content/common/worker_messages.h" +#include "content/public/browser/notification_registrar.h" +#include "content/common/notification_service.h" #include "net/test/test_server.h" namespace { // Used to block until a dev tools client window's browser is closed. -class BrowserClosedObserver : public NotificationObserver { +class BrowserClosedObserver : public content::NotificationObserver { public: explicit BrowserClosedObserver(Browser* browser) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, - Source<Browser>(browser)); + content::Source<Browser>(browser)); ui_test_utils::RunMessageLoop(); } virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { MessageLoopForUI::current()->Quit(); } private: - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(BrowserClosedObserver); }; @@ -180,7 +180,7 @@ class CancelableQuitTask : public Task { // Base class for DevTools tests that test devtools functionality for // extensions and content scripts. class DevToolsExtensionDebugTest : public DevToolsSanityTest, - public NotificationObserver { + public content::NotificationObserver { public: DevToolsExtensionDebugTest() : DevToolsSanityTest() { PathService::Get(chrome::DIR_TEST_DATA, &test_extensions_dir_); @@ -200,7 +200,7 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, ExtensionService* service = browser()->profile()->GetExtensionService(); size_t num_before = service->extensions()->size(); { - NotificationRegistrar registrar; + content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, NotificationService::AllSources()); CancelableQuitTask* delayed_quit = @@ -223,7 +223,7 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, // NOTE: This assumes that the extension host list is not changing while // this method is running. - NotificationRegistrar registrar; + content::NotificationRegistrar registrar; registrar.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, NotificationService::AllSources()); CancelableQuitTask* delayed_quit = @@ -246,8 +246,8 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, } void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_EXTENSION_LOADED: case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: @@ -412,7 +412,8 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { if (client_contents->IsLoading()) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, - Source<NavigationController>(&client_contents->controller())); + content::Source<NavigationController>( + &client_contents->controller())); observer.Wait(); } } diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index 2d072d9..0490567 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -149,16 +149,19 @@ DevToolsWindow::DevToolsWindow(TabContentsWrapper* tab_contents, entry->favicon().set_is_valid(true); // Register on-load actions. - registrar_.Add(this, - content::NOTIFICATION_LOAD_STOP, - Source<NavigationController>(&tab_contents_->controller())); - registrar_.Add(this, - content::NOTIFICATION_TAB_CLOSING, - Source<NavigationController>(&tab_contents_->controller())); + registrar_.Add( + this, + content::NOTIFICATION_LOAD_STOP, + content::Source<NavigationController>(&tab_contents_->controller())); + registrar_.Add( + this, + content::NOTIFICATION_TAB_CLOSING, + content::Source<NavigationController>(&tab_contents_->controller())); registrar_.Add( this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, - Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); + content::Source<ThemeService>( + ThemeServiceFactory::GetForProfile(profile_))); // There is no inspected_rvh in case of shared workers. if (inspected_rvh) { TabContents* tab = inspected_rvh->delegate()->GetAsTabContents(); @@ -448,15 +451,15 @@ void DevToolsWindow::CallClientFunction(const string16& function_name, } void DevToolsWindow::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { if (type == content::NOTIFICATION_LOAD_STOP && !is_loaded_) { is_loaded_ = true; UpdateTheme(); DoAction(); AddDevToolsExtensionsToClient(); } else if (type == content::NOTIFICATION_TAB_CLOSING) { - if (Source<NavigationController>(source).ptr() == + if (content::Source<NavigationController>(source).ptr() == &tab_contents_->controller()) { // This happens when browser closes all of its tabs as a result // of window.Close event. diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h index d60d88b..afd903a 100644 --- a/chrome/browser/debugger/devtools_window.h +++ b/chrome/browser/debugger/devtools_window.h @@ -15,8 +15,8 @@ #include "content/browser/debugger/devtools_client_host.h" #include "content/browser/renderer_host/render_view_host_observer.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" namespace IPC { class Message; @@ -35,7 +35,7 @@ class Value; class DevToolsWindow : public DevToolsClientHost, - private NotificationObserver, + private content::NotificationObserver, private TabContentsDelegate, private RenderViewHostObserver { public: @@ -78,10 +78,10 @@ class DevToolsWindow bool IsInspectedBrowserPopupOrPanel(); void UpdateFrontendAttachedState(); - // Overridden from NotificationObserver. + // Overridden from content::NotificationObserver. virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details); + const content::NotificationSource& source, + const content::NotificationDetails& details); void ScheduleAction(DevToolsToggleAction action); void DoAction(); @@ -139,7 +139,7 @@ class DevToolsWindow bool docked_; bool is_loaded_; DevToolsToggleAction action_on_load_; - NotificationRegistrar registrar_; + content::NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); }; |