diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
commit | 43211582b1fa8c69136385250e7b0446cf364b5c (patch) | |
tree | 655ab01543012b6fd5699dee8fab92876959b7d9 /content/browser | |
parent | d43970a7ceee5fc5433787b0f28b64234a4039f2 (diff) | |
download | chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.zip chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.gz chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.bz2 |
Moving notification types which are chrome specific to a new header file chrome_notification_types.h.
This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END
which defines the end of the enum used by content to define notification types. The notificaton_type.h file
in content\common has been renamed to content_notification_types.h
BUG=76698
Review URL: http://codereview.chromium.org/7327007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
45 files changed, 257 insertions, 250 deletions
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h index bbb7d77..1b0e1315 100644 --- a/content/browser/accessibility/browser_accessibility_manager.h +++ b/content/browser/accessibility/browser_accessibility_manager.h @@ -55,7 +55,7 @@ class BrowserAccessibilityManager { virtual ~BrowserAccessibilityManager(); - // Type is a ViewHostMsg_AccessibilityNotification_Params::NotificationType. + // Type is a ViewHostMsg_AccessibilityNotification_Params::int. // We pass it as int so that we don't include the render message declaration // header here. virtual void NotifyAccessibilityEvent( diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index 169f59e..dd593ef 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc @@ -51,7 +51,8 @@ void ChromeAppCacheService::InitializeOnIOThread( cache_path_ = cache_path; resource_context_ = resource_context; registrar_.Add( - this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); + this, content::NOTIFICATION_PURGE_MEMORY, + NotificationService::AllSources()); SetClearLocalStateOnExit(clear_local_state_on_exit); // Init our base class. @@ -98,11 +99,11 @@ int ChromeAppCacheService::CanCreateAppCache( manifest_url, *resource_context_) ? net::OK : net::ERR_ACCESS_DENIED; } -void ChromeAppCacheService::Observe(NotificationType type, +void ChromeAppCacheService::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK(type == NotificationType::PURGE_MEMORY); + DCHECK(type == content::NOTIFICATION_PURGE_MEMORY); PurgeMemory(); } diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h index 4ebff8d..d325b37 100644 --- a/content/browser/appcache/chrome_appcache_service.h +++ b/content/browser/appcache/chrome_appcache_service.h @@ -57,7 +57,7 @@ class ChromeAppCacheService net::CompletionCallback* callback); // NotificationObserver override - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc index 4a65aa0..22a777d 100644 --- a/content/browser/browser_child_process_host.cc +++ b/content/browser/browser_child_process_host.cc @@ -35,7 +35,7 @@ static base::LazyInstance<ChildProcessList> g_child_process_list( class ChildNotificationTask : public Task { public: ChildNotificationTask( - NotificationType notification_type, ChildProcessInfo* info) + int notification_type, ChildProcessInfo* info) : notification_type_(notification_type), info_(*info) { } virtual void Run() { @@ -45,7 +45,7 @@ class ChildNotificationTask : public Task { } private: - NotificationType notification_type_; + int notification_type_; ChildProcessInfo info_; }; @@ -113,7 +113,7 @@ void BrowserChildProcessHost::SetTerminateChildOnShutdown( child_process_->SetTerminateChildOnShutdown(terminate_on_shutdown); } -void BrowserChildProcessHost::Notify(NotificationType type) { +void BrowserChildProcessHost::Notify(int type) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, new ChildNotificationTask(type, this)); } @@ -133,7 +133,7 @@ void BrowserChildProcessHost::OnChildDied() { OnProcessCrashed(exit_code); // Report that this child process crashed. - Notify(NotificationType::CHILD_PROCESS_CRASHED); + Notify(content::NOTIFICATION_CHILD_PROCESS_CRASHED); UMA_HISTOGRAM_COUNTS("ChildProcess.Crashes", this->type()); break; } @@ -141,7 +141,7 @@ void BrowserChildProcessHost::OnChildDied() { OnProcessWasKilled(exit_code); // Report that this child process was killed. - Notify(NotificationType::CHILD_PROCESS_WAS_KILLED); + Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED); UMA_HISTOGRAM_COUNTS("ChildProcess.Kills", this->type()); break; } @@ -149,7 +149,7 @@ void BrowserChildProcessHost::OnChildDied() { break; } // Notify in the main loop of the disconnection. - Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); + Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED); } ChildProcessHost::OnChildDied(); } diff --git a/content/browser/browser_child_process_host.h b/content/browser/browser_child_process_host.h index 61e7981..cc04b2a 100644 --- a/content/browser/browser_child_process_host.h +++ b/content/browser/browser_child_process_host.h @@ -87,7 +87,7 @@ class BrowserChildProcessHost : public ChildProcessHost, // Overrides from ChildProcessHost virtual void OnChildDied(); virtual void ShutdownStarted(); - virtual void Notify(NotificationType type); + virtual void Notify(int type); // Extends the base class implementation and removes this host from // the host list. Calls ChildProcessHost::ForceShutdown virtual void ForceShutdown(); diff --git a/content/browser/cert_store.cc b/content/browser/cert_store.cc index be75b38..a5ecee8 100644 --- a/content/browser/cert_store.cc +++ b/content/browser/cert_store.cc @@ -35,9 +35,9 @@ CertStore::CertStore() : next_cert_id_(1) { // removed from cache, and remove the cert when we know it // is not used anymore. - registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, + registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, NotificationService::AllSources()); - registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED, + registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, NotificationService::AllSources()); } @@ -135,11 +135,11 @@ void CertStore::RemoveCertsForRenderProcesHost(int process_id) { } } -void CertStore::Observe(NotificationType type, +void CertStore::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED || - type == NotificationType::RENDERER_PROCESS_CLOSED); + DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED || + type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED); RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); DCHECK(rph); RemoveCertsForRenderProcesHost(rph->id()); diff --git a/content/browser/cert_store.h b/content/browser/cert_store.h index af5e46c..294e932 100644 --- a/content/browser/cert_store.h +++ b/content/browser/cert_store.h @@ -42,7 +42,7 @@ class CertStore : public NotificationObserver { bool RetrieveCert(int cert_id, scoped_refptr<net::X509Certificate>* cert); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/debugger/devtools_manager.cc b/content/browser/debugger/devtools_manager.cc index 1db381f..e2509e3 100644 --- a/content/browser/debugger/devtools_manager.cc +++ b/content/browser/debugger/devtools_manager.cc @@ -41,7 +41,7 @@ void DevToolsManager::RegisterUserPrefs(PrefService* prefs) { DevToolsManager::DevToolsManager() : last_orphan_cookie_(0) { - registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_DELETED, + registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, NotificationService::AllSources()); } @@ -135,17 +135,17 @@ void DevToolsManager::ClientHostClosing(DevToolsClientHost* host) { } NotificationService::current()->Notify( - NotificationType::DEVTOOLS_WINDOW_CLOSING, + content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, Source<Profile>(inspected_rvh->site_instance()->GetProcess()->profile()), Details<RenderViewHost>(inspected_rvh)); UnbindClientHost(inspected_rvh, host); } -void DevToolsManager::Observe(NotificationType type, +void DevToolsManager::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::RENDER_VIEW_HOST_DELETED); + DCHECK(type == content::NOTIFICATION_RENDER_VIEW_HOST_DELETED); UnregisterDevToolsClientHostFor(Source<RenderViewHost>(source).ptr()); } diff --git a/content/browser/debugger/devtools_manager.h b/content/browser/debugger/devtools_manager.h index 71161b6..66a8008 100644 --- a/content/browser/debugger/devtools_manager.h +++ b/content/browser/debugger/devtools_manager.h @@ -98,7 +98,7 @@ class DevToolsManager : public DevToolsClientHost::CloseListener, virtual void ClientHostClosing(DevToolsClientHost* host); // Overridden from NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/debugger/devtools_sanity_unittest.cc b/content/browser/debugger/devtools_sanity_unittest.cc index fb7f691..c9d49a2 100644 --- a/content/browser/debugger/devtools_sanity_unittest.cc +++ b/content/browser/debugger/devtools_sanity_unittest.cc @@ -10,6 +10,7 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" @@ -28,12 +29,12 @@ namespace { class BrowserClosedObserver : public NotificationObserver { public: explicit BrowserClosedObserver(Browser* browser) { - registrar_.Add(this, NotificationType::BROWSER_CLOSED, + registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, Source<Browser>(browser)); ui_test_utils::RunMessageLoop(); } - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { MessageLoopForUI::current()->Quit(); @@ -182,7 +183,7 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, size_t num_before = service->extensions()->size(); { NotificationRegistrar registrar; - registrar.Add(this, NotificationType::EXTENSION_LOADED, + registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, NotificationService::AllSources()); CancelableQuitTask* delayed_quit = new CancelableQuitTask("Extension load timed out."); @@ -205,7 +206,7 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, // this method is running. NotificationRegistrar registrar; - registrar.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, + registrar.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, NotificationService::AllSources()); CancelableQuitTask* delayed_quit = new CancelableQuitTask("Extension host load timed out."); @@ -226,12 +227,12 @@ class DevToolsExtensionDebugTest : public DevToolsSanityTest, return true; } - void Observe(NotificationType type, + void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::EXTENSION_LOADED: - case NotificationType::EXTENSION_HOST_DID_STOP_LOADING: + switch (type) { + case chrome::NOTIFICATION_EXTENSION_LOADED: + case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: MessageLoopForUI::current()->Quit(); break; default: diff --git a/content/browser/debugger/devtools_window.cc b/content/browser/debugger/devtools_window.cc index ba633243..1c4e7e6 100644 --- a/content/browser/debugger/devtools_window.cc +++ b/content/browser/debugger/devtools_window.cc @@ -23,6 +23,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -121,14 +122,14 @@ DevToolsWindow::DevToolsWindow(Profile* profile, // Register on-load actions. registrar_.Add(this, - NotificationType::LOAD_STOP, + content::NOTIFICATION_LOAD_STOP, Source<NavigationController>(&tab_contents_->controller())); registrar_.Add(this, - NotificationType::TAB_CLOSING, + content::NOTIFICATION_TAB_CLOSING, Source<NavigationController>(&tab_contents_->controller())); registrar_.Add( this, - NotificationType::BROWSER_THEME_CHANGED, + chrome::NOTIFICATION_BROWSER_THEME_CHANGED, Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); TabContents* tab = inspected_rvh->delegate()->GetAsTabContents(); if (tab) @@ -394,15 +395,15 @@ void DevToolsWindow::CallClientFunction(const string16& function_name, ExecuteJavascriptInWebFrame(string16(), javascript); } -void DevToolsWindow::Observe(NotificationType type, +void DevToolsWindow::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::LOAD_STOP && !is_loaded_) { + if (type == content::NOTIFICATION_LOAD_STOP && !is_loaded_) { is_loaded_ = true; UpdateTheme(); DoAction(); AddDevToolsExtensionsToClient(); - } else if (type == NotificationType::TAB_CLOSING) { + } else if (type == content::NOTIFICATION_TAB_CLOSING) { if (Source<NavigationController>(source).ptr() == &tab_contents_->controller()) { // This happens when browser closes all of its tabs as a result @@ -412,7 +413,7 @@ void DevToolsWindow::Observe(NotificationType type, NotifyCloseListener(); delete this; } - } else if (type == NotificationType::BROWSER_THEME_CHANGED) { + } else if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { UpdateTheme(); } } diff --git a/content/browser/debugger/devtools_window.h b/content/browser/debugger/devtools_window.h index fbe6409..e8af7eb 100644 --- a/content/browser/debugger/devtools_window.h +++ b/content/browser/debugger/devtools_window.h @@ -67,7 +67,7 @@ class DevToolsWindow void UpdateFrontendAttachedState(); // Overridden from NotificationObserver. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/host_zoom_map.cc b/content/browser/host_zoom_map.cc index b392ea0..64e96f4 100644 --- a/content/browser/host_zoom_map.cc +++ b/content/browser/host_zoom_map.cc @@ -20,7 +20,7 @@ using WebKit::WebView; HostZoomMap::HostZoomMap() : default_zoom_level_(0.0) { registrar_.Add( - this, NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW, + this, content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW, NotificationService::AllSources()); } @@ -41,9 +41,10 @@ void HostZoomMap::SetZoomLevel(std::string host, double level) { host_zoom_levels_[host] = level; } - NotificationService::current()->Notify(NotificationType::ZOOM_LEVEL_CHANGED, - Source<HostZoomMap>(this), - Details<const std::string>(&host)); + NotificationService::current()->Notify( + content::NOTIFICATION_ZOOM_LEVEL_CHANGED, + Source<HostZoomMap>(this), + Details<const std::string>(&host)); } double HostZoomMap::GetTemporaryZoomLevel(int render_process_id, @@ -88,20 +89,21 @@ void HostZoomMap::SetTemporaryZoomLevel(int render_process_id, } std::string host; - NotificationService::current()->Notify(NotificationType::ZOOM_LEVEL_CHANGED, - Source<HostZoomMap>(this), - Details<const std::string>(&host)); + NotificationService::current()->Notify( + content::NOTIFICATION_ZOOM_LEVEL_CHANGED, + Source<HostZoomMap>(this), + Details<const std::string>(&host)); } void HostZoomMap::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - switch (type.value) { - case NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { + switch (type) { + case content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { base::AutoLock auto_lock(lock_); int render_view_id = Source<RenderViewHost>(source)->routing_id(); int render_process_id = Source<RenderViewHost>(source)->process()->id(); diff --git a/content/browser/host_zoom_map.h b/content/browser/host_zoom_map.h index 1e1c2c89..6f6b06d 100644 --- a/content/browser/host_zoom_map.h +++ b/content/browser/host_zoom_map.h @@ -65,7 +65,7 @@ class HostZoomMap : double level); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/mach_broker_mac.cc b/content/browser/mach_broker_mac.cc index dca1b11..40a0db9 100644 --- a/content/browser/mach_broker_mac.cc +++ b/content/browser/mach_broker_mac.cc @@ -33,16 +33,16 @@ class RegisterNotificationTask : public Task { virtual void Run() { broker_->registrar_.Add(broker_, - NotificationType::RENDERER_PROCESS_CLOSED, + content::NOTIFICATION_RENDERER_PROCESS_CLOSED, NotificationService::AllSources()); broker_->registrar_.Add(broker_, - NotificationType::RENDERER_PROCESS_TERMINATED, + content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, NotificationService::AllSources()); broker_->registrar_.Add(broker_, - NotificationType::CHILD_PROCESS_CRASHED, + content::NOTIFICATION_CHILD_PROCESS_CRASHED, NotificationService::AllSources()); broker_->registrar_.Add(broker_, - NotificationType::CHILD_PROCESS_HOST_DISCONNECTED, + content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED, NotificationService::AllSources()); } @@ -195,7 +195,7 @@ mach_port_t MachBroker::TaskForPid(base::ProcessHandle pid) const { return it->second.mach_task_; } -void MachBroker::Observe(NotificationType type, +void MachBroker::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { // TODO(rohitrao): These notifications do not always carry the proper PIDs, @@ -203,12 +203,12 @@ void MachBroker::Observe(NotificationType type, // way to listen for child process deaths. http://crbug.com/55734 base::ProcessHandle handle = 0; switch (type.value) { - case NotificationType::RENDERER_PROCESS_CLOSED: - case NotificationType::RENDERER_PROCESS_TERMINATED: + case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: + case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: handle = Source<RenderProcessHost>(source)->GetHandle(); break; - case NotificationType::CHILD_PROCESS_CRASHED: - case NotificationType::CHILD_PROCESS_HOST_DISCONNECTED: + case content::NOTIFICATION_CHILD_PROCESS_CRASHED: + case content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED: handle = Details<ChildProcessInfo>(details)->handle(); break; default: diff --git a/content/browser/mach_broker_mac.h b/content/browser/mach_broker_mac.h index da38162..6efeab4 100644 --- a/content/browser/mach_broker_mac.h +++ b/content/browser/mach_broker_mac.h @@ -80,7 +80,7 @@ class MachBroker : public base::ProcessMetrics::PortProvider, virtual mach_port_t TaskForPid(base::ProcessHandle process) const; // Implement |NotificationObserver|. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); private: diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc index 52bb519..d090917 100644 --- a/content/browser/plugin_service.cc +++ b/content/browser/plugin_service.cc @@ -20,9 +20,9 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/resource_context.h" +#include "content/common/content_notification_types.h" #include "content/common/content_switches.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "content/common/pepper_plugin_registry.h" #include "content/common/plugin_messages.h" #include "content/common/view_messages.h" @@ -102,7 +102,7 @@ PluginService::PluginService() #elif defined(OS_MACOSX) // We need to know when the browser comes forward so we can bring modal plugin // windows forward too. - registrar_.Add(this, NotificationType::APP_ACTIVATED, + registrar_.Add(this, content::NOTIFICATION_APP_ACTIVATED, NotificationService::AllSources()); #elif defined(OS_POSIX) // The FilePathWatcher produces too many false positives on MacOS (access time @@ -134,10 +134,10 @@ PluginService::PluginService() file_watchers_.push_back(watcher); } #endif - registrar_.Add(this, NotificationType::PLUGIN_ENABLE_STATUS_CHANGED, + registrar_.Add(this, content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, NotificationService::AllSources()); registrar_.Add(this, - NotificationType::RENDERER_PROCESS_CLOSED, + content::NOTIFICATION_RENDERER_PROCESS_CLOSED, NotificationService::AllSources()); } @@ -390,24 +390,24 @@ void PluginService::OnWaitableEventSignaled( #endif // defined(OS_WIN) } -void PluginService::Observe(NotificationType type, +void PluginService::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { + switch (type) { #if defined(OS_MACOSX) - case NotificationType::APP_ACTIVATED: { + case content::NOTIFICATION_APP_ACTIVATED: { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableFunction(&NotifyPluginsOfActivation)); break; } #endif - case NotificationType::PLUGIN_ENABLE_STATUS_CHANGED: { + case content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED: { webkit::npapi::PluginList::Singleton()->RefreshPlugins(); PurgePluginListCache(false); break; } - case NotificationType::RENDERER_PROCESS_CLOSED: { + case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { int render_process_id = Source<RenderProcessHost>(source).ptr()->id(); base::AutoLock auto_lock(overridden_plugins_lock_); diff --git a/content/browser/plugin_service.h b/content/browser/plugin_service.h index 399055e..975d815 100644 --- a/content/browser/plugin_service.h +++ b/content/browser/plugin_service.h @@ -130,7 +130,7 @@ class PluginService virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); // NotificationObserver implementation - virtual void Observe(NotificationType type, const NotificationSource& source, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); void RegisterPepperPlugins(); diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc index b291d53..a50c607 100644 --- a/content/browser/renderer_host/browser_render_process_host.cc +++ b/content/browser/renderer_host/browser_render_process_host.cc @@ -812,7 +812,7 @@ void BrowserRenderProcessHost::OnChannelError() { RendererClosedDetails details(status, exit_code, is_extension_process_); NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_CLOSED, + content::NOTIFICATION_RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this), Details<RendererClosedDetails>(&details)); @@ -842,7 +842,7 @@ void BrowserRenderProcessHost::OnShutdownRequest() { // Notify any tabs that might have swapped out renderers from this process. // They should not attempt to swap them back in. NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_CLOSING, + content::NOTIFICATION_RENDERER_PROCESS_CLOSING, Source<RenderProcessHost>(this), NotificationService::NoDetails()); Send(new ChildProcessMsg_Shutdown()); @@ -896,7 +896,7 @@ void BrowserRenderProcessHost::OnProcessLaunched() { // was after, we can end up executing JavaScript before the initialization // happens. NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_CREATED, + content::NOTIFICATION_RENDERER_PROCESS_CREATED, Source<RenderProcessHost>(this), NotificationService::NoDetails()); while (!queued_messages_.empty()) { diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index f58444f..f942e04 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -130,7 +130,7 @@ void RenderProcessHost::Release(int listener_id) { // When no other owners of this object, we can delete ourselves if (listeners_.IsEmpty()) { NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_TERMINATED, + content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, Source<RenderProcessHost>(this), NotificationService::NoDetails()); MessageLoop::current()->DeleteSoon(FROM_HERE, this); deleting_soon_ = true; diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 0e5f66b..37bf2bd 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -31,12 +31,12 @@ #include "content/browser/user_metrics.h" #include "content/common/bindings_policy.h" #include "content/common/content_constants.h" +#include "content/common/content_notification_types.h" #include "content/common/desktop_notification_messages.h" #include "content/common/drag_messages.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "content/common/result_codes.h" #include "content/common/swapped_out_messages.h" #include "content/common/url_constants.h" @@ -116,7 +116,7 @@ RenderViewHost::RenderViewHost(SiteInstance* instance, content::GetContentClient()->browser()->RenderViewHostCreated(this); NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CREATED, + content::NOTIFICATION_RENDER_VIEW_HOST_CREATED, Source<RenderViewHost>(this), NotificationService::NoDetails()); } @@ -126,7 +126,7 @@ RenderViewHost::~RenderViewHost() { RenderViewHostObserver, observers_, RenderViewHostDestruction()); NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_DELETED, + content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, Source<RenderViewHost>(this), NotificationService::NoDetails()); @@ -354,7 +354,7 @@ void RenderViewHost::ClosePage() { // TODO(creis): Should this be moved to Shutdown? It may not be called for // RenderViewHosts that have been swapped out. NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW, + content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW, Source<RenderViewHost>(this), NotificationService::NoDetails()); @@ -1051,7 +1051,7 @@ void RenderViewHost::OnUpdateDragCursor(WebDragOperation current_op) { void RenderViewHost::OnTargetDropACK() { NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK, + content::NOTIFICATION_RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK, Source<RenderViewHost>(this), NotificationService::NoDetails()); } @@ -1248,7 +1248,7 @@ void RenderViewHost::OnAccessibilityNotifications( } NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, + content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, Source<RenderViewHost>(this), NotificationService::NoDetails()); } @@ -1265,7 +1265,7 @@ void RenderViewHost::OnScriptEvalResponse(int id, const ListValue& result) { } std::pair<int, Value*> details(id, result_value); NotificationService::current()->Notify( - NotificationType::EXECUTE_JAVASCRIPT_RESULT, + content::NOTIFICATION_EXECUTE_JAVASCRIPT_RESULT, Source<RenderViewHost>(this), Details<std::pair<int, Value*> >(&details)); } diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc index 116dbec..4d22de0 100644 --- a/content/browser/renderer_host/render_view_host_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_browsertest.cc @@ -26,7 +26,7 @@ class ExecuteNotificationObserver : public NotificationObserver { public: ExecuteNotificationObserver() : id_(0) {} - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { id_ = (static_cast<Details<ExecuteDetailType > >(details))->first; @@ -65,7 +65,7 @@ class RenderViewHostTest : public InProcessBrowserTest { ExecuteNotificationObserver observer; ui_test_utils::RegisterAndWait( out_result, - NotificationType::EXECUTE_JAVASCRIPT_RESULT, + content::NOTIFICATION_EXECUTE_JAVASCRIPT_RESULT, Source<RenderViewHost>(rvh)); EXPECT_EQ(execute_id, out_result->id()); ASSERT_TRUE(out_result->value()); diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc index 8a9ebce..7f36823 100644 --- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc @@ -11,10 +11,10 @@ #include "chrome/test/ui_test_utils.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" #include "net/base/net_util.h" #include "net/test/test_server.h" diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index 4e01606..00df753 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -249,7 +249,7 @@ void RenderWidgetHost::WasHidden() { bool is_visible = false; NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_VISIBILITY_CHANGED, + content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, Source<RenderWidgetHost>(this), Details<bool>(&is_visible)); } @@ -284,7 +284,7 @@ void RenderWidgetHost::WasRestored() { bool is_visible = true; NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_VISIBILITY_CHANGED, + content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, Source<RenderWidgetHost>(this), Details<bool>(&is_visible)); @@ -757,7 +757,7 @@ void RenderWidgetHost::ImeCancelComposition() { void RenderWidgetHost::Destroy() { NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_HOST_DESTROYED, + content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); @@ -785,7 +785,7 @@ void RenderWidgetHost::CheckRendererIsUnresponsive() { // OK, looks like we have a hung renderer! NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_HANG, + content::NOTIFICATION_RENDERER_PROCESS_HANG, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); is_unresponsive_ = true; @@ -858,7 +858,7 @@ void RenderWidgetHost::OnMsgPaintAtSizeAck(int tag, const gfx::Size& size) { PaintAtSizeAckDetails details = {tag, size}; gfx::Size size_details = size; NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, Source<RenderWidgetHost>(this), Details<PaintAtSizeAckDetails>(&details)); } @@ -869,7 +869,7 @@ void RenderWidgetHost::OnMsgUpdateRect( TimeTicks paint_start = TimeTicks::Now(); NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_HOST_WILL_PAINT, + content::NOTIFICATION_RENDER_WIDGET_HOST_WILL_PAINT, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); @@ -966,7 +966,7 @@ void RenderWidgetHost::OnMsgUpdateRect( } NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_HOST_DID_PAINT, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); @@ -1024,7 +1024,7 @@ void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) { } // This is used only for testing. NotificationService::current()->Notify( - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK, Source<RenderWidgetHost>(this), Details<int>(&type)); } diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 17c8108..42a3cf0 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -219,11 +219,11 @@ class MockPaintingObserver : public NotificationObserver { size_ = size; } - void Observe(NotificationType type, + void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { if (type == - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK) { + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK) { RenderWidgetHost::PaintAtSizeAckDetails* size_ack_details = Details<RenderWidgetHost::PaintAtSizeAckDetails>(details).ptr(); WidgetDidReceivePaintAtSizeAck( @@ -574,7 +574,7 @@ TEST_F(RenderWidgetHostTest, PaintAtSize) { MockPaintingObserver observer; registrar.Add( &observer, - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, Source<RenderWidgetHost>(host_.get())); host_->OnMsgPaintAtSizeAck(kPaintAtSizeTag, gfx::Size(20, 30)); diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index 2fcdca3..cefab8b 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -1655,7 +1655,7 @@ void ResourceDispatcherHost::NotifyResponseStarted(net::URLRequest* request, BrowserThread::UI, FROM_HERE, NewRunnableFunction( &ResourceDispatcherHost::NotifyOnUI<ResourceRequestDetails>, - NotificationType::RESOURCE_RESPONSE_STARTED, + content::NOTIFICATION_RESOURCE_RESPONSE_STARTED, render_process_id, render_view_id, detail)); } @@ -1673,12 +1673,12 @@ void ResourceDispatcherHost::NotifyReceivedRedirect(net::URLRequest* request, BrowserThread::UI, FROM_HERE, NewRunnableFunction( &ResourceDispatcherHost::NotifyOnUI<ResourceRedirectDetails>, - NotificationType::RESOURCE_RECEIVED_REDIRECT, + content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, render_process_id, render_view_id, detail)); } template <class T> -void ResourceDispatcherHost::NotifyOnUI(NotificationType type, +void ResourceDispatcherHost::NotifyOnUI(int type, int render_process_id, int render_view_id, T* detail) { diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h index ee476d0..35f5106 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.h +++ b/content/browser/renderer_host/resource_dispatcher_host.h @@ -23,7 +23,7 @@ #include "base/timer.h" #include "content/browser/renderer_host/resource_queue.h" #include "content/common/child_process_info.h" -#include "content/common/notification_type.h" +#include "content/common/content_notification_types.h" #include "ipc/ipc_message.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_type.h" @@ -407,7 +407,7 @@ class ResourceDispatcherHost : public net::URLRequest::Delegate { // Sends the given notification on the UI thread. The RenderViewHost's // controller is used as the source. template <class T> - static void NotifyOnUI(NotificationType type, + static void NotifyOnUI(int type, int render_process_id, int render_view_id, T* detail); diff --git a/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc b/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc index 846ca3b..14be3f5 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc +++ b/content/browser/renderer_host/resource_dispatcher_host_browsertest.cc @@ -5,10 +5,10 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/notification_type.h" #include "net/test/test_server.h" class ResourceDispatcherHostBrowserTest : public InProcessBrowserTest { @@ -30,7 +30,7 @@ bool ResourceDispatcherHostBrowserTest::GetPopupTitle(const GURL& url, ui_test_utils::NavigateToURL(browser(), url); ui_test_utils::WindowedNotificationObserver observer( - NotificationType::BROWSER_WINDOW_READY, + chrome::NOTIFICATION_BROWSER_WINDOW_READY, NotificationService::AllSources()); // Create dynamic popup. diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc index 53caf57..d69690e 100644 --- a/content/browser/site_instance.cc +++ b/content/browser/site_instance.cc @@ -37,7 +37,7 @@ SiteInstance::SiteInstance(BrowsingInstance* browsing_instance) has_site_(false) { DCHECK(browsing_instance); - registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, + registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, NotificationService::AllSources()); } @@ -232,10 +232,10 @@ RenderProcessHost::Type SiteInstance::GetRendererType() { return RendererTypeForURL(site_); } -void SiteInstance::Observe(NotificationType type, +void SiteInstance::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); + DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); if (rph == process_) process_ = NULL; diff --git a/content/browser/site_instance.h b/content/browser/site_instance.h index ebe1b3e..4d3692c 100644 --- a/content/browser/site_instance.h +++ b/content/browser/site_instance.h @@ -166,7 +166,7 @@ class SiteInstance : public base::RefCounted<SiteInstance>, private: // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/ssl/ssl_client_auth_handler.cc b/content/browser/ssl/ssl_client_auth_handler.cc index 49e852f..e179f9a 100644 --- a/content/browser/ssl/ssl_client_auth_handler.cc +++ b/content/browser/ssl/ssl_client_auth_handler.cc @@ -58,7 +58,7 @@ void SSLClientAuthHandler::CertificateSelected(net::X509Certificate* cert) { SSLClientAuthNotificationDetails details(cert_request_info_, cert); NotificationService* service = NotificationService::current(); - service->Notify(NotificationType::SSL_CLIENT_AUTH_CERT_SELECTED, + service->Notify(content::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED, Source<SSLClientAuthHandler>(this), Details<SSLClientAuthNotificationDetails>(&details)); @@ -111,12 +111,12 @@ SSLClientAuthObserver::~SSLClientAuthObserver() { } void SSLClientAuthObserver::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { VLOG(1) << "SSLClientAuthObserver::Observe " << this << " " << handler_.get(); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(type == NotificationType::SSL_CLIENT_AUTH_CERT_SELECTED); + DCHECK(type == content::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED); if (Source<SSLClientAuthHandler>(source).ptr() == handler_.get()) { VLOG(1) << "got notification from ourself " << handler_.get(); @@ -138,9 +138,9 @@ void SSLClientAuthObserver::Observe( void SSLClientAuthObserver::StartObserving() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - notification_registrar_.Add(this, - NotificationType::SSL_CLIENT_AUTH_CERT_SELECTED, - NotificationService::AllSources()); + notification_registrar_.Add( + this, content::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED, + NotificationService::AllSources()); } void SSLClientAuthObserver::StopObserving() { diff --git a/content/browser/ssl/ssl_client_auth_handler.h b/content/browser/ssl/ssl_client_auth_handler.h index 0b2e9cb..404b8d2 100644 --- a/content/browser/ssl/ssl_client_auth_handler.h +++ b/content/browser/ssl/ssl_client_auth_handler.h @@ -84,7 +84,7 @@ class SSLClientAuthObserver : public NotificationObserver { virtual void OnCertSelectedByNotification() = 0; // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/ssl/ssl_manager.cc b/content/browser/ssl/ssl_manager.cc index 0fd022c..96578a0 100644 --- a/content/browser/ssl/ssl_manager.cc +++ b/content/browser/ssl/ssl_manager.cc @@ -47,7 +47,7 @@ void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, // static void SSLManager::NotifySSLInternalStateChanged() { NotificationService::current()->Notify( - NotificationType::SSL_INTERNAL_STATE_CHANGED, + content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, NotificationService::AllSources(), NotificationService::NoDetails()); } @@ -97,15 +97,15 @@ SSLManager::SSLManager(NavigationController* controller) DCHECK(controller_); // Subscribe to various notifications. - registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, + registrar_.Add(this, content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, Source<NavigationController>(controller_)); - registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED, + registrar_.Add(this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED, Source<RenderViewHostDelegate>(controller_->tab_contents())); - registrar_.Add(this, NotificationType::RESOURCE_RECEIVED_REDIRECT, + registrar_.Add(this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, Source<RenderViewHostDelegate>(controller_->tab_contents())); - registrar_.Add(this, NotificationType::LOAD_FROM_MEMORY_CACHE, + registrar_.Add(this, content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, Source<NavigationController>(controller_)); - registrar_.Add(this, NotificationType::SSL_INTERNAL_STATE_CHANGED, + registrar_.Add(this, content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED, NotificationService::AllSources()); } @@ -158,26 +158,26 @@ bool SSLManager::ProcessedSSLErrorFromRequest() const { return net::IsCertStatusError(entry->ssl().cert_status()); } -void SSLManager::Observe(NotificationType type, +void SSLManager::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { // Dispatch by type. - switch (type.value) { - case NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR: + switch (type) { + case content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR: // Do nothing. break; - case NotificationType::RESOURCE_RESPONSE_STARTED: + case content::NOTIFICATION_RESOURCE_RESPONSE_STARTED: DidStartResourceResponse(Details<ResourceRequestDetails>(details).ptr()); break; - case NotificationType::RESOURCE_RECEIVED_REDIRECT: + case content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: DidReceiveResourceRedirect( Details<ResourceRedirectDetails>(details).ptr()); break; - case NotificationType::LOAD_FROM_MEMORY_CACHE: + case content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE: DidLoadFromMemoryCache( Details<LoadFromMemoryCacheDetails>(details).ptr()); break; - case NotificationType::SSL_INTERNAL_STATE_CHANGED: + case content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED: DidChangeSSLInternalState(); break; default: @@ -240,7 +240,7 @@ void SSLManager::UpdateEntry(NavigationEntry* entry) { if (!entry->ssl().Equals(original_ssl_status)) { NotificationService::current()->Notify( - NotificationType::SSL_VISIBLE_STATE_CHANGED, + content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, Source<NavigationController>(controller_), NotificationService::NoDetails()); } diff --git a/content/browser/ssl/ssl_manager.h b/content/browser/ssl/ssl_manager.h index 8ceeddf..6961c20 100644 --- a/content/browser/ssl/ssl_manager.h +++ b/content/browser/ssl/ssl_manager.h @@ -92,7 +92,7 @@ class SSLManager : public NotificationObserver { // the security UI when the main frame navigates to a new URL. // // Called on the UI thread. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 07c661b..307074a 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -204,7 +204,7 @@ void InterstitialPage::Show() { // NOTIFY_TAB_CONTENTS_DESTROYED as at that point the RenderViewHost has // already been destroyed. notification_registrar_.Add( - this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, + this, content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, Source<RenderWidgetHost>(tab_->render_view_host())); // Update the tab_to_interstitial_page_ map. @@ -232,11 +232,12 @@ void InterstitialPage::Show() { EscapePath(GetHTMLContents()); render_view_host_->NavigateToURL(GURL(data_url)); - notification_registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED, + notification_registrar_.Add(this, + content::NOTIFICATION_TAB_CONTENTS_DESTROYED, Source<TabContents>(tab_)); - notification_registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, + notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, Source<NavigationController>(&tab_->controller())); - notification_registrar_.Add(this, NotificationType::NAV_ENTRY_PENDING, + notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, Source<NavigationController>(&tab_->controller())); } @@ -271,11 +272,11 @@ void InterstitialPage::Hide() { delete this; } -void InterstitialPage::Observe(NotificationType type, +void InterstitialPage::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::NAV_ENTRY_PENDING: + switch (type) { + case content::NOTIFICATION_NAV_ENTRY_PENDING: // We are navigating away from the interstitial (the user has typed a URL // in the location bar or clicked a bookmark). Make sure clicking on the // interstitial will have no effect. Also cancel any blocked requests @@ -288,7 +289,7 @@ void InterstitialPage::Observe(NotificationType type, Disable(); TakeActionOnResourceDispatcher(CANCEL); break; - case NotificationType::RENDER_WIDGET_HOST_DESTROYED: + case content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED: if (action_taken_ == NO_ACTION) { // The RenderViewHost is being destroyed (as part of the tab being // closed), make sure we clear the blocked requests. @@ -298,8 +299,8 @@ void InterstitialPage::Observe(NotificationType type, TakeActionOnResourceDispatcher(CANCEL); } break; - case NotificationType::TAB_CONTENTS_DESTROYED: - case NotificationType::NAV_ENTRY_COMMITTED: + case content::NOTIFICATION_TAB_CONTENTS_DESTROYED: + case content::NOTIFICATION_NAV_ENTRY_COMMITTED: if (action_taken_ == NO_ACTION) { // We are navigating away from the interstitial or closing a tab with an // interstitial. Default to DontProceed(). We don't just call Hide as @@ -358,7 +359,7 @@ void InterstitialPage::DidNavigate( // a callback to |tab_| testing if an interstitial page is showing before // hiding the bookmark bar. NotificationService::current()->Notify( - NotificationType::INTERSTITIAL_ATTACHED, + content::NOTIFICATION_INTERSTITIAL_ATTACHED, Source<TabContents>(tab_), NotificationService::NoDetails()); diff --git a/content/browser/tab_contents/interstitial_page.h b/content/browser/tab_contents/interstitial_page.h index 78139f6..2719274 100644 --- a/content/browser/tab_contents/interstitial_page.h +++ b/content/browser/tab_contents/interstitial_page.h @@ -115,7 +115,7 @@ class InterstitialPage : public NotificationObserver, protected: // NotificationObserver method: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index 0d1a9ac..1e28654 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -42,7 +42,7 @@ void NotifyPrunedEntries(NavigationController* nav_controller, details.from_front = from_front; details.count = count; NotificationService::current()->Notify( - NotificationType::NAV_LIST_PRUNED, + content::NOTIFICATION_NAV_LIST_PRUNED, Source<NavigationController>(nav_controller), Details<content::PrunedDetails>(&details)); } @@ -133,7 +133,7 @@ NavigationController::~NavigationController() { DiscardNonCommittedEntriesInternal(); NotificationService::current()->Notify( - NotificationType::TAB_CLOSED, + content::NOTIFICATION_TAB_CLOSED, Source<NavigationController>(this), NotificationService::NoDetails()); } @@ -183,7 +183,7 @@ void NavigationController::ReloadInternal(bool check_for_repost, // they really want to do this. If they do, the dialog will call us back // with check_for_repost = false. NotificationService::current()->Notify( - NotificationType::REPOST_WARNING_SHOWN, + content::NOTIFICATION_REPOST_WARNING_SHOWN, Source<NavigationController>(this), NotificationService::NoDetails()); @@ -270,7 +270,7 @@ void NavigationController::LoadEntry(NavigationEntry* entry) { DiscardNonCommittedEntriesInternal(); pending_entry_ = entry; NotificationService::current()->Notify( - NotificationType::NAV_ENTRY_PENDING, + content::NOTIFICATION_NAV_ENTRY_PENDING, Source<NavigationController>(this), NotificationService::NoDetails()); NavigateToPendingEntry(NO_RELOAD); @@ -1061,7 +1061,7 @@ void NavigationController::NotifyNavigationEntryCommitted( tab_contents_->NotifyNavigationStateChanged(kInvalidateAll); NotificationService::current()->Notify( - NotificationType::NAV_ENTRY_COMMITTED, + content::NOTIFICATION_NAV_ENTRY_COMMITTED, Source<NavigationController>(this), notification_details); } @@ -1092,7 +1092,8 @@ void NavigationController::NotifyEntryChanged(const NavigationEntry* entry, content::EntryChangedDetails det; det.changed_entry = entry; det.index = index; - NotificationService::current()->Notify(NotificationType::NAV_ENTRY_CHANGED, + NotificationService::current()->Notify( + content::NOTIFICATION_NAV_ENTRY_CHANGED, Source<NavigationController>(this), Details<content::EntryChangedDetails>(&det)); } diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc index 08799b4..96335bc 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_unittest.cc @@ -43,11 +43,11 @@ class NavigationControllerTest : public RenderViewHostTestHarness { void RegisterForAllNavNotifications(TestNotificationTracker* tracker, NavigationController* controller) { - tracker->ListenFor(NotificationType::NAV_ENTRY_COMMITTED, + tracker->ListenFor(content::NOTIFICATION_NAV_ENTRY_COMMITTED, Source<NavigationController>(controller)); - tracker->ListenFor(NotificationType::NAV_LIST_PRUNED, + tracker->ListenFor(content::NOTIFICATION_NAV_LIST_PRUNED, Source<NavigationController>(controller)); - tracker->ListenFor(NotificationType::NAV_ENTRY_CHANGED, + tracker->ListenFor(content::NOTIFICATION_NAV_ENTRY_CHANGED, Source<NavigationController>(controller)); } @@ -110,7 +110,7 @@ TEST_F(NavigationControllerTest, LoadURL) { rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // The load should now be committed. EXPECT_EQ(controller().entry_count(), 1); @@ -141,7 +141,7 @@ TEST_F(NavigationControllerTest, LoadURL) { rvh()->SendShouldCloseACK(true); contents()->pending_rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // The load should now be committed. EXPECT_EQ(controller().entry_count(), 2); @@ -168,13 +168,13 @@ TEST_F(NavigationControllerTest, LoadURL_SamePage) { EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().LoadURL(url1, GURL(), PageTransition::TYPED); EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // We should not have produced a new session history entry. EXPECT_EQ(controller().entry_count(), 1); @@ -198,7 +198,7 @@ TEST_F(NavigationControllerTest, LoadURL_Discarded) { EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().LoadURL(url2, GURL(), PageTransition::TYPED); controller().DiscardNonCommittedEntries(); @@ -226,7 +226,7 @@ TEST_F(NavigationControllerTest, LoadURL_NoPending) { PageTransition::TYPED); rvh()->SendNavigate(0, kExistingURL1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Do a new navigation without making a pending one. const GURL kNewURL("http://see"); @@ -235,7 +235,7 @@ TEST_F(NavigationControllerTest, LoadURL_NoPending) { // There should no longer be any pending entry, and the third navigation we // just made should be committed. EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(-1, controller().pending_entry_index()); EXPECT_EQ(1, controller().last_committed_entry_index()); EXPECT_EQ(kNewURL, controller().GetActiveEntry()->url()); @@ -255,7 +255,7 @@ TEST_F(NavigationControllerTest, LoadURL_NewPending) { PageTransition::TYPED); rvh()->SendNavigate(0, kExistingURL1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Make a pending entry to somewhere new. const GURL kExistingURL2("http://bee"); @@ -271,7 +271,7 @@ TEST_F(NavigationControllerTest, LoadURL_NewPending) { // There should no longer be any pending entry, and the third navigation we // just made should be committed. EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(-1, controller().pending_entry_index()); EXPECT_EQ(1, controller().last_committed_entry_index()); EXPECT_EQ(kNewURL, controller().GetActiveEntry()->url()); @@ -290,14 +290,14 @@ TEST_F(NavigationControllerTest, LoadURL_ExistingPending) { PageTransition::TYPED); rvh()->SendNavigate(0, kExistingURL1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); const GURL kExistingURL2("http://foo/bee"); controller().LoadURL(kExistingURL2, GURL(), PageTransition::TYPED); rvh()->SendNavigate(1, kExistingURL2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Now make a pending back/forward navigation. The zeroth entry should be // pending. @@ -314,7 +314,7 @@ TEST_F(NavigationControllerTest, LoadURL_ExistingPending) { // There should no longer be any pending entry, and the third navigation we // just made should be committed. EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(-1, controller().pending_entry_index()); EXPECT_EQ(2, controller().last_committed_entry_index()); EXPECT_EQ(kNewURL, controller().GetActiveEntry()->url()); @@ -332,13 +332,13 @@ TEST_F(NavigationControllerTest, LoadURL_BackPreemptsPending) { controller().LoadURL(kExistingURL1, GURL(), PageTransition::TYPED); rvh()->SendNavigate(0, kExistingURL1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); const GURL kExistingURL2("http://foo/bee"); controller().LoadURL(kExistingURL2, GURL(), PageTransition::TYPED); rvh()->SendNavigate(1, kExistingURL2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Now make a pending new navigation. const GURL kNewURL("http://foo/see"); @@ -353,7 +353,7 @@ TEST_F(NavigationControllerTest, LoadURL_BackPreemptsPending) { // There should no longer be any pending entry, and the back navigation we // just made should be committed. EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(-1, controller().pending_entry_index()); EXPECT_EQ(0, controller().last_committed_entry_index()); EXPECT_EQ(kExistingURL1, controller().GetActiveEntry()->url()); @@ -505,7 +505,7 @@ TEST_F(NavigationControllerTest, Reload) { EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().Reload(true); EXPECT_EQ(0U, notifications.size()); @@ -521,7 +521,7 @@ TEST_F(NavigationControllerTest, Reload) { rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Now the reload is committed. EXPECT_EQ(controller().entry_count(), 1); @@ -544,14 +544,14 @@ TEST_F(NavigationControllerTest, Reload_GeneratesNewPage) { controller().LoadURL(url1, GURL(), PageTransition::TYPED); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().Reload(true); EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Now the reload is committed. EXPECT_EQ(controller().entry_count(), 2); @@ -571,12 +571,12 @@ TEST_F(NavigationControllerTest, Back) { const GURL url1("http://foo1"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); const GURL url2("http://foo2"); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoBack(); EXPECT_EQ(0U, notifications.size()); @@ -592,7 +592,7 @@ TEST_F(NavigationControllerTest, Back) { rvh()->SendNavigate(0, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // The back navigation completed successfully. EXPECT_EQ(controller().entry_count(), 2); @@ -616,12 +616,12 @@ TEST_F(NavigationControllerTest, Back_GeneratesNewPage) { controller().LoadURL(url1, GURL(), PageTransition::TYPED); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().LoadURL(url2, GURL(), PageTransition::TYPED); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoBack(); EXPECT_EQ(0U, notifications.size()); @@ -637,7 +637,7 @@ TEST_F(NavigationControllerTest, Back_GeneratesNewPage) { rvh()->SendNavigate(2, url3); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // The back navigation resulted in a completely new navigation. // TODO(darin): perhaps this behavior will be confusing to users? @@ -662,12 +662,12 @@ TEST_F(NavigationControllerTest, Back_NewPending) { // First navigate two places so we have some back history. rvh()->SendNavigate(0, kUrl1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // controller().LoadURL(kUrl2, PageTransition::TYPED); rvh()->SendNavigate(1, kUrl2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Now start a new pending navigation and go back before it commits. controller().LoadURL(kUrl3, GURL(), PageTransition::TYPED); @@ -738,16 +738,16 @@ TEST_F(NavigationControllerTest, Forward) { rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoBack(); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoForward(); @@ -762,7 +762,7 @@ TEST_F(NavigationControllerTest, Forward) { rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // The forward navigation completed successfully. EXPECT_EQ(controller().entry_count(), 2); @@ -785,15 +785,15 @@ TEST_F(NavigationControllerTest, Forward_GeneratesNewPage) { rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoBack(); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); controller().GoForward(); EXPECT_EQ(0U, notifications.size()); @@ -809,8 +809,8 @@ TEST_F(NavigationControllerTest, Forward_GeneratesNewPage) { rvh()->SendNavigate(2, url3); EXPECT_TRUE(notifications.Check2AndReset( - NotificationType::NAV_LIST_PRUNED, - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_LIST_PRUNED, + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(controller().entry_count(), 2); EXPECT_EQ(controller().last_committed_entry_index(), 1); @@ -836,7 +836,7 @@ TEST_F(NavigationControllerTest, Redirect) { EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Second request controller().LoadURL(url1, GURL(), PageTransition::TYPED); @@ -861,7 +861,7 @@ TEST_F(NavigationControllerTest, Redirect) { EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.type == NavigationType::SAME_PAGE); EXPECT_EQ(controller().entry_count(), 1); @@ -892,7 +892,7 @@ TEST_F(NavigationControllerTest, PostThenRedirect) { EXPECT_EQ(0U, notifications.size()); rvh()->SendNavigate(0, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Second request controller().LoadURL(url1, GURL(), PageTransition::TYPED); @@ -917,7 +917,7 @@ TEST_F(NavigationControllerTest, PostThenRedirect) { EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.type == NavigationType::SAME_PAGE); EXPECT_EQ(controller().entry_count(), 1); @@ -963,7 +963,7 @@ TEST_F(NavigationControllerTest, ImmediateRedirect) { EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.type == NavigationType::NEW_PAGE); EXPECT_EQ(controller().entry_count(), 1); @@ -986,7 +986,7 @@ TEST_F(NavigationControllerTest, NewSubframe) { const GURL url1("http://foo1"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); const GURL url2("http://foo2"); ViewHostMsg_FrameNavigate_Params params; @@ -1001,7 +1001,7 @@ TEST_F(NavigationControllerTest, NewSubframe) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(url1, details.previous_url); EXPECT_FALSE(details.is_in_page); EXPECT_FALSE(details.is_main_frame); @@ -1047,7 +1047,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) { const GURL url1("http://foo1"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); const GURL url2("http://foo2"); ViewHostMsg_FrameNavigate_Params params; @@ -1077,7 +1077,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { const GURL url1("http://foo1"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // First manual subframe navigation. const GURL url2("http://foo2"); @@ -1094,7 +1094,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(2, controller().entry_count()); // Second manual subframe navigation should also make a new entry. @@ -1103,7 +1103,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { params.url = url3; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(3, controller().entry_count()); EXPECT_EQ(2, controller().GetCurrentEntryIndex()); @@ -1113,7 +1113,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { params.page_id = 1; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(3, controller().entry_count()); EXPECT_EQ(1, controller().GetCurrentEntryIndex()); @@ -1123,7 +1123,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { params.page_id = 0; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(3, controller().entry_count()); EXPECT_EQ(0, controller().GetCurrentEntryIndex()); } @@ -1137,11 +1137,11 @@ TEST_F(NavigationControllerTest, LinkClick) { rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); rvh()->SendNavigate(1, url2); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // Should not have produced a new session history entry. EXPECT_EQ(controller().entry_count(), 2); @@ -1161,7 +1161,7 @@ TEST_F(NavigationControllerTest, InPage) { const GURL url1("http://foo"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // First navigation. const GURL url2("http://foo#a"); @@ -1178,7 +1178,7 @@ TEST_F(NavigationControllerTest, InPage) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.is_in_page); EXPECT_FALSE(details.did_replace_entry); EXPECT_EQ(2, controller().entry_count()); @@ -1190,7 +1190,7 @@ TEST_F(NavigationControllerTest, InPage) { back_params.page_id = 0; EXPECT_TRUE(controller().RendererDidNavigate(back_params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // is_in_page is false in that case but should be true. // See comment in AreURLsInPageNavigation() in navigation_controller.cc // EXPECT_TRUE(details.is_in_page); @@ -1205,7 +1205,7 @@ TEST_F(NavigationControllerTest, InPage) { forward_params.page_id = 1; EXPECT_TRUE(controller().RendererDidNavigate(forward_params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.is_in_page); EXPECT_EQ(2, controller().entry_count()); EXPECT_EQ(1, controller().GetCurrentEntryIndex()); @@ -1230,7 +1230,7 @@ TEST_F(NavigationControllerTest, InPage) { notifications.Reset(); EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_FALSE(details.is_in_page); } @@ -1242,7 +1242,7 @@ TEST_F(NavigationControllerTest, InPage_Replace) { const GURL url1("http://foo"); rvh()->SendNavigate(0, url1); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); // First navigation. const GURL url2("http://foo#a"); @@ -1259,8 +1259,8 @@ TEST_F(NavigationControllerTest, InPage_Replace) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check2AndReset( - NotificationType::NAV_LIST_PRUNED, - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_LIST_PRUNED, + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.is_in_page); EXPECT_TRUE(details.did_replace_entry); EXPECT_EQ(1, controller().entry_count()); @@ -1281,7 +1281,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { const GURL url("http://foo/"); rvh()->SendNavigate(0, url); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); } // Navigate to a new page. @@ -1290,7 +1290,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { rvh()->SendNavigate(1, url); controller().DocumentLoadedInFrame(); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); } // Navigate within the page. @@ -1310,8 +1310,8 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check2AndReset( - NotificationType::NAV_LIST_PRUNED, - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_LIST_PRUNED, + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_TRUE(details.is_in_page); EXPECT_TRUE(details.did_replace_entry); EXPECT_EQ(2, controller().entry_count()); @@ -1335,7 +1335,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, &details)); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_FALSE(details.is_in_page); EXPECT_EQ(3, controller().entry_count()); } @@ -1346,25 +1346,25 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { controller().GoBack(); rvh()->SendNavigate(1, url); EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::NAV_ENTRY_COMMITTED)); + content::NOTIFICATION_NAV_ENTRY_COMMITTED)); EXPECT_EQ(url, controller().GetActiveEntry()->url()); } } // NotificationObserver implementation used in verifying we've received the -// NotificationType::NAV_LIST_PRUNED method. +// content::NOTIFICATION_NAV_LIST_PRUNED method. class PrunedListener : public NotificationObserver { public: explicit PrunedListener(NavigationController* controller) : notification_count_(0) { - registrar_.Add(this, NotificationType::NAV_LIST_PRUNED, + registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, Source<NavigationController>(controller)); } - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::NAV_LIST_PRUNED) { + if (type == content::NOTIFICATION_NAV_LIST_PRUNED) { notification_count_++; details_ = *(Details<content::PrunedDetails>(details).ptr()); } diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 1a49d4d..7d2dc58 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -20,7 +20,7 @@ #include "content/common/content_client.h" #include "content/common/content_switches.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" +#include "content/common/content_notification_types.h" #include "content/common/url_constants.h" #include "content/common/view_messages.h" @@ -69,7 +69,7 @@ void RenderViewHostManager::Init(Profile* profile, GetControllerForRenderManager().session_storage_namespace()); // Keep track of renderer processes as they start to shut down. - registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSING, + registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSING, NotificationService::AllSources()); } @@ -114,7 +114,7 @@ RenderViewHost* RenderViewHostManager::Navigate(const NavigationEntry& entry) { details.new_host = render_view_host_; details.old_host = NULL; NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CHANGED, + content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, Source<NavigationController>( &delegate_->GetControllerForRenderManager()), Details<RenderViewHostSwitchedDetails>(&details)); @@ -314,11 +314,11 @@ void RenderViewHostManager::OnCrossSiteNavigationCanceled() { CancelPending(); } -void RenderViewHostManager::Observe(NotificationType type, +void RenderViewHostManager::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::RENDERER_PROCESS_CLOSING: + switch (type) { + case content::NOTIFICATION_RENDERER_PROCESS_CLOSING: RendererProcessClosing(Source<RenderProcessHost>(source).ptr()); break; @@ -621,7 +621,7 @@ void RenderViewHostManager::CommitPending() { details.new_host = render_view_host_; details.old_host = old_render_view_host; NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CHANGED, + content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, Source<NavigationController>(&delegate_->GetControllerForRenderManager()), Details<RenderViewHostSwitchedDetails>(&details)); @@ -842,7 +842,7 @@ void RenderViewHostManager::SwapInRenderViewHost(RenderViewHost* rvh) { details.new_host = render_view_host_; details.old_host = old_render_view_host; NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CHANGED, + content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, Source<NavigationController>(&delegate_->GetControllerForRenderManager()), Details<RenderViewHostSwitchedDetails>(&details)); diff --git a/content/browser/tab_contents/render_view_host_manager.h b/content/browser/tab_contents/render_view_host_manager.h index 6dc4d7d..cd6d865 100644 --- a/content/browser/tab_contents/render_view_host_manager.h +++ b/content/browser/tab_contents/render_view_host_manager.h @@ -174,7 +174,7 @@ class RenderViewHostManager virtual void OnCrossSiteNavigationCanceled(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc index 9b5883b..30e6605 100644 --- a/content/browser/tab_contents/render_view_host_manager_unittest.cc +++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc @@ -185,7 +185,7 @@ TEST_F(RenderViewHostManagerTest, Navigate) { SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get()); TestTabContents tab_contents(profile_.get(), instance); - notifications.ListenFor(NotificationType::RENDER_VIEW_HOST_CHANGED, + notifications.ListenFor(content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, Source<NavigationController>(&tab_contents.controller())); // Create. @@ -254,7 +254,7 @@ TEST_F(RenderViewHostManagerTest, Navigate) { // We should observe a notification. EXPECT_TRUE(notifications.Check1AndReset( - NotificationType::RENDER_VIEW_HOST_CHANGED)); + content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED)); } // Tests WebUI creation. diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index c2ca82d..6a58976 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -199,7 +199,7 @@ TabContents::TabContents(Profile* profile, view_->CreateView(base_tab_contents ? base_tab_contents->view()->GetContainerSize() : gfx::Size()); - registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, + registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, NotificationService::AllSources()); // Can only add observers after render_manager_.Init() is called, since that's @@ -228,7 +228,7 @@ TabContents::~TabContents() { // Notify any observer that have a reference on this tab contents. NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_DESTROYED, + content::NOTIFICATION_TAB_CONTENTS_DESTROYED, Source<TabContents>(this), NotificationService::NoDetails()); @@ -454,7 +454,7 @@ void TabContents::WasHidden() { } NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_HIDDEN, + content::NOTIFICATION_TAB_CONTENTS_HIDDEN, Source<TabContents>(this), NotificationService::NoDetails()); } @@ -889,7 +889,7 @@ void TabContents::OnDidFailProvisionalLoadWithError( details.set_error_code(error_code); NotificationService::current()->Notify( - NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, + content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, Source<NavigationController>(&controller_), Details<ProvisionalLoadDetails>(&details)); @@ -914,7 +914,7 @@ void TabContents::OnDidLoadResourceFromMemoryCache( cert_id, cert_status); NotificationService::current()->Notify( - NotificationType::LOAD_FROM_MEMORY_CACHE, + content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, Source<NavigationController>(&controller_), Details<LoadFromMemoryCacheDetails>(&details)); } @@ -974,7 +974,7 @@ void TabContents::OnUpdateZoomLimits(int minimum_percent, void TabContents::OnFocusedNodeChanged(bool is_editable_node) { NotificationService::current()->Notify( - NotificationType::FOCUS_CHANGED_IN_PAGE, + content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, Source<TabContents>(this), Details<const bool>(&is_editable_node)); } @@ -1002,8 +1002,8 @@ void TabContents::SetIsLoading(bool is_loading, delegate_->LoadingStateChanged(this); NotifyNavigationStateChanged(INVALIDATE_LOAD); - NotificationType type = is_loading ? NotificationType::LOAD_START : - NotificationType::LOAD_STOP; + int type = is_loading ? content::NOTIFICATION_LOAD_START : + content::NOTIFICATION_LOAD_STOP; NotificationDetails det = NotificationService::NoDetails(); if (details) det = Details<LoadNotificationDetails>(details); @@ -1195,7 +1195,7 @@ bool TabContents::UpdateTitleForEntry(NavigationEntry* entry, TitleUpdatedDetails details(entry, explicit_set); NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_TITLE_UPDATED, + content::NOTIFICATION_TAB_CONTENTS_TITLE_UPDATED, Source<TabContents>(this), Details<TitleUpdatedDetails>(&details)); @@ -1208,7 +1208,7 @@ void TabContents::NotifySwapped() { // pointer. See Bug 1230284. notify_disconnection_ = true; NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_SWAPPED, + content::NOTIFICATION_TAB_CONTENTS_SWAPPED, Source<TabContents>(this), NotificationService::NoDetails()); } @@ -1216,7 +1216,7 @@ void TabContents::NotifySwapped() { void TabContents::NotifyConnected() { notify_disconnection_ = true; NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_CONNECTED, + content::NOTIFICATION_TAB_CONTENTS_CONNECTED, Source<TabContents>(this), NotificationService::NoDetails()); } @@ -1227,7 +1227,7 @@ void TabContents::NotifyDisconnected() { notify_disconnection_ = false; NotificationService::current()->Notify( - NotificationType::TAB_CONTENTS_DISCONNECTED, + content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, Source<TabContents>(this), NotificationService::NoDetails()); } @@ -1255,7 +1255,7 @@ ViewType::Type TabContents::GetRenderViewType() const { void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, + content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, Source<TabContents>(this), Details<RenderViewHost>(render_view_host)); NavigationEntry* entry = controller_.GetActiveEntry(); @@ -1527,7 +1527,7 @@ void TabContents::DocumentOnLoadCompletedInMainFrame( RenderViewHost* render_view_host, int32 page_id) { NotificationService::current()->Notify( - NotificationType::LOAD_COMPLETED_MAIN_FRAME, + content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, Source<TabContents>(this), Details<int>(&page_id)); } @@ -1790,11 +1790,11 @@ bool TabContents::CreateRenderViewForRenderManager( return true; } -void TabContents::Observe(NotificationType type, +void TabContents::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::RENDER_WIDGET_HOST_DESTROYED: + switch (type) { + case content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED: view_->RenderWidgetHostDestroyed(Source<RenderWidgetHost>(source).ptr()); break; default: diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 458d341..9b88ea6 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -700,7 +700,7 @@ class TabContents : public PageNavigator, // NotificationObserver ------------------------------------------------------ - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/content/browser/tab_contents/tab_contents_view.cc b/content/browser/tab_contents/tab_contents_view.cc index 4ea5d9b..13ca172d 100644 --- a/content/browser/tab_contents/tab_contents_view.cc +++ b/content/browser/tab_contents/tab_contents_view.cc @@ -44,7 +44,7 @@ void TabContentsView::CreateNewWindow( if (new_contents) { NotificationService::current()->Notify( - NotificationType::CREATING_NEW_WINDOW, + content::NOTIFICATION_CREATING_NEW_WINDOW, Source<TabContents>(tab_contents_), Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); @@ -52,7 +52,7 @@ void TabContentsView::CreateNewWindow( tab_contents_->delegate()->TabContentsCreated(new_contents); } else { NotificationService::current()->Notify( - NotificationType::CREATING_NEW_WINDOW_CANCELLED, + content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, Source<TabContents>(tab_contents_), Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); } diff --git a/content/browser/user_metrics.cc b/content/browser/user_metrics.cc index ceee175..4c8cfb4 100644 --- a/content/browser/user_metrics.cc +++ b/content/browser/user_metrics.cc @@ -24,7 +24,7 @@ void UserMetrics::Record(const char *action) { return; } - NotificationService::current()->Notify(NotificationType::USER_ACTION, + NotificationService::current()->Notify(content::NOTIFICATION_USER_ACTION, NotificationService::AllSources(), Details<const char*>(&action)); } |