diff options
Diffstat (limited to 'chrome/browser/chromeos')
71 files changed, 246 insertions, 215 deletions
diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index 81f9e61..54e04ab 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -23,6 +23,7 @@ #include "chrome/browser/chromeos/login/authentication_notification_details.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/network_state_notifier.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" @@ -342,9 +343,9 @@ void BootTimesLoader::RecordLoginAttempted() { AddLoginTimeMarker("LoginStarted", false); if (!have_registered_) { have_registered_ = true; - registrar_.Add(this, NotificationType::LOAD_START, + registrar_.Add(this, content::NOTIFICATION_LOAD_START, NotificationService::AllSources()); - registrar_.Add(this, NotificationType::LOGIN_AUTHENTICATION, + registrar_.Add(this, chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources()); } } @@ -360,18 +361,18 @@ void BootTimesLoader::AddLogoutTimeMarker( } void BootTimesLoader::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::LOGIN_AUTHENTICATION) { + if (type == chrome::NOTIFICATION_LOGIN_AUTHENTICATION) { Details<AuthenticationNotificationDetails> auth_details(details); if (auth_details->success()) { AddLoginTimeMarker("Authenticate", true); RecordCurrentStats(kLoginSuccess); - registrar_.Remove(this, NotificationType::LOGIN_AUTHENTICATION, + registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources()); } - } else if (type == NotificationType::LOAD_START) { + } else if (type == content::NOTIFICATION_LOAD_START) { // Make sure it's not some page load initiated by OOBE/login screen. if (!UserManager::Get()->user_is_logged_in()) return; @@ -383,7 +384,7 @@ void BootTimesLoader::Observe( AddLoginTimeMarker("LoginDone", true); RecordCurrentStats(kChromeFirstRender); // Post chrome first render stat. - registrar_.Remove(this, NotificationType::LOAD_START, + registrar_.Remove(this, content::NOTIFICATION_LOAD_START, NotificationService::AllSources()); // Don't swamp the FILE thread right away. BrowserThread::PostDelayedTask( diff --git a/chrome/browser/chromeos/boot_times_loader.h b/chrome/browser/chromeos/boot_times_loader.h index ac338d8..f0dd7f4 100644 --- a/chrome/browser/chromeos/boot_times_loader.h +++ b/chrome/browser/chromeos/boot_times_loader.h @@ -101,7 +101,7 @@ class BootTimesLoader void RecordLoginAttempted(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/cros/login_library.cc b/chrome/browser/chromeos/cros/login_library.cc index d9f3734..af42d4a 100644 --- a/chrome/browser/chromeos/cros/login_library.cc +++ b/chrome/browser/chromeos/cros/login_library.cc @@ -13,9 +13,9 @@ #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" #include "chrome/browser/policy/proto/device_management_backend.pb.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" namespace em = enterprise_management; namespace chromeos { @@ -171,10 +171,10 @@ class LoginLibraryImpl : public LoginLibrary { void CompleteSetOwnerKey(bool value) { VLOG(1) << "Owner key generation: " << (value ? "success" : "fail"); - NotificationType result = - NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; + int result = + chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; if (!value) - result = NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED; + result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; // Whether we exported the public key or not, send a notification indicating // that we're done with this attempt. diff --git a/chrome/browser/chromeos/cros_settings.cc b/chrome/browser/chromeos/cros_settings.cc index 0348a1e..8d71802 100644 --- a/chrome/browser/chromeos/cros_settings.cc +++ b/chrome/browser/chromeos/cros_settings.cc @@ -9,9 +9,10 @@ #include "base/values.h" #include "chrome/browser/chromeos/cros_settings_provider.h" #include "chrome/browser/chromeos/user_cros_settings_provider.h" +#include "chrome/common/chrome_notification_types.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" namespace chromeos { @@ -38,7 +39,7 @@ void CrosSettings::FireObservers(const char* path) { NotificationObserverList::Iterator it(*(observer_iterator->second)); NotificationObserver* observer; while ((observer = it.GetNext()) != NULL) { - observer->Observe(NotificationType::SYSTEM_SETTING_CHANGED, + observer->Observe(chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED, Source<CrosSettings>(this), Details<std::string>(&path_str)); } diff --git a/chrome/browser/chromeos/enterprise_extension_observer.cc b/chrome/browser/chromeos/enterprise_extension_observer.cc index 5c7e4f4..5a4054a 100644 --- a/chrome/browser/chromeos/enterprise_extension_observer.cc +++ b/chrome/browser/chromeos/enterprise_extension_observer.cc @@ -8,6 +8,7 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/login_library.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" namespace chromeos { @@ -16,15 +17,15 @@ EnterpriseExtensionObserver::EnterpriseExtensionObserver(Profile* profile) : profile_(profile) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); registrar_.Add(this, - NotificationType::EXTENSION_INSTALLED, + chrome::NOTIFICATION_EXTENSION_INSTALLED, Source<Profile>(profile_)); } -void EnterpriseExtensionObserver::Observe(NotificationType type, +void EnterpriseExtensionObserver::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(type == NotificationType::EXTENSION_INSTALLED); + DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED); if (Source<Profile>(source).ptr() != profile_) { return; } diff --git a/chrome/browser/chromeos/enterprise_extension_observer.h b/chrome/browser/chromeos/enterprise_extension_observer.h index 014cf22..0f2a5bb 100644 --- a/chrome/browser/chromeos/enterprise_extension_observer.h +++ b/chrome/browser/chromeos/enterprise_extension_observer.h @@ -7,11 +7,11 @@ #pragma once #include "chrome/common/extensions/extension.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" class FilePath; class Profile; @@ -26,7 +26,7 @@ class EnterpriseExtensionObserver explicit EnterpriseExtensionObserver(Profile* profile); virtual ~EnterpriseExtensionObserver() {} - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/frame/layout_mode_button.cc b/chrome/browser/chromeos/frame/layout_mode_button.cc index ffc2f41..be24ffa 100644 --- a/chrome/browser/chromeos/frame/layout_mode_button.cc +++ b/chrome/browser/chromeos/frame/layout_mode_button.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/wm_ipc.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" @@ -42,17 +43,17 @@ bool LayoutModeButton::HitTest(const gfx::Point& l) const { return ImageButton::HitTest(point); } -void LayoutModeButton::Observe(NotificationType type, +void LayoutModeButton::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::LAYOUT_MODE_CHANGED); + DCHECK(type == chrome::NOTIFICATION_LAYOUT_MODE_CHANGED); UpdateForCurrentLayoutMode(); } void LayoutModeButton::Init() { WmIpc* wm_ipc = WmIpc::instance(); registrar_.Add(this, - NotificationType::LAYOUT_MODE_CHANGED, + chrome::NOTIFICATION_LAYOUT_MODE_CHANGED, Source<WmIpc>(wm_ipc)); UpdateForCurrentLayoutMode(); } diff --git a/chrome/browser/chromeos/frame/layout_mode_button.h b/chrome/browser/chromeos/frame/layout_mode_button.h index 3e7e98d..82248a9 100644 --- a/chrome/browser/chromeos/frame/layout_mode_button.h +++ b/chrome/browser/chromeos/frame/layout_mode_button.h @@ -30,7 +30,7 @@ class LayoutModeButton : public views::ImageButton, virtual bool HitTest(const gfx::Point& l) const 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/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc index 0150a09..66b3ffb 100644 --- a/chrome/browser/chromeos/frame/panel_controller.cc +++ b/chrome/browser/chromeos/frame/panel_controller.cc @@ -20,6 +20,7 @@ #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/wm_ipc.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -389,7 +390,7 @@ bool PanelController::PanelClientEvent(GdkEventClient* event) { expanded_ = new_state; State state = new_state ? EXPANDED : MINIMIZED; NotificationService::current()->Notify( - NotificationType::PANEL_STATE_CHANGED, + chrome::NOTIFICATION_PANEL_STATE_CHANGED, Source<PanelController>(this), Details<State>(&state)); } diff --git a/chrome/browser/chromeos/input_method/input_method_manager.cc b/chrome/browser/chromeos/input_method/input_method_manager.cc index 5d0c565..da81d24 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager.cc @@ -82,7 +82,7 @@ class InputMethodManagerImpl : public InputMethodManager, // Chrome in case of a sudden crash, we have a way to do it from an // upstart script. See crosbug.com/6515 and crosbug.com/6995 for // details. - notification_registrar_.Add(this, NotificationType::APP_TERMINATING, + notification_registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, NotificationService::AllSources()); ibus_controller_ = input_method::IBusController::Create(); @@ -860,11 +860,11 @@ class InputMethodManagerImpl : public InputMethodManager, } // NotificationObserver implementation: - void Observe(NotificationType type, + void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { // Stop the input method daemon on browser shutdown. - if (type.value == NotificationType::APP_TERMINATING) { + if (type == content::NOTIFICATION_APP_TERMINATING) { notification_registrar_.RemoveAll(); StopInputMethodDaemon(); #if !defined(TOUCH_UI) diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc index 25697ed..501f0ff 100644 --- a/chrome/browser/chromeos/locale_change_guard.cc +++ b/chrome/browser/chromeos/locale_change_guard.cc @@ -12,6 +12,7 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/user_metrics.h" @@ -43,14 +44,14 @@ LocaleChangeGuard::LocaleChangeGuard(Profile* profile) note_(NULL), reverted_(false) { DCHECK(profile_); - registrar_.Add(this, NotificationType::OWNERSHIP_CHECKED, + registrar_.Add(this, chrome::NOTIFICATION_OWNERSHIP_CHECKED, NotificationService::AllSources()); } LocaleChangeGuard::~LocaleChangeGuard() {} void LocaleChangeGuard::OnLogin() { - registrar_.Add(this, NotificationType::LOAD_COMPLETED_MAIN_FRAME, + registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, NotificationService::AllSources()); } @@ -74,22 +75,22 @@ void LocaleChangeGuard::RevertLocaleChange(const ListValue* list) { browser->ExecuteCommand(IDC_EXIT); } -void LocaleChangeGuard::Observe(NotificationType type, +void LocaleChangeGuard::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { if (profile_ == NULL) { NOTREACHED(); return; } - switch (type.value) { - case NotificationType::LOAD_COMPLETED_MAIN_FRAME: { + switch (type) { + case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME: { // We need to perform locale change check only once, so unsubscribe. - registrar_.Remove(this, NotificationType::LOAD_COMPLETED_MAIN_FRAME, + registrar_.Remove(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, NotificationService::AllSources()); Check(); break; } - case NotificationType::OWNERSHIP_CHECKED: { + case chrome::NOTIFICATION_OWNERSHIP_CHECKED: { if (UserManager::Get()->current_user_is_owner()) { PrefService* local_state = g_browser_process->local_state(); if (local_state) { diff --git a/chrome/browser/chromeos/locale_change_guard.h b/chrome/browser/chromeos/locale_change_guard.h index f2b369a..bcab9af 100644 --- a/chrome/browser/chromeos/locale_change_guard.h +++ b/chrome/browser/chromeos/locale_change_guard.h @@ -11,9 +11,9 @@ #include "base/lazy_instance.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chromeos/notifications/system_notification.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" class ListValue; class NotificationDetails; @@ -45,7 +45,7 @@ class LocaleChangeGuard : public NotificationObserver { void Check(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc index 2b763b8..a4f00b6 100644 --- a/chrome/browser/chromeos/login/base_login_display_host.cc +++ b/chrome/browser/chromeos/login/base_login_display_host.cc @@ -28,8 +28,8 @@ #include "chrome/browser/policy/browser_policy_connector.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/pref_names.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "googleurl/src/gurl.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" #include "ui/base/resource/resource_bundle.h" @@ -97,7 +97,7 @@ BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) // will block the shutdown. registrar_.Add( this, - NotificationType::APP_EXITING, + content::NOTIFICATION_APP_EXITING, NotificationService::AllSources()); DCHECK(default_host_ == NULL); default_host_ = this; @@ -194,10 +194,10 @@ void BaseLoginDisplayHost::StartSignInScreen() { // BaseLoginDisplayHost -------------------------------------------------------- -void BaseLoginDisplayHost::Observe(NotificationType type, +void BaseLoginDisplayHost::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - CHECK(type == NotificationType::APP_EXITING); + CHECK(type == content::NOTIFICATION_APP_EXITING); registrar_.RemoveAll(); MessageLoop::current()->DeleteSoon(FROM_HERE, this); diff --git a/chrome/browser/chromeos/login/base_login_display_host.h b/chrome/browser/chromeos/login/base_login_display_host.h index 91da484..f4287d6 100644 --- a/chrome/browser/chromeos/login/base_login_display_host.h +++ b/chrome/browser/chromeos/login/base_login_display_host.h @@ -52,7 +52,7 @@ class BaseLoginDisplayHost : public LoginDisplayHost, private: // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 3b7917a..15f8985 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -28,11 +28,12 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/views/window.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/pref_names.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "views/widget/widget.h" @@ -80,7 +81,7 @@ ExistingUserController::ExistingUserController(LoginDisplayHost* host) login_display_ = host_->CreateLoginDisplay(this); registrar_.Add(this, - NotificationType::LOGIN_USER_IMAGE_CHANGED, + chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, NotificationService::AllSources()); } @@ -114,10 +115,10 @@ void ExistingUserController::Init(const UserVector& users) { // ExistingUserController, NotificationObserver implementation: // -void ExistingUserController::Observe(NotificationType type, +void ExistingUserController::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::LOGIN_USER_IMAGE_CHANGED) + if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) return; UserManager::User* user = Details<UserManager::User>(details).ptr(); diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index ef7179a..e12457a 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h @@ -69,7 +69,7 @@ class ExistingUserController : public LoginDisplay::Delegate, virtual void OnStartEnterpriseEnrollment() OVERRIDE; // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/google_authenticator.cc b/chrome/browser/chromeos/login/google_authenticator.cc index 3ecece9..80cb271 100644 --- a/chrome/browser/chromeos/login/google_authenticator.cc +++ b/chrome/browser/chromeos/login/google_authenticator.cc @@ -24,6 +24,7 @@ #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/net/gaia/gaia_auth_fetcher.h" #include "chrome/common/net/gaia/gaia_constants.h" @@ -165,7 +166,7 @@ void GoogleAuthenticator::LoginOffTheRecord() { if (CrosLibrary::Get()->GetCryptohomeLibrary()->MountForBwsi(&mount_error)) { AuthenticationNotificationDetails details(true); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); consumer_->OnOffTheRecordLoginSuccess(); @@ -275,7 +276,7 @@ void GoogleAuthenticator::OnLoginSuccess( // Send notification of success AuthenticationNotificationDetails details(true); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); @@ -350,7 +351,7 @@ void GoogleAuthenticator::OnLoginFailure(const LoginFailure& error) { // Send notification of failure AuthenticationNotificationDetails details(false); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); LOG(WARNING) << "Login failed: " << error.GetErrorString(); diff --git a/chrome/browser/chromeos/login/login_html_dialog.cc b/chrome/browser/chromeos/login/login_html_dialog.cc index bfc84fe..a72d52b 100644 --- a/chrome/browser/chromeos/login/login_html_dialog.cc +++ b/chrome/browser/chromeos/login/login_html_dialog.cc @@ -64,9 +64,9 @@ void LoginHtmlDialog::Show() { } if (bubble_frame_view_) { bubble_frame_view_->StartThrobber(); - notification_registrar_.Add(this, - NotificationType::LOAD_COMPLETED_MAIN_FRAME, - NotificationService::AllSources()); + notification_registrar_.Add( + this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, + NotificationService::AllSources()); } html_view->InitDialog(); html_view->GetWidget()->Show(); @@ -128,10 +128,10 @@ bool LoginHtmlDialog::HandleContextMenu(const ContextMenuParams& params) { return true; } -void LoginHtmlDialog::Observe(NotificationType type, +void LoginHtmlDialog::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type.value == NotificationType::LOAD_COMPLETED_MAIN_FRAME); + DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); if (bubble_frame_view_) bubble_frame_view_->StopThrobber(); } diff --git a/chrome/browser/chromeos/login/login_html_dialog.h b/chrome/browser/chromeos/login/login_html_dialog.h index 4fd0953..9a8cc9e 100644 --- a/chrome/browser/chromeos/login/login_html_dialog.h +++ b/chrome/browser/chromeos/login/login_html_dialog.h @@ -69,7 +69,7 @@ class LoginHtmlDialog : public HtmlDialogUIDelegate, virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc index e340751..3e0882c 100644 --- a/chrome/browser/chromeos/login/login_performer.cc +++ b/chrome/browser/chromeos/login/login_performer.cc @@ -21,11 +21,12 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" #include "content/browser/user_metrics.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -213,10 +214,10 @@ void LoginPerformer::OnCheckWhitelistCompleted(SignedSettings::ReturnCode code, // LoginPerformer, NotificationObserver implementation: // -void LoginPerformer::Observe(NotificationType type, +void LoginPerformer::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::SCREEN_LOCK_STATE_CHANGED) + if (type != chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED) return; bool is_screen_locked = *Details<bool>(details).ptr(); @@ -314,7 +315,7 @@ void LoginPerformer::RequestScreenLock() { DVLOG(1) << "Screen lock requested"; // Will receive notifications on screen unlock and delete itself. registrar_.Add(this, - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, NotificationService::AllSources()); if (ScreenLocker::default_screen_locker()) { DVLOG(1) << "Screen already locked"; diff --git a/chrome/browser/chromeos/login/login_performer.h b/chrome/browser/chromeos/login/login_performer.h index 641865d..95fb0f7 100644 --- a/chrome/browser/chromeos/login/login_performer.h +++ b/chrome/browser/chromeos/login/login_performer.h @@ -89,7 +89,7 @@ class LoginPerformer : public LoginStatusConsumer, const std::string& email); // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/owner_manager.cc b/chrome/browser/chromeos/login/owner_manager.cc index dd7ba1d..066a0a5 100644 --- a/chrome/browser/chromeos/login/owner_manager.cc +++ b/chrome/browser/chromeos/login/owner_manager.cc @@ -13,8 +13,8 @@ #include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" #include "content/browser/browser_thread.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" namespace chromeos { @@ -42,13 +42,13 @@ void OwnerManager::LoadOwnerKey() { BootTimesLoader::Get()->AddLoginTimeMarker("LoadOwnerKeyStart", false); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); VLOG(1) << "Loading owner key"; - NotificationType result = NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; + int result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; // If |public_key_| isn't empty, we already have the key, so don't // try to import again. if (public_key_.empty() && !utils_->ImportPublicKey(utils_->GetOwnerKeyFilePath(), &public_key_)) { - result = NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED; + result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; } // Whether we loaded the public key or not, send a notification indicating @@ -140,7 +140,7 @@ void OwnerManager::Verify(const BrowserThread::ID thread_id, BootTimesLoader::Get()->AddLoginTimeMarker("VerifyEnd", false); } -void OwnerManager::SendNotification(NotificationType type, +void OwnerManager::SendNotification(int type, const NotificationDetails& details) { NotificationService::current()->Notify( type, diff --git a/chrome/browser/chromeos/login/owner_manager.h b/chrome/browser/chromeos/login/owner_manager.h index c44cf2d..1ec50cb 100644 --- a/chrome/browser/chromeos/login/owner_manager.h +++ b/chrome/browser/chromeos/login/owner_manager.h @@ -16,7 +16,7 @@ class FilePath; class NotificationDetails; -class NotificationType; +class int; namespace chromeos { @@ -90,7 +90,7 @@ class OwnerManager : public base::RefCountedThreadSafe<OwnerManager> { private: // A helper method to send a notification on another thread. - void SendNotification(NotificationType type, + void SendNotification(int type, const NotificationDetails& details); // Calls back a key update delegate on a given thread. diff --git a/chrome/browser/chromeos/login/owner_manager_unittest.cc b/chrome/browser/chromeos/login/owner_manager_unittest.cc index 6c8a386..d539fde 100644 --- a/chrome/browser/chromeos/login/owner_manager_unittest.cc +++ b/chrome/browser/chromeos/login/owner_manager_unittest.cc @@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/scoped_temp_dir.h" #include "chrome/browser/chromeos/login/mock_owner_key_utils.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" #include "crypto/nss_util.h" #include "crypto/rsa_private_key.h" @@ -36,11 +37,11 @@ MockKeyLoadObserver::MockKeyLoadObserver(base::WaitableEvent* e) observed_(false) { registrar_.Add( this, - NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED, + chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED, NotificationService::AllSources()); registrar_.Add( this, - NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, + chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, NotificationService::AllSources()); } @@ -48,16 +49,16 @@ MockKeyLoadObserver::~MockKeyLoadObserver() { DCHECK(observed_); } -void MockKeyLoadObserver::Observe(NotificationType type, +void MockKeyLoadObserver::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { LOG(INFO) << "Observed key fetch event"; - if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { + if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { DCHECK(success_expected_); observed_ = true; if (event_) event_->Signal(); - } else if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED) { + } else if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED) { DCHECK(!success_expected_); observed_ = true; if (event_) diff --git a/chrome/browser/chromeos/login/owner_manager_unittest.h b/chrome/browser/chromeos/login/owner_manager_unittest.h index 65118c9..18b769a 100644 --- a/chrome/browser/chromeos/login/owner_manager_unittest.h +++ b/chrome/browser/chromeos/login/owner_manager_unittest.h @@ -14,10 +14,10 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/synchronization/waitable_event.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,7 +29,7 @@ class MockKeyLoadObserver : public NotificationObserver { virtual ~MockKeyLoadObserver(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/ownership_service.cc b/chrome/browser/chromeos/login/ownership_service.cc index 0927982..c0d08ee 100644 --- a/chrome/browser/chromeos/login/ownership_service.cc +++ b/chrome/browser/chromeos/login/ownership_service.cc @@ -32,7 +32,7 @@ OwnershipService::OwnershipService() ownership_status_(OWNERSHIP_UNKNOWN) { notification_registrar_.Add( this, - NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, + chrome::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, NotificationService::AllSources()); } @@ -149,10 +149,10 @@ void OwnershipService::StartVerifyAttempt(const std::string& data, return; } -void OwnershipService::Observe(NotificationType type, +void OwnershipService::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type.value == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { + if (type == chrome::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { SetStatus(OWNERSHIP_TAKEN); notification_registrar_.RemoveAll(); } else { diff --git a/chrome/browser/chromeos/login/ownership_service.h b/chrome/browser/chromeos/login/ownership_service.h index e31e501..d96102e 100644 --- a/chrome/browser/chromeos/login/ownership_service.h +++ b/chrome/browser/chromeos/login/ownership_service.h @@ -103,7 +103,7 @@ class OwnershipService : public NotificationObserver { OwnershipService(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc index e5444d5..33a02c2 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator.cc +++ b/chrome/browser/chromeos/login/parallel_authenticator.cc @@ -23,6 +23,7 @@ #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/net/gaia/gaia_auth_fetcher.h" #include "chrome/common/net/gaia/gaia_constants.h" @@ -130,7 +131,7 @@ void ParallelAuthenticator::OnLoginSuccess( // Send notification of success AuthenticationNotificationDetails details(true); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); { @@ -148,7 +149,7 @@ void ParallelAuthenticator::OnOffTheRecordLoginSuccess() { // Send notification of success AuthenticationNotificationDetails details(true); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); consumer_->OnOffTheRecordLoginSuccess(); @@ -202,7 +203,7 @@ void ParallelAuthenticator::OnLoginFailure(const LoginFailure& error) { // Send notification of failure AuthenticationNotificationDetails details(false); NotificationService::current()->Notify( - NotificationType::LOGIN_AUTHENTICATION, + chrome::NOTIFICATION_LOGIN_AUTHENTICATION, NotificationService::AllSources(), Details<AuthenticationNotificationDetails>(&details)); LOG(WARNING) << "Login failed: " << error.GetErrorString(); diff --git a/chrome/browser/chromeos/login/screen_lock_view.cc b/chrome/browser/chromeos/login/screen_lock_view.cc index 8ffd17e..57f0f89 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.cc +++ b/chrome/browser/chromeos/login/screen_lock_view.cc @@ -14,6 +14,7 @@ #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "chrome/browser/chromeos/views/copy_background.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -116,7 +117,7 @@ void ScreenLockView::Layout() { void ScreenLockView::Init() { registrar_.Add(this, - NotificationType::LOGIN_USER_IMAGE_CHANGED, + chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, NotificationService::AllSources()); user_view_ = new UserView(this, @@ -250,10 +251,10 @@ bool ScreenLockView::HandleKeyEvent( } void ScreenLockView::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::LOGIN_USER_IMAGE_CHANGED || !user_view_) + if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) return; UserManager::User* user = Details<UserManager::User>(details).ptr(); diff --git a/chrome/browser/chromeos/login/screen_lock_view.h b/chrome/browser/chromeos/login/screen_lock_view.h index 561d793..e845585 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.h +++ b/chrome/browser/chromeos/login/screen_lock_view.h @@ -53,7 +53,7 @@ class ScreenLockView : public ThrobberHostView, virtual gfx::Size GetPreferredSize(); // NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 0ac3a1a..f13cede 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -41,6 +41,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/user_metrics.h" @@ -74,15 +75,15 @@ class ScreenLockObserver : public chromeos::ScreenLockLibrary::Observer, public NotificationObserver { public: ScreenLockObserver() { - registrar_.Add(this, NotificationType::LOGIN_USER_CHANGED, + registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, NotificationService::AllSources()); } // NotificationObserver overrides: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) OVERRIDE { - if (type == NotificationType::LOGIN_USER_CHANGED) { + if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) { // Register Screen Lock after login screen to make sure // we don't show the screen lock on top of the login screen by accident. if (chromeos::CrosLibrary::Get()->EnsureLoaded()) @@ -1112,7 +1113,7 @@ ScreenLocker::~ScreenLocker() { screen_locker_ = NULL; bool state = false; NotificationService::current()->Notify( - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, Source<ScreenLocker>(this), Details<bool>(&state)); if (CrosLibrary::Get()->EnsureLoaded()) @@ -1143,7 +1144,7 @@ void ScreenLocker::ScreenLockReady() { bool state = true; NotificationService::current()->Notify( - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, Source<ScreenLocker>(this), Details<bool>(&state)); if (CrosLibrary::Get()->EnsureLoaded()) diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc index c2d22cc..4d77a83 100644 --- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc +++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc @@ -16,10 +16,10 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/browser_dialogs.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/ui_test_utils.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "views/controls/textfield/textfield.h" @@ -33,7 +33,7 @@ class Waiter : public NotificationObserver { : browser_(browser), running_(false) { registrar_.Add(this, - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, NotificationService::AllSources()); handler_id_ = g_signal_connect( G_OBJECT(browser_->window()->GetNativeHandle()), @@ -48,10 +48,10 @@ class Waiter : public NotificationObserver { handler_id_); } - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::SCREEN_LOCK_STATE_CHANGED); + DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); if (running_) MessageLoop::current()->Quit(); } @@ -117,7 +117,7 @@ class ScreenLockerTest : public CrosInProcessBrowserTest { tester->EmulateWindowManagerReady(); if (!chromeos::ScreenLocker::GetTester()->IsLocked()) ui_test_utils::WaitForNotification( - NotificationType::SCREEN_LOCK_STATE_CHANGED); + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); EXPECT_TRUE(tester->IsLocked()); tester->InjectMockAuthenticator("", ""); @@ -139,7 +139,7 @@ class ScreenLockerTest : public CrosInProcessBrowserTest { tester->EmulateWindowManagerReady(); if (!tester->IsLocked()) { ui_test_utils::WaitForNotification( - NotificationType::SCREEN_LOCK_STATE_CHANGED); + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); } EXPECT_TRUE(tester->IsLocked()); } @@ -184,7 +184,7 @@ IN_PROC_BROWSER_TEST_F(ScreenLockerTest, DISABLED_TestBasic) { tester->EmulateWindowManagerReady(); if (!chromeos::ScreenLocker::GetTester()->IsLocked()) ui_test_utils::WaitForNotification( - NotificationType::SCREEN_LOCK_STATE_CHANGED); + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); // Test to make sure that the widget is actually appearing and is of // reasonable size, preventing a regression of diff --git a/chrome/browser/chromeos/login/touch_login_view.cc b/chrome/browser/chromeos/login/touch_login_view.cc index 74d0968..82e8d9e 100644 --- a/chrome/browser/chromeos/login/touch_login_view.cc +++ b/chrome/browser/chromeos/login/touch_login_view.cc @@ -8,6 +8,7 @@ #include "chrome/browser/ui/touch/frame/keyboard_container_view.h" #include "chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h" #include "chrome/browser/ui/views/dom_view.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" #include "ui/base/animation/slide_animation.h" @@ -53,16 +54,16 @@ void TouchLoginView::Init() { InitVirtualKeyboard(); registrar_.Add(this, - NotificationType::FOCUS_CHANGED_IN_PAGE, + content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, NotificationService::AllSources()); registrar_.Add(this, - NotificationType::TAB_CONTENTS_DESTROYED, + content::NOTIFICATION_TAB_CONTENTS_DESTROYED, NotificationService::AllSources()); registrar_.Add(this, - NotificationType::HIDE_KEYBOARD_INVOKED, + chrome::NOTIFICATION_HIDE_KEYBOARD_INVOKED, NotificationService::AllSources()); registrar_.Add(this, - NotificationType::SET_KEYBOARD_HEIGHT_INVOKED, + chrome::NOTIFICATION_SET_KEYBOARD_HEIGHT_INVOKED, NotificationService::AllSources()); } @@ -150,10 +151,10 @@ TouchLoginView::VirtualKeyboardType return NONE; } -void TouchLoginView::Observe(NotificationType type, +void TouchLoginView::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::FOCUS_CHANGED_IN_PAGE) { + if (type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE) { // Only modify the keyboard state if the currently active tab sent the // notification. const TabContents* current_tab = webui_login_->tab_contents(); @@ -167,12 +168,12 @@ void TouchLoginView::Observe(NotificationType type, // can be determined after tab switching. GetFocusedStateAccessor()->SetProperty( source_tab->property_bag(), editable); - } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) { + } else if (type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED) { GetFocusedStateAccessor()->DeleteProperty( Source<TabContents>(source).ptr()->property_bag()); - } else if (type == NotificationType::HIDE_KEYBOARD_INVOKED) { + } else if (type == chrome::NOTIFICATION_HIDE_KEYBOARD_INVOKED) { UpdateKeyboardAndLayout(false); - } else if (type == NotificationType::SET_KEYBOARD_HEIGHT_INVOKED) { + } else if (type == chrome::NOTIFICATION_SET_KEYBOARD_HEIGHT_INVOKED) { // TODO(penghuang) Allow extension conrtol the virtual keyboard directly // instead of using Notification. int height = *(Details<int>(details).ptr()); diff --git a/chrome/browser/chromeos/login/touch_login_view.h b/chrome/browser/chromeos/login/touch_login_view.h index a034bcf..134da21 100644 --- a/chrome/browser/chromeos/login/touch_login_view.h +++ b/chrome/browser/chromeos/login/touch_login_view.h @@ -59,7 +59,7 @@ class TouchLoginView : public WebUILoginView, VirtualKeyboardType DecideKeyboardStateForView(views::View* view); // 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/chromeos/login/user_image_screen.cc b/chrome/browser/chromeos/login/user_image_screen.cc index 113845f..0086099 100644 --- a/chrome/browser/chromeos/login/user_image_screen.cc +++ b/chrome/browser/chromeos/login/user_image_screen.cc @@ -10,8 +10,8 @@ #include "chrome/browser/chromeos/login/screen_observer.h" #include "chrome/browser/chromeos/login/user_image_view.h" #include "chrome/browser/chromeos/login/user_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "grit/theme_resources.h" #include "ui/base/resource/resource_bundle.h" @@ -32,7 +32,7 @@ UserImageScreen::UserImageScreen(ViewScreenDelegate* delegate) camera_controller_.set_frame_height(kFrameHeight); registrar_.Add( this, - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, NotificationService::AllSources()); } @@ -113,10 +113,10 @@ void UserImageScreen::OnDefaultImageSelected(int index) { delegate()->GetObserver()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); } -void UserImageScreen::Observe(NotificationType type, +void UserImageScreen::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::SCREEN_LOCK_STATE_CHANGED) + if (type != chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED) return; bool is_screen_locked = *Details<bool>(details).ptr(); diff --git a/chrome/browser/chromeos/login/user_image_screen.h b/chrome/browser/chromeos/login/user_image_screen.h index 7452fe6..d90f79a 100644 --- a/chrome/browser/chromeos/login/user_image_screen.h +++ b/chrome/browser/chromeos/login/user_image_screen.h @@ -39,7 +39,7 @@ class UserImageScreen: public ViewScreen<UserImageView>, virtual void OnDefaultImageSelected(int index); // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc index 56ad2c4..af71e8b 100644 --- a/chrome/browser/chromeos/login/user_manager.cc +++ b/chrome/browser/chromeos/login/user_manager.cc @@ -29,11 +29,11 @@ #include "chrome/browser/defaults.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/codec/png_codec.h" @@ -103,9 +103,10 @@ void UpdateOwnership(bool is_owner) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); g_user_manager.Get().set_current_user_is_owner(is_owner); - NotificationService::current()->Notify(NotificationType::OWNERSHIP_CHECKED, - NotificationService::AllSources(), - NotificationService::NoDetails()); + NotificationService::current()->Notify( + chrome::NOTIFICATION_OWNERSHIP_CHECKED, + NotificationService::AllSources(), + NotificationService::NoDetails()); if (is_owner) { // Also update cached value. UserCrosSettingsProvider::UpdateCachedOwner( @@ -537,7 +538,7 @@ void UserManager::OnImageLoaded(const std::string& username, if (should_save_image) SaveUserImage(username, image); NotificationService::current()->Notify( - NotificationType::LOGIN_USER_IMAGE_CHANGED, + chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, Source<UserManager>(this), Details<const User>(&user)); } @@ -552,7 +553,7 @@ UserManager::UserManager() current_user_is_owner_(false), current_user_is_new_(false), user_is_logged_in_(false) { - registrar_.Add(this, NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, + registrar_.Add(this, chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, NotificationService::AllSources()); } @@ -602,7 +603,7 @@ void RealTPMTokenInfoDelegate::GetTokenInfo(std::string* token_name, void UserManager::NotifyOnLogin() { NotificationService::current()->Notify( - NotificationType::LOGIN_USER_CHANGED, + chrome::NOTIFICATION_LOGIN_USER_CHANGED, Source<UserManager>(this), Details<const User>(&logged_in_user_)); @@ -629,10 +630,10 @@ void UserManager::NotifyOnLogin() { NewRunnableFunction(&CheckOwnership)); } -void UserManager::Observe(NotificationType type, +void UserManager::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { + if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableFunction(&CheckOwnership)); } diff --git a/chrome/browser/chromeos/login/user_manager.h b/chrome/browser/chromeos/login/user_manager.h index d7f09bb..625d173 100644 --- a/chrome/browser/chromeos/login/user_manager.h +++ b/chrome/browser/chromeos/login/user_manager.h @@ -126,7 +126,7 @@ class UserManager : public UserImageLoader::Delegate, bool save_image); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/login/views_oobe_display.cc b/chrome/browser/chromeos/login/views_oobe_display.cc index 847ad6f..3863d3f 100644 --- a/chrome/browser/chromeos/login/views_oobe_display.cc +++ b/chrome/browser/chromeos/login/views_oobe_display.cc @@ -12,8 +12,8 @@ #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/chromeos/wm_ipc.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "views/view.h" #include "views/widget/widget.h" @@ -62,7 +62,7 @@ class ContentView : public views::View { ~ContentView() { NotificationService::current()->Notify( - NotificationType::WIZARD_CONTENT_VIEW_DESTROYED, + chrome::NOTIFICATION_WIZARD_CONTENT_VIEW_DESTROYED, NotificationService::AllSources(), NotificationService::NoDetails()); } diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc index 962edd4..a23453b 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc +++ b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc @@ -16,6 +16,7 @@ #include "chrome/browser/extensions/extension_accessibility_api.h" #include "chrome/browser/extensions/extension_accessibility_api_constants.h" #include "chrome/browser/profiles/profile_manager.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" @@ -100,7 +101,7 @@ void AppendIndexOfCount(int index, int count, std::string* str) { namespace chromeos { void WizardAccessibilityHandler::Observe( - NotificationType type, + int type, const NotificationSource& source, const NotificationDetails& details) { const AccessibilityControlInfo *control_info = @@ -130,27 +131,27 @@ void WizardAccessibilityHandler::Speak(const char* speak_str, } void WizardAccessibilityHandler::DescribeAccessibilityEvent( - NotificationType event_type, + int event_type, const AccessibilityControlInfo* control_info, std::string* out_spoken_description, EarconType* out_earcon) { *out_spoken_description = std::string(); *out_earcon = NO_EARCON; - switch (event_type.value) { - case NotificationType::ACCESSIBILITY_CONTROL_FOCUSED: + switch (event_type) { + case chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED: DescribeControl(control_info, false, out_spoken_description, out_earcon); break; - case NotificationType::ACCESSIBILITY_CONTROL_ACTION: + case chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_ACTION: DescribeControl(control_info, true, out_spoken_description, out_earcon); break; - case NotificationType::ACCESSIBILITY_TEXT_CHANGED: + case chrome::NOTIFICATION_ACCESSIBILITY_TEXT_CHANGED: DescribeTextChanged(control_info, out_spoken_description, out_earcon); break; - case NotificationType::ACCESSIBILITY_MENU_OPENED: + case chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED: *out_earcon = EARCON_OBJECT_OPENED; break; - case NotificationType::ACCESSIBILITY_MENU_CLOSED: + case chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED: *out_earcon = EARCON_OBJECT_CLOSED; break; default: diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler.h b/chrome/browser/chromeos/login/wizard_accessibility_handler.h index b8542fc..7e4ea85 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_handler.h +++ b/chrome/browser/chromeos/login/wizard_accessibility_handler.h @@ -9,9 +9,9 @@ #include <string> #include "base/gtest_prod_util.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" class AccessibilityControlInfo; class AccessibilityTextBoxInfo; @@ -44,13 +44,13 @@ class WizardAccessibilityHandler : public NotificationObserver { private: // Override from NotificationObserver. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); // Get text to speak and an earcon identifier (which may be NONE) for any // accessibility event. - void DescribeAccessibilityEvent(NotificationType event_type, + void DescribeAccessibilityEvent(int event_type, const AccessibilityControlInfo* control_info, std::string* out_spoken_description, EarconType* out_earcon); diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler_unittest.cc b/chrome/browser/chromeos/login/wizard_accessibility_handler_unittest.cc index b1afe99..9d2f878 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_handler_unittest.cc +++ b/chrome/browser/chromeos/login/wizard_accessibility_handler_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/accessibility_events.h" #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" +#include "chrome/common/chrome_notification_types.h" #include "testing/gtest/include/gtest/gtest.h" using chromeos::EarconType; @@ -22,7 +23,7 @@ class WizardAccessibilityHandlerTest : public testing::Test { textbox_info->SetValue(value, selection_start, selection_end); EarconType earcon = chromeos::NO_EARCON; handler->DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_TEXT_CHANGED, + chrome::NOTIFICATION_ACCESSIBILITY_TEXT_CHANGED, textbox_info, description, &earcon); @@ -45,7 +46,7 @@ TEST_F(WizardAccessibilityHandlerTest, TestFocusEvents) { std::string button_name = "Save"; AccessibilityButtonInfo button_info(NULL, button_name); handler.DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &button_info, &description, &earcon); @@ -56,7 +57,7 @@ TEST_F(WizardAccessibilityHandlerTest, TestFocusEvents) { std::string checkbox_name = "Accessibility"; AccessibilityCheckboxInfo checkbox_info(NULL, checkbox_name, false); handler.DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &checkbox_info, &description, &earcon); @@ -64,7 +65,7 @@ TEST_F(WizardAccessibilityHandlerTest, TestFocusEvents) { EXPECT_EQ("Accessibility Unchecked check box", description); checkbox_info.SetChecked(true); handler.DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &checkbox_info, &description, &earcon); @@ -77,7 +78,7 @@ TEST_F(WizardAccessibilityHandlerTest, TestFocusEvents) { AccessibilityComboBoxInfo combobox_info( NULL, combobox_name, combobox_value, 12, 35); handler.DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &combobox_info, &description, &earcon); @@ -93,7 +94,7 @@ TEST_F(WizardAccessibilityHandlerTest, TestTextEvents) { AccessibilityTextBoxInfo textbox_info(NULL, "", false); handler.DescribeAccessibilityEvent( - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, &textbox_info, &description, &earcon); diff --git a/chrome/browser/chromeos/login/wizard_accessibility_helper.cc b/chrome/browser/chromeos/login/wizard_accessibility_helper.cc index 6d152fa..61937ee 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_helper.cc +++ b/chrome/browser/chromeos/login/wizard_accessibility_helper.cc @@ -11,6 +11,7 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" @@ -57,19 +58,19 @@ void WizardAccessibilityHelper::Init() { void WizardAccessibilityHelper::RegisterNotifications() { registrar_.Add(accessibility_handler_.get(), - NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, NotificationService::AllSources()); registrar_.Add(accessibility_handler_.get(), - NotificationType::ACCESSIBILITY_CONTROL_ACTION, + chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_ACTION, NotificationService::AllSources()); registrar_.Add(accessibility_handler_.get(), - NotificationType::ACCESSIBILITY_TEXT_CHANGED, + chrome::NOTIFICATION_ACCESSIBILITY_TEXT_CHANGED, NotificationService::AllSources()); registrar_.Add(accessibility_handler_.get(), - NotificationType::ACCESSIBILITY_MENU_OPENED, + chrome::NOTIFICATION_ACCESSIBILITY_MENU_OPENED, NotificationService::AllSources()); registrar_.Add(accessibility_handler_.get(), - NotificationType::ACCESSIBILITY_MENU_CLOSED, + chrome::NOTIFICATION_ACCESSIBILITY_MENU_CLOSED, NotificationService::AllSources()); registered_notifications_ = true; } diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index af00b1d..2333556 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -38,8 +38,8 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "ui/base/l10n/l10n_util.h" #include "views/accelerator.h" diff --git a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc index bd573dd..ea26d39 100644 --- a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc +++ b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc @@ -9,6 +9,7 @@ #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/browser_dialogs.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/ui_test_utils.h" namespace chromeos { @@ -41,7 +42,7 @@ void WizardInProcessBrowserTest::CleanUpOnMainThread() { // which delays deleting itself). Run the message loop until we know the // wizard has been deleted. ui_test_utils::WaitForNotification( - NotificationType::WIZARD_CONTENT_VIEW_DESTROYED); + chrome::NOTIFICATION_WIZARD_CONTENT_VIEW_DESTROYED); } } // namespace chromeos diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc index f06b84a..4ecf52c 100644 --- a/chrome/browser/chromeos/media/media_player.cc +++ b/chrome/browser/chromeos/media/media_player.cc @@ -27,6 +27,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/webui/favicon_source.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/jstemplate_builder.h" @@ -162,12 +163,12 @@ void MediaPlayer::SetPlaybackError(GURL const& url) { NotifyPlaylistChanged(); } -void MediaPlayer::Observe(NotificationType type, +void MediaPlayer::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::BROWSER_CLOSING); + DCHECK(type == chrome::NOTIFICATION_BROWSER_CLOSING); registrar_.Remove(this, - NotificationType::BROWSER_CLOSING, + chrome::NOTIFICATION_BROWSER_CLOSING, source); if (Source<Browser>(source).ptr() == mediaplayer_browser_) { mediaplayer_browser_ = NULL; @@ -203,7 +204,7 @@ void MediaPlayer::PopupPlaylist(Browser* creator) { gfx::Rect(), profile); registrar_.Add(this, - NotificationType::BROWSER_CLOSING, + chrome::NOTIFICATION_BROWSER_CLOSING, Source<Browser>(playlist_browser_)); playlist_browser_->AddSelectedTabWithURL(GetMediaplayerPlaylistUrl(), PageTransition::LINK); @@ -228,7 +229,7 @@ void MediaPlayer::PopupMediaPlayer(Browser* creator) { gfx::Rect(), profile); registrar_.Add(this, - NotificationType::BROWSER_CLOSING, + chrome::NOTIFICATION_BROWSER_CLOSING, Source<Browser>(mediaplayer_browser_)); #if defined(OS_CHROMEOS) diff --git a/chrome/browser/chromeos/media/media_player.h b/chrome/browser/chromeos/media/media_player.h index e916ea2..8ef81c4 100644 --- a/chrome/browser/chromeos/media/media_player.h +++ b/chrome/browser/chromeos/media/media_player.h @@ -10,10 +10,10 @@ #include <vector> #include "base/memory/singleton.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 "net/url_request/url_request.h" @@ -97,7 +97,7 @@ class MediaPlayer : public NotificationObserver, virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); // Used to detect when the mediaplayer is closed. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/network_state_notifier.cc b/chrome/browser/chromeos/network_state_notifier.cc index 5cb45c5..74f7eee 100644 --- a/chrome/browser/chromeos/network_state_notifier.cc +++ b/chrome/browser/chromeos/network_state_notifier.cc @@ -7,9 +7,10 @@ #include "base/message_loop.h" #include "base/time.h" #include "chrome/browser/chromeos/cros/cros_library.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" namespace chromeos { @@ -69,7 +70,7 @@ void NetworkStateNotifier::UpdateNetworkState( state_ = new_state; NetworkStateDetails details(state_); NotificationService::current()->Notify( - NotificationType::NETWORK_STATE_CHANGED, + chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources(), Details<NetworkStateDetails>(&details)); }; diff --git a/chrome/browser/chromeos/network_state_notifier_browsertest.cc b/chrome/browser/chromeos/network_state_notifier_browsertest.cc index f65db49..8c1c2d9 100644 --- a/chrome/browser/chromeos/network_state_notifier_browsertest.cc +++ b/chrome/browser/chromeos/network_state_notifier_browsertest.cc @@ -6,6 +6,7 @@ #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" #include "chrome/browser/chromeos/cros/mock_network_library.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/browser_thread.h" #include "content/common/notification_registrar.h" @@ -40,11 +41,11 @@ class NetworkStateNotifierTest : public CrosInProcessBrowserTest, } // NotificationObserver overrides. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - EXPECT_TRUE(NotificationType::NETWORK_STATE_CHANGED == type); + EXPECT_TRUE(chrome::NOTIFICATION_NETWORK_STATE_CHANGED == type); chromeos::NetworkStateDetails* state_details = Details<chromeos::NetworkStateDetails>(details).ptr(); state_ = state_details->state(); @@ -52,7 +53,7 @@ class NetworkStateNotifierTest : public CrosInProcessBrowserTest, void WaitForNotification() { ui_test_utils::WaitForNotification( - NotificationType::NETWORK_STATE_CHANGED); + chrome::NOTIFICATION_NETWORK_STATE_CHANGED); } protected: @@ -63,7 +64,7 @@ class NetworkStateNotifierTest : public CrosInProcessBrowserTest, IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestConnected) { // NETWORK_STATE_CHAGNED has to be registered in UI thread. NotificationRegistrar registrar; - registrar.Add(this, NotificationType::NETWORK_STATE_CHANGED, + registrar.Add(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources()); EXPECT_CALL(*mock_network_library_, Connected()) .Times(1) @@ -77,7 +78,7 @@ IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestConnected) { IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestConnecting) { NotificationRegistrar registrar; - registrar.Add(this, NotificationType::NETWORK_STATE_CHANGED, + registrar.Add(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources()); EXPECT_CALL(*mock_network_library_, Connected()) .Times(1) @@ -95,7 +96,7 @@ IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestConnecting) { IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestDisconnected) { NotificationRegistrar registrar; - registrar.Add(this, NotificationType::NETWORK_STATE_CHANGED, + registrar.Add(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources()); EXPECT_CALL(*mock_network_library_, Connected()) .Times(1) diff --git a/chrome/browser/chromeos/notifications/balloon_collection_impl.cc b/chrome/browser/chromeos/notifications/balloon_collection_impl.cc index c8415c1..dba581c 100644 --- a/chrome/browser/chromeos/notifications/balloon_collection_impl.cc +++ b/chrome/browser/chromeos/notifications/balloon_collection_impl.cc @@ -13,6 +13,7 @@ #include "chrome/browser/notifications/notification.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/window_sizer.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -29,7 +30,7 @@ namespace chromeos { BalloonCollectionImpl::BalloonCollectionImpl() : notification_ui_(new NotificationPanel()) { - registrar_.Add(this, NotificationType::BROWSER_CLOSED, + registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, NotificationService::AllSources()); } @@ -146,10 +147,10 @@ const BalloonCollectionImpl::Balloons& return base_.balloons(); } -void BalloonCollectionImpl::Observe(NotificationType type, +void BalloonCollectionImpl::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::BROWSER_CLOSED); + DCHECK(type == chrome::NOTIFICATION_BROWSER_CLOSED); bool app_closing = *Details<bool>(details).ptr(); // When exiting, we need to shutdown all renderers in // BalloonViewImpl before IO thread gets deleted in the diff --git a/chrome/browser/chromeos/notifications/balloon_collection_impl.h b/chrome/browser/chromeos/notifications/balloon_collection_impl.h index 1f0fbbe..e4a6d81 100644 --- a/chrome/browser/chromeos/notifications/balloon_collection_impl.h +++ b/chrome/browser/chromeos/notifications/balloon_collection_impl.h @@ -72,7 +72,7 @@ class BalloonCollectionImpl : public BalloonCollection, virtual const Balloons& GetActiveBalloons(); // NotificationObserver overrides: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index 82ecd30..078b55d 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -18,9 +18,9 @@ #include "chrome/browser/ui/views/notifications/balloon_view_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" +#include "chrome/common/chrome_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 "ui/base/l10n/l10n_util.h" @@ -227,7 +227,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { html_contents_->EnableWebUI(); AddChildView(html_contents_->view()); notification_registrar_.Add(this, - NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); + chrome::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); } void BalloonViewImpl::Update() { @@ -298,10 +298,10 @@ gfx::Size BalloonViewImpl::GetPreferredSize() { //////////////////////////////////////////////////////////////////////////////// // NotificationObserver overrides. -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::NOTIFY_BALLOON_DISCONNECTED) { NOTREACHED(); return; } @@ -309,7 +309,7 @@ void BalloonViewImpl::Observe(NotificationType type, // 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_)); + chrome::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); Close(false); } diff --git a/chrome/browser/chromeos/notifications/balloon_view.h b/chrome/browser/chromeos/notifications/balloon_view.h index 5aa01a8..2f38f22 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.h +++ b/chrome/browser/chromeos/notifications/balloon_view.h @@ -84,7 +84,7 @@ class BalloonViewImpl : public BalloonView, virtual gfx::Size GetPreferredSize(); // NotificationObserver interface. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc index 6eb7ba3..6044df8 100644 --- a/chrome/browser/chromeos/notifications/notification_browsertest.cc +++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc @@ -17,6 +17,7 @@ #include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/notification_ui_manager.h" #include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/common/notification_service.h" @@ -110,10 +111,10 @@ class NotificationTest : public InProcessBrowserTest, } // NotificationObserver overrides. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - ASSERT_TRUE(NotificationType::PANEL_STATE_CHANGED == type); + ASSERT_TRUE(chrome::NOTIFICATION_PANEL_STATE_CHANGED == type); PanelController::State* state = reinterpret_cast<PanelController::State*>(details.map_key()); state_ = *state; @@ -301,7 +302,7 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestStateTransition2) { // Register observer here as the registration does not work in SetUp(). NotificationRegistrar registrar; registrar.Add(this, - NotificationType::PANEL_STATE_CHANGED, + chrome::NOTIFICATION_PANEL_STATE_CHANGED, NotificationService::AllSources()); BalloonCollectionImpl* collection = GetBalloonCollectionImpl(); @@ -368,7 +369,7 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestStateTransition2) { IN_PROC_BROWSER_TEST_F(NotificationTest, TestCleanupOnExit) { NotificationRegistrar registrar; registrar.Add(this, - NotificationType::PANEL_STATE_CHANGED, + chrome::NOTIFICATION_PANEL_STATE_CHANGED, NotificationService::AllSources()); BalloonCollectionImpl* collection = GetBalloonCollectionImpl(); diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc index 169ac03..7bb6114 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.cc +++ b/chrome/browser/chromeos/notifications/notification_panel.cc @@ -10,6 +10,7 @@ #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h" #include "chrome/browser/chromeos/notifications/balloon_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" @@ -466,7 +467,7 @@ void NotificationPanel::Show() { panel_controller_->Init(false /* don't focus when opened */, gfx::Rect(0, 0, kBalloonMinWidth, 1), 0, WM_IPC_PANEL_USER_RESIZE_VERTICALLY); - registrar_.Add(this, NotificationType::PANEL_STATE_CHANGED, + registrar_.Add(this, chrome::NOTIFICATION_PANEL_STATE_CHANGED, Source<PanelController>(panel_controller_.get())); } panel_widget_->Show(); @@ -616,10 +617,10 @@ void NotificationPanel::ActivatePanel() { //////////////////////////////////////////////////////////////////////////////// // NotificationObserver overrides. -void NotificationPanel::Observe(NotificationType type, +void NotificationPanel::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::PANEL_STATE_CHANGED); + DCHECK(type == chrome::NOTIFICATION_PANEL_STATE_CHANGED); PanelController::State* state = reinterpret_cast<PanelController::State*>(details.map_key()); switch (*state) { @@ -687,7 +688,7 @@ void NotificationPanel::Init() { void NotificationPanel::UnregisterNotification() { if (panel_controller_.get()) - registrar_.Remove(this, NotificationType::PANEL_STATE_CHANGED, + registrar_.Remove(this, chrome::NOTIFICATION_PANEL_STATE_CHANGED, Source<PanelController>(panel_controller_.get())); } diff --git a/chrome/browser/chromeos/notifications/notification_panel.h b/chrome/browser/chromeos/notifications/notification_panel.h index 29aa93a..92385bc 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.h +++ b/chrome/browser/chromeos/notifications/notification_panel.h @@ -105,7 +105,7 @@ class NotificationPanel : public PanelController::Delegate, virtual void ActivatePanel(); // NotificationObserver overrides: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc index ca37d49..389c689 100644 --- a/chrome/browser/chromeos/offline/offline_load_page.cc +++ b/chrome/browser/chromeos/offline/offline_load_page.cc @@ -17,6 +17,7 @@ #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" @@ -24,8 +25,8 @@ #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -71,7 +72,7 @@ OfflineLoadPage::OfflineLoadPage(TabContents* tab_contents, proceeded_(false), ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), in_test_(false) { - registrar_.Add(this, NotificationType::NETWORK_STATE_CHANGED, + registrar_.Add(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources()); } @@ -198,17 +199,17 @@ void OfflineLoadPage::DontProceed() { InterstitialPage::DontProceed(); } -void OfflineLoadPage::Observe(NotificationType type, +void OfflineLoadPage::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type.value == NotificationType::NETWORK_STATE_CHANGED) { + if (type == chrome::NOTIFICATION_NETWORK_STATE_CHANGED) { chromeos::NetworkStateDetails* state_details = Details<chromeos::NetworkStateDetails>(details).ptr(); DVLOG(1) << "NetworkStateChanaged notification received: state=" << state_details->state(); if (state_details->state() == chromeos::NetworkStateDetails::CONNECTED) { - registrar_.Remove(this, NotificationType::NETWORK_STATE_CHANGED, + registrar_.Remove(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED, NotificationService::AllSources()); Proceed(); } diff --git a/chrome/browser/chromeos/offline/offline_load_page.h b/chrome/browser/chromeos/offline/offline_load_page.h index dbd0412..08a8ba5 100644 --- a/chrome/browser/chromeos/offline/offline_load_page.h +++ b/chrome/browser/chromeos/offline/offline_load_page.h @@ -61,7 +61,7 @@ class OfflineLoadPage : public ChromeInterstitialPage { virtual void DontProceed(); // Overrides ChromeInterstitialPage's Observe. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/options/take_photo_dialog.cc b/chrome/browser/chromeos/options/take_photo_dialog.cc index 6f1eb4e..3be00bc 100644 --- a/chrome/browser/chromeos/options/take_photo_dialog.cc +++ b/chrome/browser/chromeos/options/take_photo_dialog.cc @@ -8,8 +8,8 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/user_manager.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -34,7 +34,7 @@ TakePhotoDialog::TakePhotoDialog() camera_controller_.set_frame_height(kFrameHeight); registrar_.Add( this, - NotificationType::SCREEN_LOCK_STATE_CHANGED, + chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, NotificationService::AllSources()); } @@ -109,10 +109,10 @@ void TakePhotoDialog::OnCaptureFailure() { take_photo_view_->ShowCameraError(); } -void TakePhotoDialog::Observe(NotificationType type, +void TakePhotoDialog::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::SCREEN_LOCK_STATE_CHANGED) + if (type != chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED) return; bool is_screen_locked = *Details<bool>(details).ptr(); diff --git a/chrome/browser/chromeos/options/take_photo_dialog.h b/chrome/browser/chromeos/options/take_photo_dialog.h index 9eeb992..9cecd71 100644 --- a/chrome/browser/chromeos/options/take_photo_dialog.h +++ b/chrome/browser/chromeos/options/take_photo_dialog.h @@ -49,7 +49,7 @@ class TakePhotoDialog : public views::DialogDelegateView, virtual void OnCaptureFailure(); // NotificationObserver implementation: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/panels/panel_browsertest.cc b/chrome/browser/chromeos/panels/panel_browsertest.cc index 35c8d7c..d30332a 100644 --- a/chrome/browser/chromeos/panels/panel_browsertest.cc +++ b/chrome/browser/chromeos/panels/panel_browsertest.cc @@ -45,7 +45,7 @@ IN_PROC_BROWSER_TEST_F(PanelTest, PanelOpenSmall) { browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); // Wait for notification that window.open has been processed. - ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); + ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_ADDED); // Find the new browser. Browser* new_browser = NULL; @@ -84,7 +84,7 @@ IN_PROC_BROWSER_TEST_F(PanelTest, PanelOpenLarge) { browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); // Wait for notification that window.open has been processed. - ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); + ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_ADDED); // Shouldn't find a new browser. Browser* new_browser = NULL; diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index b2c9e70..9a277cf 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -18,10 +18,10 @@ #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "unicode/timezone.h" namespace chromeos { @@ -264,10 +264,10 @@ void Preferences::Init(PrefService* prefs) { } } -void Preferences::Observe(NotificationType type, +void Preferences::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::PREF_CHANGED) + if (type == chrome::NOTIFICATION_PREF_CHANGED) NotifyPrefChanged(Details<std::string>(details).ptr()); } diff --git a/chrome/browser/chromeos/preferences.h b/chrome/browser/chromeos/preferences.h index bf97ac9..11a554a 100644 --- a/chrome/browser/chromeos/preferences.h +++ b/chrome/browser/chromeos/preferences.h @@ -33,7 +33,7 @@ class Preferences : public NotificationObserver { void Init(PrefService* prefs); // Overridden from NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/status/clock_menu_button.cc b/chrome/browser/chromeos/status/clock_menu_button.cc index 5880b0b..3828bb6 100644 --- a/chrome/browser/chromeos/status/clock_menu_button.cc +++ b/chrome/browser/chromeos/status/clock_menu_button.cc @@ -12,6 +12,7 @@ #include "chrome/browser/chromeos/status/status_area_host.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -98,10 +99,10 @@ void ClockMenuButton::UpdateText() { // ClockMenuButton, NotificationObserver implementation: -void ClockMenuButton::Observe(NotificationType type, +void ClockMenuButton::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::kUse24HourClock) { UpdateText(); diff --git a/chrome/browser/chromeos/status/clock_menu_button.h b/chrome/browser/chromeos/status/clock_menu_button.h index d6fd4ee..7864b97 100644 --- a/chrome/browser/chromeos/status/clock_menu_button.h +++ b/chrome/browser/chromeos/status/clock_menu_button.h @@ -12,8 +12,8 @@ #include "chrome/browser/chromeos/status/status_area_button.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/prefs/pref_member.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" -#include "content/common/notification_type.h" #include "chrome/browser/chromeos/system/timezone_settings.h" #include "unicode/calendar.h" #include "views/controls/button/menu_button.h" @@ -60,7 +60,7 @@ class ClockMenuButton : public StatusAreaButton, void UpdateText(); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc index 20bd54e..2e7f7bb 100644 --- a/chrome/browser/chromeos/status/input_method_menu.cc +++ b/chrome/browser/chromeos/status/input_method_menu.cc @@ -15,6 +15,7 @@ #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/language_preferences.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/browser/user_metrics.h" #include "content/common/notification_service.h" @@ -162,7 +163,7 @@ InputMethodMenu::InputMethodMenu(PrefService* pref_service, if (screen_mode_ == StatusAreaHost::kLoginMode) { // This button is for the login screen. registrar_.Add(this, - NotificationType::LOGIN_USER_CHANGED, + chrome::NOTIFICATION_LOGIN_USER_CHANGED, NotificationService::AllSources()); } } @@ -677,10 +678,10 @@ void InputMethodMenu::RegisterPrefs(PrefService* local_state) { PrefService::UNSYNCABLE_PREF); } -void InputMethodMenu::Observe(NotificationType type, +void InputMethodMenu::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::LOGIN_USER_CHANGED) { + if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) { // When a user logs in, we should remove |this| object from the observer // list so that PreferenceUpdateNeeded() does not update the local state // anymore. diff --git a/chrome/browser/chromeos/status/input_method_menu.h b/chrome/browser/chromeos/status/input_method_menu.h index 22dbb15..be736d9 100644 --- a/chrome/browser/chromeos/status/input_method_menu.h +++ b/chrome/browser/chromeos/status/input_method_menu.h @@ -11,9 +11,9 @@ #include "chrome/browser/chromeos/input_method/input_method_manager.h" #include "chrome/browser/chromeos/status/status_area_host.h" #include "chrome/browser/prefs/pref_member.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -#include "content/common/notification_type.h" #include "ui/base/models/menu_model.h" #include "views/controls/menu/menu_item_view.h" #include "views/controls/menu/view_menu_delegate.h" @@ -89,7 +89,7 @@ class InputMethodMenu : public views::ViewMenuDelegate, virtual void FirstObserverIsAdded(input_method::InputMethodManager* manager); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/tab_closeable_state_watcher.cc b/chrome/browser/chromeos/tab_closeable_state_watcher.cc index 408c766..a45a0d6c 100644 --- a/chrome/browser/chromeos/tab_closeable_state_watcher.cc +++ b/chrome/browser/chromeos/tab_closeable_state_watcher.cc @@ -9,6 +9,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/tab_contents.h" @@ -70,7 +71,7 @@ TabCloseableStateWatcher::TabCloseableStateWatcher() switches::kGuestSession)), waiting_for_browser_(false) { BrowserList::AddObserver(this); - notification_registrar_.Add(this, NotificationType::APP_EXITING, + notification_registrar_.Add(this, content::NOTIFICATION_APP_EXITING, NotificationService::AllSources()); } @@ -187,9 +188,9 @@ void TabCloseableStateWatcher::OnBrowserRemoved(const Browser* browser) { //////////////////////////////////////////////////////////////////////////////// // TabCloseableStateWatcher, NotificationObserver implementation: -void TabCloseableStateWatcher::Observe(NotificationType type, +void TabCloseableStateWatcher::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type.value != NotificationType::APP_EXITING) + if (type != content::NOTIFICATION_APP_EXITING) NOTREACHED(); if (!signing_off_) { signing_off_ = true; @@ -260,7 +261,7 @@ void TabCloseableStateWatcher::SetCloseableState(bool closeable) { // Notify of change in tab closeable state. NotificationService::current()->Notify( - NotificationType::TAB_CLOSEABLE_STATE_CHANGED, + chrome::NOTIFICATION_TAB_CLOSEABLE_STATE_CHANGED, NotificationService::AllSources(), Details<bool>(&can_close_tab_)); } diff --git a/chrome/browser/chromeos/tab_closeable_state_watcher.h b/chrome/browser/chromeos/tab_closeable_state_watcher.h index b1d448f..7a1f0c2 100644 --- a/chrome/browser/chromeos/tab_closeable_state_watcher.h +++ b/chrome/browser/chromeos/tab_closeable_state_watcher.h @@ -65,7 +65,7 @@ class TabCloseableStateWatcher : public ::TabCloseableStateWatcher, virtual void OnBrowserRemoved(const Browser* browser); // NotificationObserver implementation: - virtual void Observe(NotificationType type, const NotificationSource& source, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); // Called by private class TabStripWatcher for TabStripModelObserver diff --git a/chrome/browser/chromeos/web_socket_proxy.cc b/chrome/browser/chromeos/web_socket_proxy.cc index eabb827..b088b60 100644 --- a/chrome/browser/chromeos/web_socket_proxy.cc +++ b/chrome/browser/chromeos/web_socket_proxy.cc @@ -31,9 +31,10 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/internal_auth.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/browser_thread.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_service.h" -#include "content/common/notification_type.h" #include "content/common/url_constants.h" #include "googleurl/src/gurl.h" #include "third_party/libevent/evdns.h" @@ -153,7 +154,7 @@ inline size_t strlen(const uint8* s) { void SendNotification() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); NotificationService::current()->Notify( - NotificationType::WEB_SOCKET_PROXY_STARTED, + chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED, NotificationService::AllSources(), NotificationService::NoDetails()); } diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc index e107640..668327a 100644 --- a/chrome/browser/chromeos/wm_ipc.cc +++ b/chrome/browser/chromeos/wm_ipc.cc @@ -13,6 +13,7 @@ extern "C" { #include "base/lazy_instance.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/rect.h" @@ -303,7 +304,7 @@ void WmIpc::FetchLayoutModeProperty() { &value)) { layout_mode_ = static_cast<WmIpcLayoutMode>(value); NotificationService::current()->Notify( - NotificationType::LAYOUT_MODE_CHANGED, + chrome::NOTIFICATION_LAYOUT_MODE_CHANGED, Source<WmIpc>(this), Details<WmIpcLayoutMode>(&layout_mode_)); } else { |