summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.cc44
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.h20
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views_unittest.cc7
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc13
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.h2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc5
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc5
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc3
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc8
-rw-r--r--chrome/browser/ui/views/browser_actions_container.h2
-rw-r--r--chrome/browser/ui/views/bubble/bubble.cc7
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.cc7
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.h2
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc12
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h2
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc3
-rw-r--r--chrome/browser/ui/views/content_setting_bubble_contents.cc8
-rw-r--r--chrome/browser/ui/views/content_setting_bubble_contents.h2
-rw-r--r--chrome/browser/ui/views/dom_view_browsertest.cc6
-rw-r--r--chrome/browser/ui/views/download/download_started_animation_win.cc12
-rw-r--r--chrome/browser/ui/views/extensions/extension_dialog.cc10
-rw-r--r--chrome/browser/ui/views/extensions/extension_dialog.h2
-rw-r--r--chrome/browser/ui/views/extensions/extension_installed_bubble.cc12
-rw-r--r--chrome/browser/ui/views/extensions/extension_installed_bubble.h2
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.cc18
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.h2
-rw-r--r--chrome/browser/ui/views/file_manager_dialog_browsertest.cc6
-rw-r--r--chrome/browser/ui/views/find_bar_host_interactive_uitest.cc3
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc11
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
-rw-r--r--chrome/browser/ui/views/frame/glass_browser_frame_view.cc9
-rw-r--r--chrome/browser/ui/views/frame/glass_browser_frame_view.h2
-rw-r--r--chrome/browser/ui/views/frame/opaque_browser_frame_view.cc9
-rw-r--r--chrome/browser/ui/views/frame/opaque_browser_frame_view.h2
-rw-r--r--chrome/browser/ui/views/html_dialog_view.cc20
-rw-r--r--chrome/browser/ui/views/html_dialog_view.h2
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc11
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.h2
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc17
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.h2
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_views.cc11
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_views.h2
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_win.cc7
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_container.cc10
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_container_native.h2
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_container_views.h2
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc7
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.h2
-rw-r--r--chrome/browser/ui/views/tabs/dragged_tab_controller.cc6
-rw-r--r--chrome/browser/ui/views/tabs/dragged_tab_controller.h2
-rw-r--r--chrome/browser/ui/views/theme_install_bubble_view.cc13
-rw-r--r--chrome/browser/ui/views/theme_install_bubble_view.h2
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc15
-rw-r--r--chrome/browser/ui/views/toolbar_view.h2
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc8
56 files changed, 216 insertions, 193 deletions
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index be15213..218008e 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/extensions/extension_accessibility_api.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "content/common/notification_type.h"
+#include "chrome/common/chrome_notification_types.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "views/controls/button/text_button.h"
#include "views/controls/menu/menu_item_view.h"
@@ -45,30 +45,30 @@ void AccessibilityEventRouterViews::HandleAccessibilityEvent(
switch (event_type) {
case ui::AccessibilityTypes::EVENT_FOCUS:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_CONTROL_FOCUSED);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED);
break;
case ui::AccessibilityTypes::EVENT_MENUSTART:
case ui::AccessibilityTypes::EVENT_MENUPOPUPSTART:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_MENU_OPENED);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED);
break;
case ui::AccessibilityTypes::EVENT_MENUEND:
case ui::AccessibilityTypes::EVENT_MENUPOPUPEND:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_MENU_CLOSED);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED);
break;
case ui::AccessibilityTypes::EVENT_TEXT_CHANGED:
case ui::AccessibilityTypes::EVENT_SELECTION_CHANGED:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_TEXT_CHANGED);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_TEXT_CHANGED);
break;
case ui::AccessibilityTypes::EVENT_VALUE_CHANGED:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_CONTROL_ACTION);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_ACTION);
break;
case ui::AccessibilityTypes::EVENT_ALERT:
DispatchAccessibilityNotification(
- view, NotificationType::ACCESSIBILITY_WINDOW_OPENED);
+ view, chrome::NOTIFICATION_ACCESSIBILITY_WINDOW_OPENED);
break;
case ui::AccessibilityTypes::EVENT_NAME_CHANGED:
NOTIMPLEMENTED();
@@ -97,7 +97,7 @@ void AccessibilityEventRouterViews::HandleMenuItemFocused(
item_index,
item_count);
SendAccessibilityNotification(
- NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, &info);
+ chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &info);
}
//
@@ -105,7 +105,7 @@ void AccessibilityEventRouterViews::HandleMenuItemFocused(
//
void AccessibilityEventRouterViews::DispatchAccessibilityNotification(
- views::View* view, NotificationType type) {
+ views::View* view, int type) {
// Get the profile associated with this view. If it's not found, use
// the most recent profile where accessibility events were sent, or
// the default profile.
@@ -126,8 +126,8 @@ void AccessibilityEventRouterViews::DispatchAccessibilityNotification(
most_recent_profile_ = profile;
- if (type == NotificationType::ACCESSIBILITY_MENU_OPENED ||
- type == NotificationType::ACCESSIBILITY_MENU_CLOSED) {
+ if (type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED ||
+ type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED) {
SendMenuNotification(view, type, profile);
return;
}
@@ -174,7 +174,7 @@ void AccessibilityEventRouterViews::DispatchAccessibilityNotification(
void AccessibilityEventRouterViews::SendButtonNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
AccessibilityButtonInfo info(profile, GetViewName(view));
SendAccessibilityNotification(type, &info);
@@ -182,7 +182,7 @@ void AccessibilityEventRouterViews::SendButtonNotification(
void AccessibilityEventRouterViews::SendLinkNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
AccessibilityLinkInfo info(profile, GetViewName(view));
SendAccessibilityNotification(type, &info);
@@ -190,7 +190,7 @@ void AccessibilityEventRouterViews::SendLinkNotification(
void AccessibilityEventRouterViews::SendMenuNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
AccessibilityMenuInfo info(profile, GetViewName(view));
SendAccessibilityNotification(type, &info);
@@ -198,7 +198,7 @@ void AccessibilityEventRouterViews::SendMenuNotification(
void AccessibilityEventRouterViews::SendMenuItemNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
std::string name = GetViewName(view);
@@ -225,7 +225,7 @@ void AccessibilityEventRouterViews::SendMenuItemNotification(
void AccessibilityEventRouterViews::SendTextfieldNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
ui::AccessibleViewState state;
view->GetAccessibleState(&state);
@@ -240,7 +240,7 @@ void AccessibilityEventRouterViews::SendTextfieldNotification(
void AccessibilityEventRouterViews::SendComboboxNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
ui::AccessibleViewState state;
view->GetAccessibleState(&state);
@@ -253,7 +253,7 @@ void AccessibilityEventRouterViews::SendComboboxNotification(
void AccessibilityEventRouterViews::SendCheckboxNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
ui::AccessibleViewState state;
view->GetAccessibleState(&state);
@@ -266,7 +266,7 @@ void AccessibilityEventRouterViews::SendCheckboxNotification(
void AccessibilityEventRouterViews::SendWindowNotification(
views::View* view,
- NotificationType type,
+ int type,
Profile* profile) {
ui::AccessibleViewState state;
view->GetAccessibleState(&state);
@@ -293,9 +293,9 @@ std::string AccessibilityEventRouterViews::GetViewName(views::View* view) {
bool AccessibilityEventRouterViews::IsMenuEvent(
views::View* view,
- NotificationType type) {
- if (type == NotificationType::ACCESSIBILITY_MENU_OPENED ||
- type == NotificationType::ACCESSIBILITY_MENU_CLOSED)
+ int type) {
+ if (type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED ||
+ type == chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED)
return true;
while (view) {
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.h b/chrome/browser/ui/views/accessibility_event_router_views.h
index 8890026..9ae9947 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.h
+++ b/chrome/browser/ui/views/accessibility_event_router_views.h
@@ -76,32 +76,32 @@ class AccessibilityEventRouterViews {
// Checks the type of the view and calls one of the more specific
// Send*Notification methods, below.
void DispatchAccessibilityNotification(
- views::View* view, NotificationType type);
+ views::View* view, int type);
// Each of these methods constructs an AccessibilityControlInfo object
// and sends a notification of a specific accessibility event.
void SendButtonNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendLinkNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendMenuNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendMenuItemNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendTextfieldNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendComboboxNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendCheckboxNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
void SendWindowNotification(
- views::View* view, NotificationType type, Profile* profile);
+ views::View* view, int type, Profile* profile);
// Return the name of a view.
std::string GetViewName(views::View* view);
// Return true if it's an event on a menu.
- bool IsMenuEvent(views::View* view, NotificationType type);
+ bool IsMenuEvent(views::View* view, int type);
// Recursively explore all menu items of |menu| and return in |count|
// the total number of items, and in |index| the 0-based index of
diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
index e984655..c76d342 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
@@ -9,6 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_accessibility_api.h"
#include "chrome/browser/ui/views/accessibility_event_router_views.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/testing_profile.h"
#include "content/common/notification_registrar.h"
#include "content/common/notification_service.h"
@@ -114,10 +115,10 @@ class AccessibilityEventRouterViewsTest
protected:
// Implement NotificationObserver::Observe and store information about a
// ACCESSIBILITY_CONTROL_FOCUSED event.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- ASSERT_EQ(type.value, NotificationType::ACCESSIBILITY_CONTROL_FOCUSED);
+ ASSERT_EQ(type, chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED);
const AccessibilityControlInfo* info =
Details<const AccessibilityControlInfo>(details).ptr();
focus_event_count_++;
@@ -157,7 +158,7 @@ TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) {
// Start listening to ACCESSIBILITY_CONTROL_FOCUSED notifications.
NotificationRegistrar registrar;
registrar.Add(this,
- NotificationType::ACCESSIBILITY_CONTROL_FOCUSED,
+ chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED,
NotificationService::AllSources());
// Switch on accessibility event notifications.
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 075e7e8..2c308cd 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
@@ -428,8 +429,8 @@ void BookmarkBarView::SetProfile(Profile* profile) {
other_bookmarked_button_->SetEnabled(false);
Source<Profile> ns_source(profile_->GetOriginalProfile());
- registrar_.Add(this, NotificationType::BOOKMARK_BUBBLE_SHOWN, ns_source);
- registrar_.Add(this, NotificationType::BOOKMARK_BUBBLE_HIDDEN, ns_source);
+ registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN, ns_source);
+ registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN, ns_source);
// Remove any existing bookmark buttons.
while (GetBookmarkButtonCount())
@@ -1145,12 +1146,12 @@ void BookmarkBarView::ShowContextMenuForView(View* source,
controller.RunMenuAt(p);
}
-void BookmarkBarView::Observe(NotificationType type,
+void BookmarkBarView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(profile_);
- switch (type.value) {
- case NotificationType::BOOKMARK_BUBBLE_SHOWN: {
+ switch (type) {
+ case chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN: {
StopThrobbing(true);
GURL url = *(Details<GURL>(details).ptr());
const BookmarkNode* node = model_->GetMostRecentlyAddedNodeForURL(url);
@@ -1159,7 +1160,7 @@ void BookmarkBarView::Observe(NotificationType type,
StartThrobbing(node, false);
break;
}
- case NotificationType::BOOKMARK_BUBBLE_HIDDEN:
+ case chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN:
StopThrobbing(false);
break;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index dd358e7..ee138ec 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -241,7 +241,7 @@ class BookmarkBarView : public DetachableToolbarView,
bool is_mouse_gesture) OVERRIDE;
// NotificationService:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 997da22..f0248d4 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/interactive_ui/view_event_test_base.h"
#include "chrome/test/testing_profile.h"
@@ -460,11 +461,11 @@ class ContextMenuNotificationObserver : public NotificationObserver {
public:
explicit ContextMenuNotificationObserver(Task* task) : task_(task) {
registrar_.Add(this,
- NotificationType::BOOKMARK_CONTEXT_MENU_SHOWN,
+ chrome::NOTIFICATION_BOOKMARK_CONTEXT_MENU_SHOWN,
NotificationService::AllSources());
}
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
MessageLoop::current()->PostTask(FROM_HERE, task_);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index 63edf3b..0f28330 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/views/bubble/bubble.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/user_metrics.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
@@ -104,7 +105,7 @@ void BookmarkBubbleView::Show(views::Widget* parent,
bubble->SizeToContents();
GURL url_ptr(url);
NotificationService::current()->Notify(
- NotificationType::BOOKMARK_BUBBLE_SHOWN,
+ chrome::NOTIFICATION_BOOKMARK_BUBBLE_SHOWN,
Source<Profile>(profile->GetOriginalProfile()),
Details<GURL>(&url_ptr));
bookmark_bubble_->BubbleShown();
@@ -325,7 +326,7 @@ void BookmarkBubbleView::BubbleClosing(Bubble* bubble,
if (delegate_)
delegate_->BubbleClosing(bubble, closed_by_escape);
NotificationService::current()->Notify(
- NotificationType::BOOKMARK_BUBBLE_HIDDEN,
+ chrome::NOTIFICATION_BOOKMARK_BUBBLE_HIDDEN,
Source<Profile>(profile_->GetOriginalProfile()),
NotificationService::NoDetails());
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
index 8ac9789..4504833 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
@@ -9,6 +9,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -40,7 +41,7 @@ BookmarkContextMenu::~BookmarkContextMenu() {
void BookmarkContextMenu::RunMenuAt(const gfx::Point& point) {
NotificationService::current()->Notify(
- NotificationType::BOOKMARK_CONTEXT_MENU_SHOWN,
+ chrome::NOTIFICATION_BOOKMARK_CONTEXT_MENU_SHOWN,
Source<BookmarkContextMenu>(this),
NotificationService::NoDetails());
// width/height don't matter here.
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 5bfb2bd..04b2487 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
#include "chrome/browser/ui/views/toolbar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/pref_names.h"
@@ -28,7 +29,6 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -76,7 +76,7 @@ BrowserActionButton::BrowserActionButton(const Extension* extension,
// No UpdateState() here because View hierarchy not setup yet. Our parent
// should call UpdateState() after creation.
- registrar_.Add(this, NotificationType::EXTENSION_BROWSER_ACTION_UPDATED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
Source<ExtensionAction>(browser_action_));
}
@@ -186,10 +186,10 @@ GURL BrowserActionButton::GetPopupUrl() {
return (tab_id < 0) ? GURL() : browser_action_->GetPopupUrl(tab_id);
}
-void BrowserActionButton::Observe(NotificationType type,
+void BrowserActionButton::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(type == NotificationType::EXTENSION_BROWSER_ACTION_UPDATED);
+ DCHECK(type == chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED);
UpdateState();
// The browser action may have become visible/hidden so we need to make
// sure the state gets updated.
diff --git a/chrome/browser/ui/views/browser_actions_container.h b/chrome/browser/ui/views/browser_actions_container.h
index b2c1763..00a14d3 100644
--- a/chrome/browser/ui/views/browser_actions_container.h
+++ b/chrome/browser/ui/views/browser_actions_container.h
@@ -89,7 +89,7 @@ class BrowserActionButton : public views::MenuButton,
int index) OVERRIDE;
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc
index 6886d72..7a5a676 100644
--- a/chrome/browser/ui/views/bubble/bubble.cc
+++ b/chrome/browser/ui/views/bubble/bubble.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "chrome/browser/ui/views/bubble/border_contents.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/common/notification_service.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -273,9 +274,9 @@ void Bubble::InitBubble(views::Widget* parent,
GetWidget()->SetBounds(window_bounds);
// Done creating the bubble.
- NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED,
- Source<Bubble>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_INFO_BUBBLE_CREATED, Source<Bubble>(this),
+ NotificationService::NoDetails());
// Show the window.
#if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc
index 1deae52..7da33b4 100644
--- a/chrome/browser/ui/views/collected_cookies_win.cc
+++ b/chrome/browser/ui/views/collected_cookies_win.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/views/cookie_info_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
#include "grit/generated_resources.h"
@@ -175,7 +176,7 @@ CollectedCookiesWin::CollectedCookiesWin(gfx::NativeWindow parent_window,
TabSpecificContentSettings* content_settings =
TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)->
content_settings();
- registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN,
+ registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN,
Source<TabSpecificContentSettings>(content_settings));
Init();
@@ -500,9 +501,9 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
///////////////////////////////////////////////////////////////////////////////
// NotificationObserver implementation.
-void CollectedCookiesWin::Observe(NotificationType type,
+void CollectedCookiesWin::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN);
+ DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN);
window_->CloseConstrainedWindow();
}
diff --git a/chrome/browser/ui/views/collected_cookies_win.h b/chrome/browser/ui/views/collected_cookies_win.h
index 7022fde..4a8f213 100644
--- a/chrome/browser/ui/views/collected_cookies_win.h
+++ b/chrome/browser/ui/views/collected_cookies_win.h
@@ -80,7 +80,7 @@ class CollectedCookiesWin : public ConstrainedDialogDelegate,
void AddContentException(views::TreeView* tree_view, ContentSetting setting);
// NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
index d0376a3..8e46fd9 100644
--- a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
@@ -352,9 +352,9 @@ void CompactLocationBarViewHost::TabChangedAt(TabContentsWrapper* contents,
if (tab_contents->is_loading()) {
// Register to NavigationController LOAD_STOP so that we can autohide
// when loading is done.
- if (!registrar_.IsRegistered(this, NotificationType::LOAD_STOP,
+ if (!registrar_.IsRegistered(this, content::NOTIFICATION_LOAD_STOP,
Source<NavigationController>(&tab_contents->controller()))) {
- registrar_.Add(this, NotificationType::LOAD_STOP,
+ registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
Source<NavigationController>(&tab_contents->controller()));
}
} else {
@@ -374,14 +374,14 @@ void CompactLocationBarViewHost::ActiveTabClicked(int index) {
////////////////////////////////////////////////////////////////////////////////
// CompactLocationBarViewHost, NotificationObserver implementation:
-void CompactLocationBarViewHost::Observe(NotificationType type,
+void CompactLocationBarViewHost::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::LOAD_STOP: {
+ switch (type) {
+ case content::NOTIFICATION_LOAD_STOP: {
StartAutoHideTimer();
// This is one shot deal...
- registrar_.Remove(this, NotificationType::LOAD_STOP, source);
+ registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, source);
break;
}
default:
diff --git a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h
index 606e7a2..830a1949 100644
--- a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h
+++ b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h
@@ -100,7 +100,7 @@ class CompactLocationBarViewHost : public DropdownBarHost,
virtual void ActiveTabClicked(int index) OVERRIDE;
// Overridden from NotificationObserver.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 3d83490..344fd78 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/window_sizer.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/common/notification_service.h"
@@ -597,7 +598,7 @@ void ConstrainedWindowViews::CloseConstrainedWindow() {
// Broadcast to all observers of NOTIFY_CWINDOW_CLOSED.
// One example of such an observer is AutomationCWindowTracker in the
// automation component.
- NotificationService::current()->Notify(NotificationType::CWINDOW_CLOSED,
+ NotificationService::current()->Notify(chrome::NOTIFICATION_CWINDOW_CLOSED,
Source<ConstrainedWindow>(this),
NotificationService::NoDetails());
Close();
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc
index 15da1e1..b3c28ac 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -16,8 +16,8 @@
#include "chrome/browser/ui/views/browser_dialogs.h"
#include "chrome/browser/ui/views/bubble/bubble.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"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "views/controls/button/radio_button.h"
@@ -105,7 +105,7 @@ ContentSettingBubbleContents::ContentSettingBubbleContents(
custom_link_(NULL),
manage_link_(NULL),
close_button_(NULL) {
- registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(tab_contents));
}
@@ -168,10 +168,10 @@ void ContentSettingBubbleContents::LinkClicked(views::Link* source,
content_setting_bubble_model_->OnPopupClicked(i->second);
}
-void ContentSettingBubbleContents::Observe(NotificationType type,
+void ContentSettingBubbleContents::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED);
+ DCHECK(type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED);
DCHECK(source == Source<TabContents>(tab_contents_));
tab_contents_ = NULL;
}
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.h b/chrome/browser/ui/views/content_setting_bubble_contents.h
index 1b7bc16..9f8cbe4 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.h
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.h
@@ -67,7 +67,7 @@ class ContentSettingBubbleContents : public views::View,
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
// NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/ui/views/dom_view_browsertest.cc b/chrome/browser/ui/views/dom_view_browsertest.cc
index a61c804..d4b76ae 100644
--- a/chrome/browser/ui/views/dom_view_browsertest.cc
+++ b/chrome/browser/ui/views/dom_view_browsertest.cc
@@ -31,7 +31,7 @@ IN_PROC_BROWSER_TEST_F(DOMViewTest, TestShowAndHide) {
dom_view->Init(browser()->profile(), NULL);
dom_view->LoadURL(GURL("http://www.google.com"));
- ui_test_utils::WaitForNotification(NotificationType::LOAD_STOP);
+ ui_test_utils::WaitForNotification(content::NOTIFICATION_LOAD_STOP);
one->Show();
ui_test_utils::RunAllPendingInMessageLoop();
@@ -49,7 +49,7 @@ IN_PROC_BROWSER_TEST_F(DOMViewTest, TestRemoveAndDelete) {
dom_view->Init(browser()->profile(), NULL);
dom_view->LoadURL(GURL("http://www.google.com"));
- ui_test_utils::WaitForNotification(NotificationType::LOAD_STOP);
+ ui_test_utils::WaitForNotification(content::NOTIFICATION_LOAD_STOP);
one->Show();
ui_test_utils::RunAllPendingInMessageLoop();
@@ -71,7 +71,7 @@ IN_PROC_BROWSER_TEST_F(DOMViewTest, TestReparent) {
dom_view->Init(browser()->profile(), NULL);
dom_view->LoadURL(GURL("http://www.google.com"));
- ui_test_utils::WaitForNotification(NotificationType::LOAD_STOP);
+ ui_test_utils::WaitForNotification(content::NOTIFICATION_LOAD_STOP);
one->Show();
ui_test_utils::RunAllPendingInMessageLoop();
diff --git a/chrome/browser/ui/views/download/download_started_animation_win.cc b/chrome/browser/ui/views/download/download_started_animation_win.cc
index f38a5b2..1039770 100644
--- a/chrome/browser/ui/views/download/download_started_animation_win.cc
+++ b/chrome/browser/ui/views/download/download_started_animation_win.cc
@@ -50,7 +50,7 @@ class DownloadStartedAnimationWin : public ui::LinearAnimation,
virtual void AnimateToState(double state);
// NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -92,11 +92,11 @@ DownloadStartedAnimationWin::DownloadStartedAnimationWin(
registrar_.Add(
this,
- NotificationType::TAB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_TAB_CONTENTS_HIDDEN,
Source<TabContents>(tab_contents_));
registrar_.Add(
this,
- NotificationType::TAB_CONTENTS_DESTROYED,
+ content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(tab_contents_));
SetImage(kDownloadImage);
@@ -139,11 +139,11 @@ void DownloadStartedAnimationWin::Close() {
registrar_.Remove(
this,
- NotificationType::TAB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_TAB_CONTENTS_HIDDEN,
Source<TabContents>(tab_contents_));
registrar_.Remove(
this,
- NotificationType::TAB_CONTENTS_DESTROYED,
+ content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(tab_contents_));
tab_contents_ = NULL;
popup_->Close();
@@ -166,7 +166,7 @@ void DownloadStartedAnimationWin::AnimateToState(double state) {
}
}
-void DownloadStartedAnimationWin::Observe(NotificationType type,
+void DownloadStartedAnimationWin::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
Close();
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.cc b/chrome/browser/ui/views/extensions/extension_dialog.cc
index 3b3ecde..5f76421 100644
--- a/chrome/browser/ui/views/extensions/extension_dialog.cc
+++ b/chrome/browser/ui/views/extensions/extension_dialog.cc
@@ -11,11 +11,11 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/extensions/extension_dialog_observer.h"
#include "chrome/browser/ui/views/window.h" // CreateViewsWindow
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "googleurl/src/gurl.h"
#include "views/widget/widget.h"
@@ -38,7 +38,7 @@ ExtensionDialog::ExtensionDialog(Browser* browser, ExtensionHost* host,
host->view()->SetContainer(this /* ExtensionView::Container */);
// Listen for the containing view calling window.close();
- registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
Source<Profile>(host->profile()));
window_->Show();
@@ -127,11 +127,11 @@ void ExtensionDialog::OnExtensionPreferredSizeChanged(ExtensionView* view) {
/////////////////////////////////////////////////////////////////////////////
// NotificationObserver overrides.
-void ExtensionDialog::Observe(NotificationType type,
+void ExtensionDialog::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE:
+ switch (type) {
+ case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE:
// If we aren't the host of the popup, then disregard the notification.
if (Details<ExtensionHost>(host()) != details)
return;
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.h b/chrome/browser/ui/views/extensions/extension_dialog.h
index f0e50ea..741b2c4 100644
--- a/chrome/browser/ui/views/extensions/extension_dialog.h
+++ b/chrome/browser/ui/views/extensions/extension_dialog.h
@@ -65,7 +65,7 @@ class ExtensionDialog : public views::WidgetDelegate,
virtual void OnExtensionPreferredSizeChanged(ExtensionView* view);
// NotificationObserver overrides.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
index a87b809..f9e30ab 100644
--- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
+++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
@@ -16,11 +16,11 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/toolbar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_action.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
@@ -264,18 +264,18 @@ ExtensionInstalledBubble::ExtensionInstalledBubble(const Extension* extension,
// fired, but all of the EXTENSION_LOADED Observers have run. Only then can we
// be sure that a BrowserAction or PageAction has had views created which we
// can inspect for the purpose of previewing of pointing to them.
- registrar_.Add(this, NotificationType::EXTENSION_LOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
Source<Profile>(browser->profile()));
- registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
Source<Profile>(browser->profile()));
}
ExtensionInstalledBubble::~ExtensionInstalledBubble() {}
-void ExtensionInstalledBubble::Observe(NotificationType type,
+void ExtensionInstalledBubble::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type == NotificationType::EXTENSION_LOADED) {
+ if (type == chrome::NOTIFICATION_EXTENSION_LOADED) {
const Extension* extension = Details<const Extension>(details).ptr();
if (extension == extension_) {
animation_wait_retries_ = 0;
@@ -283,7 +283,7 @@ void ExtensionInstalledBubble::Observe(NotificationType type,
MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this,
&ExtensionInstalledBubble::ShowInternal));
}
- } else if (type == NotificationType::EXTENSION_UNLOADED) {
+ } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) {
const Extension* extension =
Details<UnloadedExtensionInfo>(details)->extension;
if (extension == extension_)
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.h b/chrome/browser/ui/views/extensions/extension_installed_bubble.h
index b024da9..8f5f5b7 100644
--- a/chrome/browser/ui/views/extensions/extension_installed_bubble.h
+++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.h
@@ -61,7 +61,7 @@ class ExtensionInstalledBubble
void ShowInternal();
// NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 88107794..8c87527 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -12,13 +12,13 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/debugger/devtools_window.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
@@ -60,11 +60,11 @@ ExtensionPopup::ExtensionPopup(ExtensionHost* host,
// We wait to show the popup until the contained host finishes loading.
registrar_.Add(this,
- NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
+ chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
Source<Profile>(host->profile()));
// Listen for the containing view calling window.close();
- registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
Source<Profile>(host->profile()));
}
@@ -116,11 +116,11 @@ void ExtensionPopup::BubbleLostFocus(BrowserBubble* bubble,
}
-void ExtensionPopup::Observe(NotificationType type,
+void ExtensionPopup::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::EXTENSION_HOST_DID_STOP_LOADING:
+ switch (type) {
+ case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING:
// Once we receive did stop loading, the content will be complete and
// the width will have been computed. Now it's safe to show.
if (extension_host_.get() == Details<ExtensionHost>(details).ptr()) {
@@ -128,7 +128,7 @@ void ExtensionPopup::Observe(NotificationType type,
if (inspect_with_devtools_) {
// Listen for the the devtools window closing.
- registrar_.Add(this, NotificationType::DEVTOOLS_WINDOW_CLOSING,
+ registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
Source<Profile>(extension_host_->profile()));
DevToolsWindow::ToggleDevToolsWindow(
extension_host_->render_view_host(),
@@ -136,14 +136,14 @@ void ExtensionPopup::Observe(NotificationType type,
}
}
break;
- case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE:
+ case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE:
// If we aren't the host of the popup, then disregard the notification.
if (Details<ExtensionHost>(host()) != details)
return;
Close();
break;
- case NotificationType::DEVTOOLS_WINDOW_CLOSING:
+ case content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING:
// Make sure its the devtools window that inspecting our popup.
if (Details<RenderViewHost>(extension_host_->render_view_host()) !=
details)
diff --git a/chrome/browser/ui/views/extensions/extension_popup.h b/chrome/browser/ui/views/extensions/extension_popup.h
index 2358ab2..7f0abc3 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.h
+++ b/chrome/browser/ui/views/extensions/extension_popup.h
@@ -82,7 +82,7 @@ class ExtensionPopup : public BrowserBubble,
bool lost_focus_to_child);
// NotificationObserver overrides.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/ui/views/file_manager_dialog_browsertest.cc b/chrome/browser/ui/views/file_manager_dialog_browsertest.cc
index 0e5862b..35c98b4 100644
--- a/chrome/browser/ui/views/file_manager_dialog_browsertest.cc
+++ b/chrome/browser/ui/views/file_manager_dialog_browsertest.cc
@@ -130,7 +130,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerDialogTest, SelectFileAndCancel) {
// Inject JavaScript to click the cancel button and wait for notification
// that the window has closed.
ui_test_utils::WindowedNotificationObserver host_destroyed(
- NotificationType::RENDER_WIDGET_HOST_DESTROYED,
+ chrome::RENDER_WIDGET_HOST_DESTROYED,
NotificationService::AllSources());
RenderViewHost* host = dialog_->GetRenderViewHost();
string16 main_frame;
@@ -194,7 +194,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerDialogTest, SelectFileAndOpen) {
// Inject JavaScript to click the open button and wait for notification
// that the window has closed.
ui_test_utils::WindowedNotificationObserver host_destroyed(
- NotificationType::RENDER_WIDGET_HOST_DESTROYED,
+ chrome::RENDER_WIDGET_HOST_DESTROYED,
NotificationService::AllSources());
RenderViewHost* host = dialog_->GetRenderViewHost();
string16 main_frame;
@@ -254,7 +254,7 @@ IN_PROC_BROWSER_TEST_F(FileManagerDialogTest, SelectFileAndSave) {
// Inject JavaScript to click the save button and wait for notification
// that the window has closed.
ui_test_utils::WindowedNotificationObserver host_destroyed(
- NotificationType::RENDER_WIDGET_HOST_DESTROYED,
+ chrome::RENDER_WIDGET_HOST_DESTROYED,
NotificationService::AllSources());
RenderViewHost* host = dialog_->GetRenderViewHost();
string16 main_frame;
diff --git a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
index 5834ba7..b4349e7 100644
--- a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
+++ b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/find_bar_host.h"
#include "chrome/browser/ui/views/frame/browser_view.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"
@@ -325,7 +326,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, PasteWithoutTextChange) {
Source<TabContents> notification_source(browser()->GetSelectedTabContents());
ui_test_utils::WindowedNotificationObserverWithDetails
<FindNotificationDetails> observer(
- NotificationType::FIND_RESULT_AVAILABLE, notification_source);
+ chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source);
ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
browser(), ui::VKEY_V, true, false, false, false));
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 51c606a..49d2fbe 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -19,8 +19,8 @@
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(TOUCH_UI)
+#include "content/common/content_notification_types.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
#include "views/ime/input_method.h"
#endif
@@ -48,7 +48,7 @@ ui::TouchStatus BrowserRootView::OnTouchEvent(const views::TouchEvent& event) {
ui::TextInputType text_input_type = input_method->GetTextInputType();
if (text_input_type != ui::TEXT_INPUT_TYPE_NONE) {
NotificationService::current()->Notify(
- NotificationType::EDITABLE_ELEMENT_TOUCHED,
+ chrome::EDITABLE_ELEMENT_TOUCHED,
Source<View>(this),
Details<ui::TextInputType>(&text_input_type));
}
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 556af60..7cb5cfb 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -69,6 +69,7 @@
#include "chrome/browser/ui/webui/bug_report_ui.h"
#include "chrome/browser/ui/webui/task_manager_dialog.h"
#include "chrome/browser/ui/window_sizer.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/native_window_notification_source.h"
@@ -337,7 +338,7 @@ BrowserView::BrowserView(Browser* browser)
browser_->tabstrip_model()->AddObserver(this);
registrar_.Add(this,
- NotificationType::SIDEBAR_CHANGED,
+ chrome::NOTIFICATION_SIDEBAR_CHANGED,
Source<SidebarManager>(SidebarManager::GetInstance()));
}
@@ -1394,11 +1395,11 @@ ToolbarView* BrowserView::GetToolbarView() const {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, NotificationObserver implementation:
-void BrowserView::Observe(NotificationType type,
+void BrowserView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::SIDEBAR_CHANGED:
+ switch (type) {
+ case chrome::NOTIFICATION_SIDEBAR_CHANGED:
if (Details<SidebarContainer>(details)->tab_contents() ==
browser_->GetSelectedTabContents()) {
UpdateSidebar();
@@ -1729,7 +1730,7 @@ bool BrowserView::CanClose() {
// Empty TabStripModel, it's now safe to allow the Window to be closed.
NotificationService::current()->Notify(
- NotificationType::WINDOW_CLOSED,
+ chrome::NOTIFICATION_WINDOW_CLOSED,
Source<gfx::NativeWindow>(frame_->GetNativeWindow()),
NotificationService::NoDetails());
return true;
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 361a79f..9da0d76 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -349,7 +349,7 @@ class BrowserView : public BrowserBubbleHost,
virtual ToolbarView* GetToolbarView() const OVERRIDE;
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index adbc5b8..b43bebb 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/views/tabs/side_tab_strip.h"
#include "chrome/browser/ui/views/tabs/tab.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/common/notification_service.h"
@@ -90,7 +91,7 @@ GlassBrowserFrameView::GlassBrowserFrameView(BrowserFrame* frame,
AddChildView(avatar_button_.get());
UpdateAvatarInfo();
if (!browser_view_->IsOffTheRecord()) {
- registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED,
+ registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
NotificationService::AllSources());
}
}
@@ -513,11 +514,11 @@ void GlassBrowserFrameView::DisplayNextThrobberFrame() {
reinterpret_cast<LPARAM>(throbber_icons_[throbber_frame_]));
}
-void GlassBrowserFrameView::Observe(NotificationType type,
+void GlassBrowserFrameView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::PROFILE_CACHED_INFO_CHANGED:
+ switch (type) {
+ case chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED:
UpdateAvatarInfo();
LayoutAvatar();
break;
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.h b/chrome/browser/ui/views/frame/glass_browser_frame_view.h
index 79a083e..ea6aba4 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.h
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.h
@@ -82,7 +82,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
void DisplayNextThrobberFrame();
// NotificationObserver implementation:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 37f84c4..1920b04 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/browser/ui/views/toolbar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -206,7 +207,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame,
AddChildView(avatar_button_.get());
UpdateAvatarInfo();
if (!browser_view_->IsOffTheRecord()) {
- registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED,
+ registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
NotificationService::AllSources());
}
}
@@ -507,11 +508,11 @@ SkBitmap OpaqueBrowserFrameView::GetFaviconForTabIconView() {
///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameView, protected:
-void OpaqueBrowserFrameView::Observe(NotificationType type,
+void OpaqueBrowserFrameView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::PROFILE_CACHED_INFO_CHANGED:
+ switch (type) {
+ case chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED:
UpdateAvatarInfo();
LayoutAvatar();
break;
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
index c73573d..bcf4e79 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
@@ -101,7 +101,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
protected:
// NotificationObserver implementation:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc
index dd48600..3886e14 100644
--- a/chrome/browser/ui/views/html_dialog_view.cc
+++ b/chrome/browser/ui/views/html_dialog_view.cc
@@ -10,9 +10,9 @@
#include "chrome/browser/ui/views/window.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/native_web_keyboard_event.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 "ui/base/keycodes/keyboard_codes.h"
#include "views/events/event.h"
#include "views/widget/root_view.h"
@@ -251,33 +251,33 @@ void HtmlDialogView::InitDialog() {
this);
notification_registrar_.Add(
this,
- NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB,
+ content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB,
Source<TabContents>(tab_contents()));
notification_registrar_.Add(
this,
- NotificationType::LOAD_COMPLETED_MAIN_FRAME,
+ content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
Source<TabContents>(tab_contents()));
DOMView::LoadURL(GetDialogContentURL());
}
-void HtmlDialogView::Observe(NotificationType type,
+void HtmlDialogView::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: {
RenderWidgetHost* rwh = Details<RenderWidgetHost>(details).ptr();
notification_registrar_.Add(
this,
- NotificationType::RENDER_WIDGET_HOST_DID_PAINT,
+ content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT,
Source<RenderWidgetHost>(rwh));
break;
}
- case NotificationType::LOAD_COMPLETED_MAIN_FRAME:
+ case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME:
if (state_ == INITIALIZED)
state_ = LOADED;
break;
- case NotificationType::RENDER_WIDGET_HOST_DID_PAINT:
+ case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT:
if (state_ == LOADED) {
state_ = PAINTED;
#if defined(OS_CHROMEOS)
@@ -287,7 +287,7 @@ void HtmlDialogView::Observe(NotificationType type,
}
break;
default:
- NOTREACHED() << "unknown type" << type.value;
+ NOTREACHED() << "unknown type" << type;
}
}
diff --git a/chrome/browser/ui/views/html_dialog_view.h b/chrome/browser/ui/views/html_dialog_view.h
index cc06018..06e8a56 100644
--- a/chrome/browser/ui/views/html_dialog_view.h
+++ b/chrome/browser/ui/views/html_dialog_view.h
@@ -85,7 +85,7 @@ class HtmlDialogView
virtual void CloseContents(TabContents* source) OVERRIDE;
// Overridden from NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9b3b79f..b87739b 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -36,6 +36,7 @@
#include "chrome/browser/ui/views/location_bar/selected_keyword_view.h"
#include "chrome/browser/ui/views/location_bar/star_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
@@ -319,7 +320,7 @@ void LocationBarView::UpdatePageActions() {
RefreshPageActionViews();
if (page_action_views_.size() != count_before) {
NotificationService::current()->Notify(
- NotificationType::EXTENSION_PAGE_ACTION_COUNT_CHANGED,
+ chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
Source<LocationBar>(this),
NotificationService::NoDetails());
}
@@ -333,7 +334,7 @@ void LocationBarView::InvalidatePageActions() {
DeletePageActionViews();
if (page_action_views_.size() != count_before) {
NotificationService::current()->Notify(
- NotificationType::EXTENSION_PAGE_ACTION_COUNT_CHANGED,
+ chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
Source<LocationBar>(this),
NotificationService::NoDetails());
}
@@ -984,7 +985,7 @@ void LocationBarView::RefreshPageActionViews() {
if (old_visibility.find(action) == old_visibility.end() ||
old_visibility[action] != (*i)->IsVisible()) {
NotificationService::current()->Notify(
- NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
+ chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
Source<ExtensionAction>(action),
Details<TabContents>(contents));
}
@@ -1239,10 +1240,10 @@ void LocationBarView::OnTemplateURLServiceChanged() {
ShowFirstRunBubble(bubble_type_);
}
-void LocationBarView::Observe(NotificationType type,
+void LocationBarView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type.value == NotificationType::PREF_CHANGED) {
+ if (type == chrome::NOTIFICATION_PREF_CHANGED) {
std::string* name = Details<std::string>(details).ptr();
if (*name == prefs::kEditBookmarksEnabled)
Update(NULL);
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h
index f3d024d..89dc545 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.h
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -267,7 +267,7 @@ class LocationBarView : public LocationBar,
virtual void OnTemplateURLServiceChanged() OVERRIDE;
// Overridden from NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index b0566a1..1b8dcf5 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -15,11 +15,12 @@
#include "chrome/browser/notifications/notification_options_menu_model.h"
#include "chrome/browser/ui/views/bubble/bubble_border.h"
#include "chrome/browser/ui/views/notifications/balloon_view_host.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.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 "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -357,8 +358,9 @@ void BalloonViewImpl::Show(Balloon* balloon) {
html_container_->Show();
frame_container_->Show();
- notification_registrar_.Add(this,
- NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon));
+ notification_registrar_.Add(
+ this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED,
+ Source<Balloon>(balloon));
}
void BalloonViewImpl::RunOptionsMenu(const gfx::Point& pt) {
@@ -488,17 +490,18 @@ void BalloonViewImpl::OnBoundsChanged(const gfx::Rect& previous_bounds) {
SizeContentsWindow();
}
-void BalloonViewImpl::Observe(NotificationType type,
+void BalloonViewImpl::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type != NotificationType::NOTIFY_BALLOON_DISCONNECTED) {
+ if (type != chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED) {
NOTREACHED();
return;
}
// If the renderer process attached to this balloon is disconnected
// (e.g., because of a crash), we want to close the balloon.
- notification_registrar_.Remove(this,
- NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_));
+ notification_registrar_.Remove(
+ this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED,
+ Source<Balloon>(balloon_));
Close(false);
}
diff --git a/chrome/browser/ui/views/notifications/balloon_view.h b/chrome/browser/ui/views/notifications/balloon_view.h
index a52598c..be1195e 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.h
+++ b/chrome/browser/ui/views/notifications/balloon_view.h
@@ -80,7 +80,7 @@ class BalloonViewImpl : public BalloonView,
views::Button* sender, const views::Event&) OVERRIDE;
// NotificationObserver interface.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 32c65d9..08b65b9 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h"
#include "chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h"
#include "googleurl/src/gurl.h"
@@ -144,9 +145,9 @@ OmniboxViewViews::OmniboxViewViews(AutocompleteEditController* controller,
}
OmniboxViewViews::~OmniboxViewViews() {
- NotificationService::current()->Notify(NotificationType::OMNIBOX_DESTROYED,
- Source<OmniboxViewViews>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_OMNIBOX_DESTROYED, Source<OmniboxViewViews>(this),
+ NotificationService::NoDetails());
// Explicitly teardown members which have a reference to us. Just to be safe
// we want them to be destroyed before destroying any other internal state.
popup_view_.reset();
@@ -564,10 +565,10 @@ int OmniboxViewViews::OnPerformDrop(const views::DropTargetEvent& event) {
////////////////////////////////////////////////////////////////////////////////
// OmniboxViewViews, NotificationObserver implementation:
-void OmniboxViewViews::Observe(NotificationType type,
+void OmniboxViewViews::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(type == NotificationType::BROWSER_THEME_CHANGED);
+ DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED);
SetBaseColor();
}
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.h b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
index 3ce4b72..7b3ae8f 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
@@ -128,7 +128,7 @@ class OmniboxViewViews : public views::View,
virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE;
// NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index da20ab8..f7306e1 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/user_metrics.h"
#include "content/common/notification_service.h"
@@ -482,9 +483,9 @@ OmniboxViewWin::OmniboxViewWin(const gfx::Font& font,
}
OmniboxViewWin::~OmniboxViewWin() {
- NotificationService::current()->Notify(NotificationType::OMNIBOX_DESTROYED,
- Source<OmniboxViewWin>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_OMNIBOX_DESTROYED, Source<OmniboxViewWin>(this),
+ NotificationService::NoDetails());
// Explicitly release the text object model now that we're done with it, and
// before we free the library. If the library gets unloaded before this
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc
index 3f99810..00c8823 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc
@@ -26,15 +26,15 @@ TabContentsContainer::~TabContentsContainer() {
////////////////////////////////////////////////////////////////////////////////
// TabContentsContainer, NotificationObserver implementation:
-void TabContentsContainer::Observe(NotificationType type,
+void TabContentsContainer::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type == NotificationType::RENDER_VIEW_HOST_CHANGED) {
+ if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) {
RenderViewHostSwitchedDetails* switched_details =
Details<RenderViewHostSwitchedDetails>(details).ptr();
RenderViewHostChanged(switched_details->old_host,
switched_details->new_host);
- } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) {
+ } else if (type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED) {
TabContentsDestroyed(Source<TabContents>(source).ptr());
} else {
NOTREACHED();
@@ -56,11 +56,11 @@ void TabContentsContainer::AddObservers() {
// shown and getting focused. We need to keep track of that so we install
// the focus subclass on the shown HWND so we intercept focus change events.
registrar_.Add(this,
- NotificationType::RENDER_VIEW_HOST_CHANGED,
+ content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
Source<NavigationController>(&tab_contents_->controller()));
registrar_.Add(this,
- NotificationType::TAB_CONTENTS_DESTROYED,
+ content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(tab_contents_));
}
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h
index 7bb0338..da28347 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h
@@ -42,7 +42,7 @@ class TabContentsContainer : public views::View,
void SetReservedContentsRect(const gfx::Rect& reserved_rect);
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h
index f0bf995..2b9a427 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h
@@ -44,7 +44,7 @@ class TabContentsContainer : public views::View,
void SetReservedContentsRect(const gfx::Rect& reserved_rect);
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index fbbc24e..e8cfdb95 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/ui/tabs/tab_menu_model.h"
#include "chrome/browser/ui/views/tabs/base_tab_strip.h"
#include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -137,7 +138,7 @@ BrowserTabStripController::BrowserTabStripController(Browser* browser,
model_->AddObserver(this);
notification_registrar_.Add(this,
- NotificationType::TAB_CLOSEABLE_STATE_CHANGED,
+ chrome::NOTIFICATION_TAB_CLOSEABLE_STATE_CHANGED,
NotificationService::AllSources());
}
@@ -403,9 +404,9 @@ void BrowserTabStripController::TabBlockedStateChanged(
////////////////////////////////////////////////////////////////////////////////
// BrowserTabStripController, NotificationObserver implementation:
-void BrowserTabStripController::Observe(NotificationType type,
+void BrowserTabStripController::Observe(int type,
const NotificationSource& source, const NotificationDetails& details) {
- DCHECK(type.value == NotificationType::TAB_CLOSEABLE_STATE_CHANGED);
+ DCHECK(type == chrome::NOTIFICATION_TAB_CLOSEABLE_STATE_CHANGED);
// Note that this notification may be fired during a model mutation and
// possibly before the tabstrip has processed the change.
// Here, we just re-layout each existing tab to reflect the change in its
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h
index 8d5622f..f1a2f85 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h
@@ -92,7 +92,7 @@ class BrowserTabStripController : public TabStripController,
int model_index) OVERRIDE;
// NotificationObserver implementation:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
index 2af3101..c499bcb 100644
--- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
@@ -397,7 +397,7 @@ void DraggedTabController::InitTabDragData(BaseTab* tab,
drag_data->source_model_index);
drag_data->pinned = source_tabstrip_->IsTabPinned(tab);
registrar_.Add(this,
- NotificationType::TAB_CONTENTS_DESTROYED,
+ content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(drag_data->contents->tab_contents()));
// We need to be the delegate so we receive messages about stuff, otherwise
@@ -471,10 +471,10 @@ DraggedTabController::GetJavaScriptDialogCreator() {
///////////////////////////////////////////////////////////////////////////////
// DraggedTabController, NotificationObserver implementation:
-void DraggedTabController::Observe(NotificationType type,
+void DraggedTabController::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK_EQ(type.value, NotificationType::TAB_CONTENTS_DESTROYED);
+ DCHECK_EQ(type, content::NOTIFICATION_TAB_CONTENTS_DESTROYED);
TabContents* destroyed_contents = Source<TabContents>(source).ptr();
for (size_t i = 0; i < drag_data_.size(); ++i) {
if (drag_data_[i].contents->tab_contents() == destroyed_contents) {
diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.h b/chrome/browser/ui/views/tabs/dragged_tab_controller.h
index c59aad7..0ef7bc3 100644
--- a/chrome/browser/ui/views/tabs/dragged_tab_controller.h
+++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.h
@@ -146,7 +146,7 @@ class DraggedTabController : public TabContentsDelegate,
GetJavaScriptDialogCreator() OVERRIDE;
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/theme_install_bubble_view.cc b/chrome/browser/ui/views/theme_install_bubble_view.cc
index b099af95..c3e09e4 100644
--- a/chrome/browser/ui/views/theme_install_bubble_view.cc
+++ b/chrome/browser/ui/views/theme_install_bubble_view.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/theme_install_bubble_view.h"
#include "base/utf_string_conversions.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
@@ -47,27 +48,27 @@ ThemeInstallBubbleView::ThemeInstallBubbleView(TabContents* tab_contents)
// Close when theme has been installed.
registrar_.Add(
this,
- NotificationType::BROWSER_THEME_CHANGED,
+ chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
NotificationService::AllSources());
// Close when we are installing an extension, not a theme.
registrar_.Add(
this,
- NotificationType::NO_THEME_DETECTED,
+ chrome::NOTIFICATION_NO_THEME_DETECTED,
NotificationService::AllSources());
registrar_.Add(
this,
- NotificationType::EXTENSION_INSTALLED,
+ chrome::NOTIFICATION_EXTENSION_INSTALLED,
NotificationService::AllSources());
registrar_.Add(
this,
- NotificationType::EXTENSION_INSTALL_ERROR,
+ chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
NotificationService::AllSources());
// Don't let the bubble overlap the confirm dialog.
registrar_.Add(
this,
- NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
+ chrome::NOTIFICATION_EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
NotificationService::AllSources());
popup_ = new views::Widget;
@@ -156,7 +157,7 @@ void ThemeInstallBubbleView::Close() {
}
}
-void ThemeInstallBubbleView::Observe(NotificationType type,
+void ThemeInstallBubbleView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
Close();
diff --git a/chrome/browser/ui/views/theme_install_bubble_view.h b/chrome/browser/ui/views/theme_install_bubble_view.h
index 6463a5d..08aacc8 100644
--- a/chrome/browser/ui/views/theme_install_bubble_view.h
+++ b/chrome/browser/ui/views/theme_install_bubble_view.h
@@ -37,7 +37,7 @@ class ThemeInstallBubbleView : public NotificationObserver,
virtual ~ThemeInstallBubbleView();
// NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index b1edf03..046b1b3 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/browser/ui/views/wrench_menu.h"
#include "chrome/browser/upgrade_detector.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/accessibility/browser_accessibility_state.h"
#include "content/browser/user_metrics.h"
@@ -103,9 +104,10 @@ ToolbarView::ToolbarView(Browser* browser)
IDR_LOCATIONBG_POPUPMODE_EDGE);
}
- registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED,
+ registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::MODULE_INCOMPATIBILITY_BADGE_CHANGE,
+ registrar_.Add(this,
+ chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE,
NotificationService::AllSources());
}
@@ -404,17 +406,18 @@ void ToolbarView::ButtonPressed(views::Button* sender,
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, NotificationObserver implementation:
-void ToolbarView::Observe(NotificationType type,
+void ToolbarView::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type == NotificationType::PREF_CHANGED) {
+ if (type == chrome::NOTIFICATION_PREF_CHANGED) {
std::string* pref_name = Details<std::string>(details).ptr();
if (*pref_name == prefs::kShowHomeButton) {
Layout();
SchedulePaint();
}
- } else if (type == NotificationType::UPGRADE_RECOMMENDED ||
- type == NotificationType::MODULE_INCOMPATIBILITY_BADGE_CHANGE) {
+ } else if (
+ type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED ||
+ type == chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE) {
UpdateAppMenuBadge();
}
}
diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h
index ad5842c..4874dfb 100644
--- a/chrome/browser/ui/views/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar_view.h
@@ -110,7 +110,7 @@ class ToolbarView : public AccessiblePaneView,
OVERRIDE;
// Overridden from NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 93abf2a..c08882f 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -16,10 +16,10 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/user_metrics.h"
+#include "content/common/content_notification_types.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -438,7 +438,7 @@ class WrenchMenu::ZoomView : public WrenchMenuView,
UpdateZoomControls();
registrar_.Add(
- this, NotificationType::ZOOM_LEVEL_CHANGED,
+ this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
Source<HostZoomMap>(menu->browser_->profile()->GetHostZoomMap()));
}
@@ -488,10 +488,10 @@ class WrenchMenu::ZoomView : public WrenchMenuView,
}
// NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK_EQ(NotificationType::ZOOM_LEVEL_CHANGED, type.value);
+ DCHECK_EQ(content::NOTIFICATION_ZOOM_LEVEL_CHANGED, type);
UpdateZoomControls();
}