diff options
Diffstat (limited to 'chrome/browser/tab_contents')
19 files changed, 79 insertions, 71 deletions
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index b7fa507..9d568e2 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -9,6 +9,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/url_constants.h" #include "content/browser/browsing_instance.h" @@ -31,13 +32,13 @@ BackgroundContents::BackgroundContents(SiteInstance* site_instance, render_view_host_ = new RenderViewHost(site_instance, this, routing_id, NULL); // Close ourselves when the application is shutting down. - registrar_.Add(this, NotificationType::APP_TERMINATING, + registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, NotificationService::AllSources()); // Register for our parent profile to shutdown, so we can shut ourselves down // as well (should only be called for OTR profiles, as we should receive // APP_TERMINATING before non-OTR profiles are destroyed). - registrar_.Add(this, NotificationType::PROFILE_DESTROYED, + registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, Source<Profile>(profile)); } @@ -52,7 +53,7 @@ BackgroundContents::~BackgroundContents() { return; Profile* profile = render_view_host_->process()->profile(); NotificationService::current()->Notify( - NotificationType::BACKGROUND_CONTENTS_DELETED, + chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED, Source<Profile>(profile), Details<BackgroundContents>(this)); render_view_host_->Shutdown(); // deletes render_view_host @@ -92,7 +93,7 @@ void BackgroundContents::DidNavigate( Profile* profile = render_view_host->process()->profile(); NotificationService::current()->Notify( - NotificationType::BACKGROUND_CONTENTS_NAVIGATED, + chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, Source<Profile>(profile), Details<BackgroundContents>(this)); } @@ -120,14 +121,14 @@ bool BackgroundContents::PreHandleKeyboardEvent( return false; } -void BackgroundContents::Observe(NotificationType type, +void BackgroundContents::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { // TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent // background pages are closed when the last referencing frame is closed. - switch (type.value) { - case NotificationType::PROFILE_DESTROYED: - case NotificationType::APP_TERMINATING: { + switch (type) { + case chrome::NOTIFICATION_PROFILE_DESTROYED: + case content::NOTIFICATION_APP_TERMINATING: { delete this; break; } @@ -164,7 +165,7 @@ void BackgroundContents::ClearInspectorSettings() { void BackgroundContents::Close(RenderViewHost* render_view_host) { Profile* profile = render_view_host->process()->profile(); NotificationService::current()->Notify( - NotificationType::BACKGROUND_CONTENTS_CLOSED, + chrome::NOTIFICATION_BACKGROUND_CONTENTS_CLOSED, Source<Profile>(profile), Details<BackgroundContents>(this)); delete this; @@ -175,7 +176,7 @@ void BackgroundContents::RenderViewGone(RenderViewHost* rvh, int error_code) { Profile* profile = rvh->process()->profile(); NotificationService::current()->Notify( - NotificationType::BACKGROUND_CONTENTS_TERMINATED, + chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED, Source<Profile>(profile), Details<BackgroundContents>(this)); diff --git a/chrome/browser/tab_contents/background_contents.h b/chrome/browser/tab_contents/background_contents.h index 6552632..361c7da 100644 --- a/chrome/browser/tab_contents/background_contents.h +++ b/chrome/browser/tab_contents/background_contents.h @@ -120,7 +120,7 @@ class BackgroundContents : public RenderViewHostDelegate, virtual void UpdatePreferredSize(const gfx::Size& new_size) {} // NotificationObserver - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/chrome_interstitial_page.cc b/chrome/browser/tab_contents/chrome_interstitial_page.cc index 3c2b456..2de7627 100644 --- a/chrome/browser/tab_contents/chrome_interstitial_page.cc +++ b/chrome/browser/tab_contents/chrome_interstitial_page.cc @@ -6,6 +6,7 @@ #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/renderer_preferences_util.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" @@ -26,14 +27,15 @@ ChromeInterstitialPage::~ChromeInterstitialPage() { void ChromeInterstitialPage::Show() { InterstitialPage::Show(); - notification_registrar_.Add(this, NotificationType::DOM_OPERATION_RESPONSE, + notification_registrar_.Add( + this, chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, Source<RenderViewHost>(render_view_host())); } -void ChromeInterstitialPage::Observe(NotificationType type, +void ChromeInterstitialPage::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (NotificationType::DOM_OPERATION_RESPONSE == type.value) { + if (chrome::NOTIFICATION_DOM_OPERATION_RESPONSE == type) { if (enabled()) { Details<DomOperationNotificationDetails> dom_op_details(details); CommandReceived(dom_op_details->json()); diff --git a/chrome/browser/tab_contents/chrome_interstitial_page.h b/chrome/browser/tab_contents/chrome_interstitial_page.h index 44eeb93..6c712f6 100644 --- a/chrome/browser/tab_contents/chrome_interstitial_page.h +++ b/chrome/browser/tab_contents/chrome_interstitial_page.h @@ -29,7 +29,7 @@ class ChromeInterstitialPage : public InterstitialPage { protected: // NotificationObserver method: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/infobar_container.cc b/chrome/browser/tab_contents/infobar_container.cc index c16f95d..63b7a61 100644 --- a/chrome/browser/tab_contents/infobar_container.cc +++ b/chrome/browser/tab_contents/infobar_container.cc @@ -12,6 +12,7 @@ #include "chrome/browser/tab_contents/infobar.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" #include "ui/base/animation/slide_animation.h" @@ -43,11 +44,11 @@ void InfoBarContainer::ChangeTabContents(TabContentsWrapper* contents) { tab_contents_ = contents; if (tab_contents_) { Source<TabContentsWrapper> tc_source(tab_contents_); - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_ADDED, + registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, tc_source); - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, + registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, tc_source); - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED, + registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED, tc_source); for (size_t i = 0; i < tab_contents_->infobar_count(); ++i) { @@ -120,24 +121,24 @@ void InfoBarContainer::RemoveAllInfoBarsForDestruction() { ChangeTabContents(NULL); } -void InfoBarContainer::Observe(NotificationType type, +void InfoBarContainer::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::TAB_CONTENTS_INFOBAR_ADDED: + switch (type) { + case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED: AddInfoBar( Details<InfoBarAddedDetails>(details)->CreateInfoBar(tab_contents_), infobars_.size(), true, WANT_CALLBACK); break; - case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED: { + case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED: { InfoBarRemovedDetails* removed_details = Details<InfoBarRemovedDetails>(details).ptr(); RemoveInfoBar(removed_details->first, removed_details->second); break; } - case NotificationType::TAB_CONTENTS_INFOBAR_REPLACED: { + case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED: { InfoBarReplacedDetails* replaced_details = Details<InfoBarReplacedDetails>(details).ptr(); AddInfoBar(replaced_details->second->CreateInfoBar(tab_contents_), diff --git a/chrome/browser/tab_contents/infobar_container.h b/chrome/browser/tab_contents/infobar_container.h index 0944d81..a9bee62 100644 --- a/chrome/browser/tab_contents/infobar_container.h +++ b/chrome/browser/tab_contents/infobar_container.h @@ -96,7 +96,7 @@ class InfoBarContainer : public NotificationObserver { typedef std::vector<InfoBar*> InfoBars; // NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) OVERRIDE; diff --git a/chrome/browser/tab_contents/popup_menu_helper_mac.h b/chrome/browser/tab_contents/popup_menu_helper_mac.h index 192db4b..b5c7fcf 100644 --- a/chrome/browser/tab_contents/popup_menu_helper_mac.h +++ b/chrome/browser/tab_contents/popup_menu_helper_mac.h @@ -32,7 +32,7 @@ class PopupMenuHelper : public NotificationObserver { private: // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/popup_menu_helper_mac.mm b/chrome/browser/tab_contents/popup_menu_helper_mac.mm index ef0b4f9..328e9c5 100644 --- a/chrome/browser/tab_contents/popup_menu_helper_mac.mm +++ b/chrome/browser/tab_contents/popup_menu_helper_mac.mm @@ -18,7 +18,7 @@ PopupMenuHelper::PopupMenuHelper(RenderViewHost* render_view_host) : render_view_host_(render_view_host) { notification_registrar_.Add( - this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, + this, content::RENDER_WIDGET_HOST_DESTROYED, Source<RenderWidgetHost>(render_view_host)); } @@ -76,10 +76,10 @@ void PopupMenuHelper::ShowPopupMenu( } void PopupMenuHelper::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::RENDER_WIDGET_HOST_DESTROYED); + DCHECK(type == content::RENDER_WIDGET_HOST_DESTROYED); RenderViewHost* rvh = Source<RenderViewHost>(source).ptr(); DCHECK_EQ(render_view_host_, rvh); render_view_host_ = NULL; diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc index 35263d1..3fd8f74 100644 --- a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc +++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc @@ -14,6 +14,7 @@ #include "chrome/browser/tab_contents/infobar.h" #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/ssl/ssl_client_auth_handler.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -114,7 +115,7 @@ class TabContentsSSLHelper::SSLAddCertData : public NotificationObserver { private: // NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); @@ -130,8 +131,10 @@ TabContentsSSLHelper::SSLAddCertData::SSLAddCertData( : tab_contents_(tab_contents), infobar_delegate_(NULL) { Source<TabContentsWrapper> source(tab_contents_); - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, source); - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED, source); + registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, + source); + registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED, + source); } TabContentsSSLHelper::SSLAddCertData::~SSLAddCertData() { @@ -153,13 +156,13 @@ void TabContentsSSLHelper::SSLAddCertData::ShowErrorInfoBar( } void TabContentsSSLHelper::SSLAddCertData::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type.value == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED || - type.value == NotificationType::TAB_CONTENTS_INFOBAR_REPLACED); + DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED || + type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED); if (infobar_delegate_ == - ((type.value == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED) ? + ((type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED) ? Details<InfoBarRemovedDetails>(details)->first : Details<InfoBarReplacedDetails>(details)->first)) infobar_delegate_ = NULL; diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index 58bbbf6..312f820 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -29,8 +29,8 @@ #include "content/browser/tab_contents/interstitial_page.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -99,7 +99,7 @@ TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents) gtk_container_add(GTK_CONTAINER(floating_.get()), expanded_); gtk_widget_show(expanded_); gtk_widget_show(floating_.get()); - registrar_.Add(this, NotificationType::TAB_CONTENTS_CONNECTED, + registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED, Source<TabContents>(tab_contents)); drag_source_.reset(new TabContentsDragSource(this)); } @@ -282,11 +282,11 @@ void TabContentsViewGtk::TakeFocus(bool reverse) { } } -void TabContentsViewGtk::Observe(NotificationType type, +void TabContentsViewGtk::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::TAB_CONTENTS_CONNECTED: { + switch (type) { + case content::NOTIFICATION_TAB_CONTENTS_CONNECTED: { // No need to remove the SadTabGtk's widget from the container since // the new RenderWidgetHostViewGtk instance already removed all the // vbox's children. diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h index dff469b..33da82f 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.h +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h @@ -80,7 +80,7 @@ class TabContentsViewGtk : public TabContentsView, // NotificationObserver implementation --------------------------------------- - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/tab_contents_view_mac.h index 1573b5f..6714cf7 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.h +++ b/chrome/browser/tab_contents/tab_contents_view_mac.h @@ -100,7 +100,7 @@ class TabContentsViewMac : public TabContentsView, // NotificationObserver implementation --------------------------------------- - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index d583621..a71ec40 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -25,9 +25,9 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #import "content/common/chrome_application_mac.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "content/common/view_messages.h" #include "skia/ext/skia_utils_mac.h" #import "third_party/mozilla/NSPasteboard+Utils.h" @@ -69,7 +69,7 @@ TabContentsView* TabContentsView::Create(TabContents* tab_contents) { TabContentsViewMac::TabContentsViewMac(TabContents* tab_contents) : TabContentsView(tab_contents), preferred_width_(0) { - registrar_.Add(this, NotificationType::TAB_CONTENTS_CONNECTED, + registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED, Source<TabContents>(tab_contents)); } @@ -358,11 +358,11 @@ void TabContentsViewMac::CloseTab() { tab_contents()->Close(tab_contents()->render_view_host()); } -void TabContentsViewMac::Observe(NotificationType type, +void TabContentsViewMac::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::TAB_CONTENTS_CONNECTED: { + switch (type) { + case content::NOTIFICATION_TAB_CONTENTS_CONNECTED: { sad_tab_.reset(); break; } diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc index 6234b27..02f6dd6 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.cc +++ b/chrome/browser/tab_contents/thumbnail_generator.cc @@ -146,9 +146,9 @@ void ThumbnailGenerator::StartThumbnailing(TabContents* tab_contents) { // subclass, RenderViewHost when it is in a tab. We don't make thumbnails // for RenderViewHosts that aren't in tabs, or RenderWidgetHosts that // aren't views like select popups. - registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, + registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, Source<TabContents>(tab_contents)); - registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, + registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, Source<TabContents>(tab_contents)); } } @@ -159,26 +159,26 @@ void ThumbnailGenerator::MonitorRenderer(RenderWidgetHost* renderer, bool currently_monitored = registrar_.IsRegistered( this, - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, renderer_source); if (monitor != currently_monitored) { if (monitor) { registrar_.Add( this, - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, renderer_source); registrar_.Add( this, - NotificationType::RENDER_WIDGET_VISIBILITY_CHANGED, + content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, renderer_source); } else { registrar_.Remove( this, - NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, + content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, renderer_source); registrar_.Remove( this, - NotificationType::RENDER_WIDGET_VISIBILITY_CHANGED, + content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, renderer_source); } } @@ -307,23 +307,23 @@ void ThumbnailGenerator::WidgetDidReceivePaintAtSizeAck( } } -void ThumbnailGenerator::Observe(NotificationType type, +void ThumbnailGenerator::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB: { + switch (type) { + case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB: { // Install our observer for all new RVHs. RenderViewHost* renderer = Details<RenderViewHost>(details).ptr(); MonitorRenderer(renderer, true); break; } - case NotificationType::RENDER_WIDGET_VISIBILITY_CHANGED: + case content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED: if (!*Details<bool>(details).ptr()) WidgetHidden(Source<RenderWidgetHost>(source).ptr()); break; - case NotificationType::RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK: { + case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK: { RenderWidgetHost::PaintAtSizeAckDetails* size_ack_details = Details<RenderWidgetHost::PaintAtSizeAckDetails>(details).ptr(); WidgetDidReceivePaintAtSizeAck( @@ -333,12 +333,12 @@ void ThumbnailGenerator::Observe(NotificationType type, break; } - case NotificationType::TAB_CONTENTS_DISCONNECTED: + case content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED: TabContentsDisconnected(Source<TabContents>(source).ptr()); break; default: - NOTREACHED() << "Unexpected notification type: " << type.value; + NOTREACHED() << "Unexpected notification type: " << type; } } diff --git a/chrome/browser/tab_contents/thumbnail_generator.h b/chrome/browser/tab_contents/thumbnail_generator.h index 23a9361..0c0e588 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.h +++ b/chrome/browser/tab_contents/thumbnail_generator.h @@ -134,7 +134,7 @@ class ThumbnailGenerator : public NotificationObserver, const gfx::Size& size); // NotificationObserver interface. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc index 774a77a..308a001 100644 --- a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc +++ b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc @@ -68,7 +68,7 @@ class ThumbnailGeneratorTest : public testing::Test { // a little scary in that we don't have a RenderView, but the only listener // will want a RenderWidget, so it works out OK. NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, + chrome::RENDER_VIEW_HOST_CREATED_FOR_TAB, Source<RenderViewHostManager>(NULL), Details<RenderViewHost>(reinterpret_cast<RenderViewHost*>( widget_.get()))); diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 55bcf33..dd83969 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -7,6 +7,7 @@ #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/tab_contents/chrome_interstitial_page.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" @@ -95,7 +96,7 @@ class TestInterstitialPage : public ChromeInterstitialPage { void TestDomOperationResponse(const std::string& json_string) { DomOperationNotificationDetails details(json_string, 1); - Observe(NotificationType::DOM_OPERATION_RESPONSE, + Observe(chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, Source<RenderViewHost>(render_view_host()), Details<DomOperationNotificationDetails>(&details)); } diff --git a/chrome/browser/tab_contents/web_drag_source_win.cc b/chrome/browser/tab_contents/web_drag_source_win.cc index 9d35b45..d050f21 100644 --- a/chrome/browser/tab_contents/web_drag_source_win.cc +++ b/chrome/browser/tab_contents/web_drag_source_win.cc @@ -9,8 +9,8 @@ #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" using WebKit::WebDragOperationNone; @@ -36,9 +36,9 @@ WebDragSource::WebDragSource(gfx::NativeWindow source_wnd, source_wnd_(source_wnd), render_view_host_(tab_contents->render_view_host()), effect_(DROPEFFECT_NONE) { - registrar_.Add(this, NotificationType::TAB_CONTENTS_SWAPPED, + registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED, Source<TabContents>(tab_contents)); - registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, + registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, Source<TabContents>(tab_contents)); } @@ -107,14 +107,14 @@ void WebDragSource::OnDragSourceMove() { screen.x(), screen.y()); } -void WebDragSource::Observe(NotificationType type, +void WebDragSource::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (NotificationType::TAB_CONTENTS_SWAPPED == type) { + if (content::NOTIFICATION_TAB_CONTENTS_SWAPPED == type) { // When the tab contents get swapped, our render view host goes away. // That's OK, we can continue the drag, we just can't send messages back to // our drag source. render_view_host_ = NULL; - } else if (NotificationType::TAB_CONTENTS_DISCONNECTED == type) { + } else if (content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED == type) { // This could be possible when we close the tab and the source is still // being used in DoDragDrop at the time that the virtual file is being // downloaded. diff --git a/chrome/browser/tab_contents/web_drag_source_win.h b/chrome/browser/tab_contents/web_drag_source_win.h index 471c8b9..0c6ebe07 100644 --- a/chrome/browser/tab_contents/web_drag_source_win.h +++ b/chrome/browser/tab_contents/web_drag_source_win.h @@ -28,7 +28,7 @@ class WebDragSource : public ui::DragSource, virtual ~WebDragSource(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); |