summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 15:52:27 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 15:52:27 +0000
commit43211582b1fa8c69136385250e7b0446cf364b5c (patch)
tree655ab01543012b6fd5699dee8fab92876959b7d9 /chrome/browser/sync
parentd43970a7ceee5fc5433787b0f28b64234a4039f2 (diff)
downloadchromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.zip
chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.gz
chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.bz2
Moving notification types which are chrome specific to a new header file chrome_notification_types.h.
This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END which defines the end of the enum used by content to define notification types. The notificaton_type.h file in content\common has been renamed to content_notification_types.h BUG=76698 Review URL: http://codereview.chromium.org/7327007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/backend_migrator.cc7
-rw-r--r--chrome/browser/sync/backend_migrator.h2
-rw-r--r--chrome/browser/sync/backend_migrator_unittest.cc3
-rw-r--r--chrome/browser/sync/glue/app_change_processor.cc23
-rw-r--r--chrome/browser/sync/glue/app_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/autofill_change_processor.cc8
-rw-r--r--chrome/browser/sync/glue/autofill_change_processor.h2
-rw-r--r--chrome/browser/sync/glue/autofill_data_type_controller.cc8
-rw-r--r--chrome/browser/sync/glue/autofill_data_type_controller.h3
-rw-r--r--chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/autofill_profile_change_processor.cc8
-rw-r--r--chrome/browser/sync/glue/autofill_profile_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller.cc8
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller.h3
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc4
-rw-r--r--chrome/browser/sync/glue/data_type_manager_impl.cc7
-rw-r--r--chrome/browser/sync/glue/data_type_manager_impl_unittest.cc10
-rw-r--r--chrome/browser/sync/glue/data_type_manager_mock.cc9
-rw-r--r--chrome/browser/sync/glue/data_type_manager_mock.h2
-rw-r--r--chrome/browser/sync/glue/extension_change_processor.cc23
-rw-r--r--chrome/browser/sync/glue/extension_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/password_change_processor.cc11
-rw-r--r--chrome/browser/sync/glue/password_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/session_change_processor.cc37
-rw-r--r--chrome/browser/sync/glue/session_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc3
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc4
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_mock.h2
-rw-r--r--chrome/browser/sync/glue/theme_change_processor.cc7
-rw-r--r--chrome/browser/sync/glue/theme_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/typed_url_change_processor.cc32
-rw-r--r--chrome/browser/sync/glue/typed_url_change_processor.h4
-rw-r--r--chrome/browser/sync/glue/typed_url_data_type_controller.cc7
-rw-r--r--chrome/browser/sync/glue/typed_url_data_type_controller.h4
-rw-r--r--chrome/browser/sync/notifier/invalidation_util.cc4
-rw-r--r--chrome/browser/sync/profile_sync_service.cc40
-rw-r--r--chrome/browser/sync/profile_sync_service.h4
-rw-r--r--chrome/browser/sync/profile_sync_service_autofill_unittest.cc16
-rw-r--r--chrome/browser/sync/profile_sync_service_password_unittest.cc12
-rw-r--r--chrome/browser/sync/profile_sync_service_session_unittest.cc9
-rw-r--r--chrome/browser/sync/profile_sync_service_startup_unittest.cc6
-rw-r--r--chrome/browser/sync/profile_sync_service_typed_url_unittest.cc19
-rw-r--r--chrome/browser/sync/profile_sync_test_util.cc6
-rw-r--r--chrome/browser/sync/profile_sync_test_util.h8
-rw-r--r--chrome/browser/sync/signin_manager.cc15
-rw-r--r--chrome/browser/sync/signin_manager.h2
-rw-r--r--chrome/browser/sync/signin_manager_unittest.cc8
-rw-r--r--chrome/browser/sync/syncable/model_type.cc76
-rw-r--r--chrome/browser/sync/syncable/model_type.h4
-rw-r--r--chrome/browser/sync/test_profile_sync_service.cc5
-rw-r--r--chrome/browser/sync/test_profile_sync_service.h2
-rw-r--r--chrome/browser/sync/util/extensions_activity_monitor.cc6
-rw-r--r--chrome/browser/sync/util/extensions_activity_monitor.h2
-rw-r--r--chrome/browser/sync/util/extensions_activity_monitor_unittest.cc3
54 files changed, 267 insertions, 247 deletions
diff --git a/chrome/browser/sync/backend_migrator.cc b/chrome/browser/sync/backend_migrator.cc
index 1bbda87..4d8550f 100644
--- a/chrome/browser/sync/backend_migrator.cc
+++ b/chrome/browser/sync/backend_migrator.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/sync/engine/configure_reason.h"
#include "chrome/browser/sync/glue/data_type_manager.h"
#include "chrome/browser/sync/sessions/session_state.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
@@ -26,7 +27,7 @@ BackendMigrator::BackendMigrator(ProfileSyncService* service,
: state_(IDLE), service_(service), manager_(manager),
restart_migration_(false),
method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
- registrar_.Add(this, NotificationType::SYNC_CONFIGURE_DONE,
+ registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
Source<DataTypeManager>(manager_));
service_->AddObserver(this);
}
@@ -113,10 +114,10 @@ void BackendMigrator::OnStateChanged() {
manager_->Configure(full_set, sync_api::CONFIGURE_REASON_MIGRATION);
}
-void BackendMigrator::Observe(NotificationType type,
+void BackendMigrator::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK_EQ(NotificationType::SYNC_CONFIGURE_DONE, type.value);
+ DCHECK_EQ(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, type);
if (state_ == IDLE)
return;
diff --git a/chrome/browser/sync/backend_migrator.h b/chrome/browser/sync/backend_migrator.h
index 2f2a175..d3314aa 100644
--- a/chrome/browser/sync/backend_migrator.h
+++ b/chrome/browser/sync/backend_migrator.h
@@ -43,7 +43,7 @@ class BackendMigrator : public NotificationObserver,
virtual void OnStateChanged();
// NotificationObserver implementation.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc
index 2939141..cdc2643 100644
--- a/chrome/browser/sync/backend_migrator_unittest.cc
+++ b/chrome/browser/sync/backend_migrator_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/sync/glue/data_type_manager_mock.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
#include "chrome/browser/sync/sessions/session_state.h"
+#include "chrome/common/chrome_notification_types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -63,7 +64,7 @@ class BackendMigratorTest : public testing::Test {
DataTypeManager::ConfigureResultWithErrorLocation result_with_location(
result, FROM_HERE, types);
NotificationService::current()->Notify(
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
Source<DataTypeManager>(&manager_),
Details<DataTypeManager::ConfigureResultWithErrorLocation>(
&result_with_location));
diff --git a/chrome/browser/sync/glue/app_change_processor.cc b/chrome/browser/sync/glue/app_change_processor.cc
index b786aab..31e2624 100644
--- a/chrome/browser/sync/glue/app_change_processor.cc
+++ b/chrome/browser/sync/glue/app_change_processor.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/sync/glue/extension_sync.h"
#include "chrome/browser/sync/glue/extension_util.h"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
@@ -39,24 +40,24 @@ AppChangeProcessor::~AppChangeProcessor() {
// the browser or the syncapi are done in order; this is tricky since
// some events (e.g., extension installation) are done asynchronously.
-void AppChangeProcessor::Observe(NotificationType type,
+void AppChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(running());
DCHECK(profile_);
- if ((type != NotificationType::EXTENSION_LOADED) &&
- (type != NotificationType::EXTENSION_UPDATE_DISABLED) &&
- (type != NotificationType::EXTENSION_UNLOADED)) {
+ if ((type != chrome::NOTIFICATION_EXTENSION_LOADED) &&
+ (type != chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED) &&
+ (type != chrome::NOTIFICATION_EXTENSION_UNLOADED)) {
LOG(DFATAL) << "Received unexpected notification of type "
- << type.value;
+ << type;
return;
}
// Filter out unhandled extensions first.
DCHECK_EQ(Source<Profile>(source).ptr(), profile_);
const Extension& extension =
- (type == NotificationType::EXTENSION_UNLOADED) ?
+ (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) ?
*Details<UnloadedExtensionInfo>(details)->extension :
*Details<const Extension>(details).ptr();
if (!traits_.is_valid_and_syncable(extension)) {
@@ -66,7 +67,7 @@ void AppChangeProcessor::Observe(NotificationType type,
const std::string& id = extension.id();
// Then handle extension uninstalls.
- if (type == NotificationType::EXTENSION_UNLOADED) {
+ if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) {
const UnloadedExtensionInfo& info =
*Details<UnloadedExtensionInfo>(details).ptr();
if (info.reason == UnloadedExtensionInfo::UNINSTALL) {
@@ -78,7 +79,7 @@ void AppChangeProcessor::Observe(NotificationType type,
}
VLOG(1) << "Updating server data for extension " << id
- << " (notification type = " << type.value << ")";
+ << " (notification type = " << type << ")";
std::string error;
if (!UpdateServerData(traits_, extension, *extension_service_,
share_handle(), &error)) {
@@ -163,16 +164,16 @@ void AppChangeProcessor::StartObserving() {
DCHECK(profile_);
notification_registrar_.Add(
- this, NotificationType::EXTENSION_LOADED,
+ this, chrome::NOTIFICATION_EXTENSION_LOADED,
Source<Profile>(profile_));
// Despite the name, this notification is exactly like
// EXTENSION_LOADED but with an initial state of DISABLED.
notification_registrar_.Add(
- this, NotificationType::EXTENSION_UPDATE_DISABLED,
+ this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
Source<Profile>(profile_));
notification_registrar_.Add(
- this, NotificationType::EXTENSION_UNLOADED,
+ this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
Source<Profile>(profile_));
}
diff --git a/chrome/browser/sync/glue/app_change_processor.h b/chrome/browser/sync/glue/app_change_processor.h
index 80511eb..7c2ce3e 100644
--- a/chrome/browser/sync/glue/app_change_processor.h
+++ b/chrome/browser/sync/glue/app_change_processor.h
@@ -10,9 +10,9 @@
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/extension_sync_traits.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 ExtensionServiceInterface;
@@ -33,7 +33,7 @@ class AppChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// BrowserExtensionProvider -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/autofill_change_processor.cc b/chrome/browser/sync/glue/autofill_change_processor.cc
index 62b2de1..ae18d13 100644
--- a/chrome/browser/sync/glue/autofill_change_processor.cc
+++ b/chrome/browser/sync/glue/autofill_change_processor.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/browser/webdata/web_database.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/guid.h"
#include "content/common/notification_service.h"
@@ -55,7 +56,7 @@ AutofillChangeProcessor::AutofillChangeProcessor(
AutofillChangeProcessor::~AutofillChangeProcessor() {}
-void AutofillChangeProcessor::Observe(NotificationType type,
+void AutofillChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
// Ensure this notification came from our web database.
@@ -77,7 +78,7 @@ void AutofillChangeProcessor::Observe(NotificationType type,
return;
}
- DCHECK(type.value == NotificationType::AUTOFILL_ENTRIES_CHANGED);
+ DCHECK(type == chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED);
AutofillChangeList* changes = Details<AutofillChangeList>(details).ptr();
ObserveAutofillEntriesChanged(changes, &trans, autofill_root);
@@ -419,7 +420,8 @@ void AutofillChangeProcessor::StopImpl() {
void AutofillChangeProcessor::StartObserving() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
- notification_registrar_.Add(this, NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notification_registrar_.Add(this,
+ chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
NotificationService::AllSources());
}
diff --git a/chrome/browser/sync/glue/autofill_change_processor.h b/chrome/browser/sync/glue/autofill_change_processor.h
index 914feca..1ea0e1a 100644
--- a/chrome/browser/sync/glue/autofill_change_processor.h
+++ b/chrome/browser/sync/glue/autofill_change_processor.h
@@ -44,7 +44,7 @@ class AutofillChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// WebDataService -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc
index 794c3d0..ba6a161 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc
@@ -10,10 +10,10 @@
#include "chrome/browser/sync/profile_sync_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/webdata/web_data_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_source.h"
-#include "content/common/notification_type.h"
namespace browser_sync {
@@ -45,7 +45,7 @@ bool AutofillDataTypeController::StartModels() {
if (web_data_service_.get() && web_data_service_->IsDatabaseLoaded()) {
return true;
} else {
- notification_registrar_.Add(this, NotificationType::WEB_DATABASE_LOADED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED,
NotificationService::AllSources());
return false;
}
@@ -62,12 +62,12 @@ void AutofillDataTypeController::OnPersonalDataChanged() {
StartDoneImpl(ASSOCIATION_FAILED, NOT_RUNNING, FROM_HERE);
}
} else {
- notification_registrar_.Add(this, NotificationType::WEB_DATABASE_LOADED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_WEB_DATABASE_LOADED,
NotificationService::AllSources());
}
}
-void AutofillDataTypeController::Observe(NotificationType type,
+void AutofillDataTypeController::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h
index 536ac39..e42ab0d 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller.h
+++ b/chrome/browser/sync/glue/autofill_data_type_controller.h
@@ -16,7 +16,6 @@
#include "content/common/notification_registrar.h"
class NotificationDetails;
-class NotificationType;
class NotificationSource;
namespace browser_sync {
@@ -35,7 +34,7 @@ class AutofillDataTypeController : public NonFrontendDataTypeController,
virtual browser_sync::ModelSafeGroup model_safe_group() const;
// NotificationObserver implementation.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
index a4e854e..51446bb 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -19,8 +19,8 @@
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/test/profile_mock.h"
#include "content/browser/browser_thread.h"
+#include "content/common/content_notification_types.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
using base::WaitableEvent;
diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.cc b/chrome/browser/sync/glue/autofill_profile_change_processor.cc
index ac6099c..8083188 100644
--- a/chrome/browser/sync/glue/autofill_profile_change_processor.cc
+++ b/chrome/browser/sync/glue/autofill_profile_change_processor.cc
@@ -19,10 +19,10 @@
#include "chrome/browser/sync/unrecoverable_error_handler.h"
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/web_database.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/guid.h"
#include "content/common/notification_registrar.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
namespace browser_sync {
@@ -92,10 +92,10 @@ void AutofillProfileChangeProcessor::ApplyChangesFromSyncModel(
}
}
-void AutofillProfileChangeProcessor::Observe(NotificationType type,
+void AutofillProfileChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK_EQ(type.value, NotificationType::AUTOFILL_PROFILE_CHANGED);
+ DCHECK_EQ(type, chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED);
WebDataService* wds = Source<WebDataService>(source).ptr();
if (!wds || wds->GetDatabase() != web_database_)
@@ -298,7 +298,7 @@ void AutofillProfileChangeProcessor::AddAutofillProfileSyncNode(
void AutofillProfileChangeProcessor::StartObserving() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
notification_registrar_.Add(this,
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
NotificationService::AllSources());
}
diff --git a/chrome/browser/sync/glue/autofill_profile_change_processor.h b/chrome/browser/sync/glue/autofill_profile_change_processor.h
index 0a15bc8..c9fd9fe 100644
--- a/chrome/browser/sync/glue/autofill_profile_change_processor.h
+++ b/chrome/browser/sync/glue/autofill_profile_change_processor.h
@@ -16,10 +16,10 @@
#include "chrome/browser/sync/unrecoverable_error_handler.h"
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/web_database.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"
namespace browser_sync {
@@ -43,7 +43,7 @@ class AutofillProfileChangeProcessor : public ChangeProcessor,
virtual void CommitChangesFromSyncModel();
// Virtual method implemented for the observer class.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
index 7819468..b7022b2 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
@@ -9,10 +9,10 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
namespace browser_sync {
@@ -37,7 +37,7 @@ bool BookmarkDataTypeController::StartModels() {
}
// Add an observer and continue when the bookmarks model is loaded.
- registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
Source<Profile>(sync_service_->profile()));
return false; // Don't continue Start.
}
@@ -47,11 +47,11 @@ void BookmarkDataTypeController::CleanUpState() {
registrar_.RemoveAll();
}
-void BookmarkDataTypeController::Observe(NotificationType type,
+void BookmarkDataTypeController::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_EQ(NotificationType::BOOKMARK_MODEL_LOADED, type.value);
+ DCHECK_EQ(chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, type);
registrar_.RemoveAll();
DCHECK_EQ(state_, MODEL_STARTING);
state_ = ASSOCIATING;
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h
index 2655056..b35c93e 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller.h
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h
@@ -13,7 +13,6 @@
#include "content/common/notification_registrar.h"
class NotificationDetails;
-class NotificationType;
class NotificationSource;
namespace browser_sync {
@@ -32,7 +31,7 @@ class BookmarkDataTypeController : public FrontendDataTypeController,
virtual syncable::ModelType type() const;
// NotificationObserver interface.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
index af20af5..235c014 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
@@ -15,11 +15,11 @@
#include "chrome/browser/sync/glue/model_associator_mock.h"
#include "chrome/browser/sync/profile_sync_factory_mock.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/profile_mock.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
using browser_sync::BookmarkDataTypeController;
@@ -118,7 +118,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelNotReady) {
// Send the notification that the bookmark model has started.
NotificationService::current()->Notify(
- NotificationType::BOOKMARK_MODEL_LOADED,
+ chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
Source<Profile>(&profile_),
NotificationService::NoDetails());
EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state());
diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc
index 5626a39..3cbb85f 100644
--- a/chrome/browser/sync/glue/data_type_manager_impl.cc
+++ b/chrome/browser/sync/glue/data_type_manager_impl.cc
@@ -13,6 +13,7 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/sync/glue/data_type_controller.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
#include "content/common/notification_service.h"
@@ -377,7 +378,7 @@ void DataTypeManagerImpl::FinishStopAndNotify(ConfigureResult result,
void DataTypeManagerImpl::NotifyStart() {
NotificationService::current()->Notify(
- NotificationType::SYNC_CONFIGURE_START,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START,
Source<DataTypeManager>(this),
NotificationService::NoDetails());
}
@@ -415,7 +416,7 @@ void DataTypeManagerImpl::NotifyDone(ConfigureResult result,
break;
}
NotificationService::current()->Notify(
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
Source<DataTypeManager>(this),
Details<ConfigureResultWithErrorLocation>(&result_with_location));
}
@@ -434,7 +435,7 @@ void DataTypeManagerImpl::SetBlockedAndNotify() {
VLOG(1) << "Accumulated spent configuring: "
<< configure_time_delta_.InSecondsF() << "s";
NotificationService::current()->Notify(
- NotificationType::SYNC_CONFIGURE_BLOCKED,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED,
Source<DataTypeManager>(this),
NotificationService::NoDetails());
}
diff --git a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc
index 1f5e3ef..1a2ba36 100644
--- a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc
+++ b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc
@@ -16,12 +16,12 @@
#include "chrome/browser/sync/glue/sync_backend_host_mock.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
#include "chrome/browser/sync/syncable/model_type.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
#include "content/common/notification_observer_mock.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"
@@ -73,10 +73,10 @@ class DataTypeManagerImplTest : public testing::Test {
protected:
virtual void SetUp() {
registrar_.Add(&observer_,
- NotificationType::SYNC_CONFIGURE_START,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START,
NotificationService::AllSources());
registrar_.Add(&observer_,
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
NotificationService::AllSources());
}
@@ -145,7 +145,7 @@ class DataTypeManagerImplTest : public testing::Test {
void SetConfigureStartExpectation() {
EXPECT_CALL(
observer_,
- Observe(NotificationType(NotificationType::SYNC_CONFIGURE_START),
+ Observe(int(chrome::NOTIFICATION_SYNC_CONFIGURE_START),
_, _));
}
@@ -153,7 +153,7 @@ class DataTypeManagerImplTest : public testing::Test {
void SetConfigureDoneExpectation(DataTypeManager::ConfigureResult result) {
EXPECT_CALL(
observer_,
- Observe(NotificationType(NotificationType::SYNC_CONFIGURE_DONE), _,
+ Observe(int(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), _,
::testing::ResultOf(&GetResult, result)));
}
diff --git a/chrome/browser/sync/glue/data_type_manager_mock.cc b/chrome/browser/sync/glue/data_type_manager_mock.cc
index 1f75b84..2a21712 100644
--- a/chrome/browser/sync/glue/data_type_manager_mock.cc
+++ b/chrome/browser/sync/glue/data_type_manager_mock.cc
@@ -4,6 +4,7 @@
#include "base/tracked.h"
#include "chrome/browser/sync/glue/data_type_manager_mock.h"
+#include "chrome/common/chrome_notification_types.h"
namespace browser_sync {
@@ -16,9 +17,9 @@ DataTypeManagerMock::DataTypeManagerMock()
ON_CALL(*this, Configure(testing::_, testing::_)).
WillByDefault(testing::DoAll(
NotifyFromDataTypeManager(this,
- NotificationType::SYNC_CONFIGURE_START),
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START),
NotifyFromDataTypeManagerWithResult
- (this, NotificationType::SYNC_CONFIGURE_DONE, &result_)));
+ (this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, &result_)));
// By default, calling ConfigureWithoutNigori will send a SYNC_CONFIGURE_START
// and SYNC_CONFIGURE_DONE notification with a DataTypeManager::OK
@@ -26,9 +27,9 @@ DataTypeManagerMock::DataTypeManagerMock()
ON_CALL(*this, ConfigureWithoutNigori(testing::_, testing::_)).
WillByDefault(testing::DoAll(
NotifyFromDataTypeManager(this,
- NotificationType::SYNC_CONFIGURE_START),
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START),
NotifyFromDataTypeManagerWithResult
- (this, NotificationType::SYNC_CONFIGURE_DONE, &result_)));
+ (this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, &result_)));
}
DataTypeManagerMock::~DataTypeManagerMock() {}
diff --git a/chrome/browser/sync/glue/data_type_manager_mock.h b/chrome/browser/sync/glue/data_type_manager_mock.h
index 0645164..be45d9f 100644
--- a/chrome/browser/sync/glue/data_type_manager_mock.h
+++ b/chrome/browser/sync/glue/data_type_manager_mock.h
@@ -8,9 +8,9 @@
#include "chrome/browser/sync/glue/data_type_manager.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
+#include "content/common/content_notification_types.h"
#include "content/common/notification_details.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
ACTION_P3(NotifyFromDataTypeManagerWithResult, dtm, type, result) {
diff --git a/chrome/browser/sync/glue/extension_change_processor.cc b/chrome/browser/sync/glue/extension_change_processor.cc
index 736f34a..9d6ed26 100644
--- a/chrome/browser/sync/glue/extension_change_processor.cc
+++ b/chrome/browser/sync/glue/extension_change_processor.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/sync/glue/extension_sync.h"
#include "chrome/browser/sync/glue/extension_util.h"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
@@ -39,24 +40,24 @@ ExtensionChangeProcessor::~ExtensionChangeProcessor() {
// the browser or the syncapi are done in order; this is tricky since
// some events (e.g., extension installation) are done asynchronously.
-void ExtensionChangeProcessor::Observe(NotificationType type,
+void ExtensionChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(running());
DCHECK(profile_);
- if ((type != NotificationType::EXTENSION_LOADED) &&
- (type != NotificationType::EXTENSION_UPDATE_DISABLED) &&
- (type != NotificationType::EXTENSION_UNLOADED)) {
+ if ((type != chrome::NOTIFICATION_EXTENSION_LOADED) &&
+ (type != chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED) &&
+ (type != chrome::NOTIFICATION_EXTENSION_UNLOADED)) {
LOG(DFATAL) << "Received unexpected notification of type "
- << type.value;
+ << type;
return;
}
// Filter out unhandled extensions first.
DCHECK_EQ(Source<Profile>(source).ptr(), profile_);
const Extension& extension =
- (type == NotificationType::EXTENSION_UNLOADED) ?
+ (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) ?
*Details<UnloadedExtensionInfo>(details)->extension :
*Details<const Extension>(details).ptr();
if (!traits_.is_valid_and_syncable(extension)) {
@@ -66,7 +67,7 @@ void ExtensionChangeProcessor::Observe(NotificationType type,
const std::string& id = extension.id();
// Then handle extension uninstalls.
- if (type == NotificationType::EXTENSION_UNLOADED) {
+ if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) {
const UnloadedExtensionInfo& info =
*Details<UnloadedExtensionInfo>(details).ptr();
if (info.reason == UnloadedExtensionInfo::UNINSTALL) {
@@ -78,7 +79,7 @@ void ExtensionChangeProcessor::Observe(NotificationType type,
}
VLOG(1) << "Updating server data for extension " << id
- << " (notification type = " << type.value << ")";
+ << " (notification type = " << type << ")";
std::string error;
if (!UpdateServerData(traits_, extension, *extension_service_,
share_handle(), &error)) {
@@ -163,16 +164,16 @@ void ExtensionChangeProcessor::StartObserving() {
DCHECK(profile_);
notification_registrar_.Add(
- this, NotificationType::EXTENSION_LOADED,
+ this, chrome::NOTIFICATION_EXTENSION_LOADED,
Source<Profile>(profile_));
// Despite the name, this notification is exactly like
// EXTENSION_LOADED but with an initial state of DISABLED.
notification_registrar_.Add(
- this, NotificationType::EXTENSION_UPDATE_DISABLED,
+ this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
Source<Profile>(profile_));
notification_registrar_.Add(
- this, NotificationType::EXTENSION_UNLOADED,
+ this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
Source<Profile>(profile_));
}
diff --git a/chrome/browser/sync/glue/extension_change_processor.h b/chrome/browser/sync/glue/extension_change_processor.h
index 7f1d916..f2493be 100644
--- a/chrome/browser/sync/glue/extension_change_processor.h
+++ b/chrome/browser/sync/glue/extension_change_processor.h
@@ -10,9 +10,9 @@
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/extension_sync_traits.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 ExtensionServiceInterface;
@@ -33,7 +33,7 @@ class ExtensionChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// BrowserExtensionProvider -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc
index 67d9187..d2f4d13 100644
--- a/chrome/browser/sync/glue/password_change_processor.cc
+++ b/chrome/browser/sync/glue/password_change_processor.cc
@@ -15,9 +15,10 @@
#include "chrome/browser/sync/glue/password_model_associator.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/protocol/password_specifics.pb.h"
+#include "chrome/common/chrome_notification_types.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 "webkit/glue/password_form.h"
namespace browser_sync {
@@ -45,11 +46,11 @@ PasswordChangeProcessor::~PasswordChangeProcessor() {
DCHECK(expected_loop_ == MessageLoop::current());
}
-void PasswordChangeProcessor::Observe(NotificationType type,
+void PasswordChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(expected_loop_ == MessageLoop::current());
- DCHECK(NotificationType::LOGINS_CHANGED == type);
+ DCHECK(chrome::NOTIFICATION_LOGINS_CHANGED == type);
if (!observing_)
return;
@@ -222,14 +223,14 @@ void PasswordChangeProcessor::StopImpl() {
void PasswordChangeProcessor::StartObserving() {
DCHECK(expected_loop_ == MessageLoop::current());
notification_registrar_.Add(this,
- NotificationType::LOGINS_CHANGED,
+ chrome::NOTIFICATION_LOGINS_CHANGED,
Source<PasswordStore>(password_store_));
}
void PasswordChangeProcessor::StopObserving() {
DCHECK(expected_loop_ == MessageLoop::current());
notification_registrar_.Remove(this,
- NotificationType::LOGINS_CHANGED,
+ chrome::NOTIFICATION_LOGINS_CHANGED,
Source<PasswordStore>(password_store_));
}
diff --git a/chrome/browser/sync/glue/password_change_processor.h b/chrome/browser/sync/glue/password_change_processor.h
index 155a1b3..fdfd009 100644
--- a/chrome/browser/sync/glue/password_change_processor.h
+++ b/chrome/browser/sync/glue/password_change_processor.h
@@ -12,9 +12,9 @@
#include "base/compiler_specific.h"
#include "chrome/browser/sync/glue/password_model_associator.h"
#include "chrome/browser/sync/glue/sync_backend_host.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 PasswordStore;
class MessageLoop;
@@ -38,7 +38,7 @@ class PasswordChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// Passwords -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc
index 2b33c7b..b2d0bd4 100644
--- a/chrome/browser/sync/glue/session_change_processor.cc
+++ b/chrome/browser/sync/glue/session_change_processor.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/sync/glue/session_model_associator.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_details.h"
@@ -53,7 +54,7 @@ SessionChangeProcessor::~SessionChangeProcessor() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-void SessionChangeProcessor::Observe(NotificationType type,
+void SessionChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -63,8 +64,8 @@ void SessionChangeProcessor::Observe(NotificationType type,
// Track which windows and/or tabs are modified.
std::vector<TabContentsWrapper*> modified_tabs;
bool windows_changed = false;
- switch (type.value) {
- case NotificationType::BROWSER_OPENED: {
+ switch (type) {
+ case chrome::NOTIFICATION_BROWSER_OPENED: {
Browser* browser = Source<Browser>(source).ptr();
if (browser->profile() != profile_) {
return;
@@ -74,7 +75,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::TAB_PARENTED: {
+ case content::NOTIFICATION_TAB_PARENTED: {
TabContentsWrapper* tab = Source<TabContentsWrapper>(source).ptr();
if (tab->profile() != profile_) {
return;
@@ -84,7 +85,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::TAB_CLOSED: {
+ case content::NOTIFICATION_TAB_CLOSED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -96,7 +97,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::NAV_LIST_PRUNED: {
+ case content::NOTIFICATION_NAV_LIST_PRUNED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -107,7 +108,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::NAV_ENTRY_CHANGED: {
+ case content::NOTIFICATION_NAV_ENTRY_CHANGED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -118,7 +119,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::NAV_ENTRY_COMMITTED: {
+ case content::NOTIFICATION_NAV_ENTRY_COMMITTED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -129,7 +130,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
break;
}
- case NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: {
+ case chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: {
ExtensionTabHelper* extension_tab_helper =
Source<ExtensionTabHelper>(source).ptr();
if (extension_tab_helper->tab_contents()->profile() != profile_) {
@@ -142,7 +143,7 @@ void SessionChangeProcessor::Observe(NotificationType type,
}
default:
LOG(ERROR) << "Received unexpected notification of type "
- << type.value;
+ << type;
break;
}
@@ -220,7 +221,7 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel(
// Notify foreign session handlers that there are new sessions.
NotificationService::current()->Notify(
- NotificationType::FOREIGN_SESSION_UPDATED,
+ chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
NotificationService::AllSources(),
NotificationService::NoDetails());
@@ -244,20 +245,20 @@ void SessionChangeProcessor::StopImpl() {
void SessionChangeProcessor::StartObserving() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(profile_);
- notification_registrar_.Add(this, NotificationType::TAB_PARENTED,
+ notification_registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::TAB_CLOSED,
+ notification_registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_LIST_PRUNED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_ENTRY_CHANGED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_CHANGED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::BROWSER_OPENED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
NotificationService::AllSources());
notification_registrar_.Add(this,
- NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED,
+ chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED,
NotificationService::AllSources());
}
diff --git a/chrome/browser/sync/glue/session_change_processor.h b/chrome/browser/sync/glue/session_change_processor.h
index 6213443..62fa5c8 100644
--- a/chrome/browser/sync/glue/session_change_processor.h
+++ b/chrome/browser/sync/glue/session_change_processor.h
@@ -11,9 +11,9 @@
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/change_processor.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 NotificationDetails;
class NotificationSource;
@@ -43,7 +43,7 @@ class SessionChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// BrowserSessionProvider -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index 7d4eeb0..17126a5 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/navigation_controller.h"
@@ -426,7 +427,7 @@ bool SessionModelAssociator::DisassociateModels() {
// There is no local model stored with which to disassociate, just notify
// foreign session handlers.
NotificationService::current()->Notify(
- NotificationType::FOREIGN_SESSION_DISABLED,
+ chrome::NOTIFICATION_FOREIGN_SESSION_DISABLED,
NotificationService::AllSources(),
NotificationService::NoDetails());
return true;
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 4c860dc..1074328 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -33,13 +33,13 @@
#include "chrome/browser/sync/syncable/directory_manager.h" // Cryptographer.
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/nigori_util.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/pref_names.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/webkit_glue.h"
@@ -537,7 +537,7 @@ void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TokenAvailableDetails details(GaiaConstants::kSyncService, token);
NotificationService::current()->Notify(
- NotificationType::TOKEN_UPDATED,
+ chrome::NOTIFICATION_TOKEN_UPDATED,
NotificationService::AllSources(),
Details<const TokenAvailableDetails>(&details));
}
diff --git a/chrome/browser/sync/glue/sync_backend_host_mock.h b/chrome/browser/sync/glue/sync_backend_host_mock.h
index 882265c..ad063e0 100644
--- a/chrome/browser/sync/glue/sync_backend_host_mock.h
+++ b/chrome/browser/sync/glue/sync_backend_host_mock.h
@@ -11,7 +11,7 @@
#include "base/task.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
-#include "content/common/notification_type.h"
+#include "content/common/content_notification_types.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace browser_sync {
diff --git a/chrome/browser/sync/glue/theme_change_processor.cc b/chrome/browser/sync/glue/theme_change_processor.cc
index ace9931..8ffd402 100644
--- a/chrome/browser/sync/glue/theme_change_processor.cc
+++ b/chrome/browser/sync/glue/theme_change_processor.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/sync/protocol/theme_specifics.pb.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
@@ -27,12 +28,12 @@ ThemeChangeProcessor::ThemeChangeProcessor(
ThemeChangeProcessor::~ThemeChangeProcessor() {}
-void ThemeChangeProcessor::Observe(NotificationType type,
+void ThemeChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(running());
DCHECK(profile_);
- DCHECK(type == NotificationType::BROWSER_THEME_CHANGED);
+ DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED);
sync_api::WriteTransaction trans(FROM_HERE, share_handle());
sync_api::WriteNode node(&trans);
@@ -121,7 +122,7 @@ void ThemeChangeProcessor::StartObserving() {
DCHECK(profile_);
VLOG(1) << "Observing BROWSER_THEME_CHANGED";
notification_registrar_.Add(
- this, NotificationType::BROWSER_THEME_CHANGED,
+ this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
Source<ThemeService>(
ThemeServiceFactory::GetForProfile(profile_)));
}
diff --git a/chrome/browser/sync/glue/theme_change_processor.h b/chrome/browser/sync/glue/theme_change_processor.h
index 7a94c92..72c7473 100644
--- a/chrome/browser/sync/glue/theme_change_processor.h
+++ b/chrome/browser/sync/glue/theme_change_processor.h
@@ -9,9 +9,9 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/change_processor.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 NotificationDetails;
class NotificationSource;
@@ -33,7 +33,7 @@ class ThemeChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// ThemeService -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index 2b79fd0..2c10771 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -13,8 +13,8 @@
#include "chrome/browser/sync/glue/typed_url_model_associator.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
namespace browser_sync {
@@ -50,7 +50,7 @@ TypedUrlChangeProcessor::~TypedUrlChangeProcessor() {
DCHECK(expected_loop_ == MessageLoop::current());
}
-void TypedUrlChangeProcessor::Observe(NotificationType type,
+void TypedUrlChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(expected_loop_ == MessageLoop::current());
@@ -59,14 +59,14 @@ void TypedUrlChangeProcessor::Observe(NotificationType type,
VLOG(1) << "Observed typed_url change.";
DCHECK(running());
- DCHECK(NotificationType::HISTORY_TYPED_URLS_MODIFIED == type ||
- NotificationType::HISTORY_URLS_DELETED == type ||
- NotificationType::HISTORY_URL_VISITED == type);
- if (type == NotificationType::HISTORY_TYPED_URLS_MODIFIED) {
+ DCHECK(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED == type ||
+ chrome::NOTIFICATION_HISTORY_URLS_DELETED == type ||
+ chrome::NOTIFICATION_HISTORY_URL_VISITED == type);
+ if (type == chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED) {
HandleURLsModified(Details<history::URLsModifiedDetails>(details).ptr());
- } else if (type == NotificationType::HISTORY_URLS_DELETED) {
+ } else if (type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) {
HandleURLsDeleted(Details<history::URLsDeletedDetails>(details).ptr());
- } else if (type == NotificationType::HISTORY_URL_VISITED) {
+ } else if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED) {
HandleURLsVisited(Details<history::URLVisitedDetails>(details).ptr());
}
}
@@ -347,24 +347,24 @@ void TypedUrlChangeProcessor::StopImpl() {
void TypedUrlChangeProcessor::StartObserving() {
DCHECK(expected_loop_ == MessageLoop::current());
notification_registrar_.Add(this,
- NotificationType::HISTORY_TYPED_URLS_MODIFIED,
+ chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::HISTORY_URL_VISITED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URL_VISITED,
NotificationService::AllSources());
}
void TypedUrlChangeProcessor::StopObserving() {
DCHECK(expected_loop_ == MessageLoop::current());
+ notification_registrar_.Remove(
+ this, chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
+ NotificationService::AllSources());
notification_registrar_.Remove(this,
- NotificationType::HISTORY_TYPED_URLS_MODIFIED,
+ chrome::NOTIFICATION_HISTORY_URLS_DELETED,
NotificationService::AllSources());
notification_registrar_.Remove(this,
- NotificationType::HISTORY_URLS_DELETED,
- NotificationService::AllSources());
- notification_registrar_.Remove(this,
- NotificationType::HISTORY_URL_VISITED,
+ chrome::NOTIFICATION_HISTORY_URL_VISITED,
NotificationService::AllSources());
}
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.h b/chrome/browser/sync/glue/typed_url_change_processor.h
index a2153f6..cc62a48 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.h
+++ b/chrome/browser/sync/glue/typed_url_change_processor.h
@@ -13,9 +13,9 @@
#include "base/time.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/glue/typed_url_model_associator.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 MessageLoop;
class NotificationService;
@@ -45,7 +45,7 @@ class TypedUrlChangeProcessor : public ChangeProcessor,
// NotificationObserver implementation.
// History -> sync_api model change application.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
index ee5e249..9e4bd71 100644
--- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc
+++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
@@ -71,7 +72,7 @@ bool TypedUrlDataTypeController::StartModels() {
history_service_ = history;
return true;
} else {
- notification_registrar_.Add(this, NotificationType::HISTORY_LOADED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
NotificationService::AllSources());
return false;
}
@@ -99,13 +100,13 @@ void TypedUrlDataTypeController::CreateSyncComponents() {
set_change_processor(sync_components.change_processor);
}
-void TypedUrlDataTypeController::Observe(NotificationType type,
+void TypedUrlDataTypeController::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_EQ(state(), MODEL_STARTING);
notification_registrar_.Remove(this,
- NotificationType::HISTORY_LOADED,
+ chrome::NOTIFICATION_HISTORY_LOADED,
NotificationService::AllSources());
history_service_ = profile()->GetHistoryServiceWithoutCreating();
DCHECK(history_service_.get());
diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h
index 18f0a04..9720614 100644
--- a/chrome/browser/sync/glue/typed_url_data_type_controller.h
+++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h
@@ -11,9 +11,9 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/sync/glue/non_frontend_data_type_controller.h"
#include "content/browser/cancelable_request.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 NotificationSource;
class NotificationDetails;
@@ -41,7 +41,7 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController,
virtual browser_sync::ModelSafeGroup model_safe_group() const;
// NotificationObserver implementation.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/notifier/invalidation_util.cc b/chrome/browser/sync/notifier/invalidation_util.cc
index e4e0ea5..360d153 100644
--- a/chrome/browser/sync/notifier/invalidation_util.cc
+++ b/chrome/browser/sync/notifier/invalidation_util.cc
@@ -17,7 +17,7 @@ void RunAndDeleteClosure(invalidation::Closure* task) {
bool RealModelTypeToObjectId(syncable::ModelType model_type,
invalidation::ObjectId* object_id) {
std::string notification_type;
- if (!syncable::RealModelTypeToNotificationType(
+ if (!syncable::RealModelTypeToint(
model_type, &notification_type)) {
return false;
}
@@ -29,7 +29,7 @@ bool RealModelTypeToObjectId(syncable::ModelType model_type,
bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
syncable::ModelType* model_type) {
return
- syncable::NotificationTypeToRealModelType(
+ syncable::intToRealModelType(
object_id.name(), model_type);
}
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index e124c59..2debdea 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/sync/signin_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/net/gaia/gaia_constants.h"
@@ -46,7 +47,6 @@
#include "chrome/common/url_constants.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 "net/base/cookie_monster.h"
#include "ui/base/l10n/l10n_util.h"
@@ -175,20 +175,20 @@ void ProfileSyncService::Initialize() {
void ProfileSyncService::RegisterAuthNotifications() {
registrar_.Add(this,
- NotificationType::TOKEN_AVAILABLE,
+ chrome::NOTIFICATION_TOKEN_AVAILABLE,
Source<TokenService>(profile_->GetTokenService()));
registrar_.Add(this,
- NotificationType::TOKEN_LOADING_FINISHED,
+ chrome::NOTIFICATION_TOKEN_LOADING_FINISHED,
Source<TokenService>(profile_->GetTokenService()));
registrar_.Add(this,
- NotificationType::GOOGLE_SIGNIN_SUCCESSFUL,
+ chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
Source<Profile>(profile_));
registrar_.Add(this,
- NotificationType::GOOGLE_SIGNIN_FAILED,
+ chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
Source<Profile>(profile_));
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSyncOAuth)) {
registrar_.Add(this,
- NotificationType::COOKIE_CHANGED,
+ chrome::NOTIFICATION_COOKIE_CHANGED,
Source<Profile>(profile_));
}
}
@@ -409,10 +409,10 @@ void ProfileSyncService::Shutdown(bool sync_disabled) {
}
registrar_.Remove(this,
- NotificationType::SYNC_CONFIGURE_START,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START,
Source<DataTypeManager>(data_type_manager_.get()));
registrar_.Remove(this,
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
Source<DataTypeManager>(data_type_manager_.get()));
data_type_manager_.reset();
}
@@ -1093,10 +1093,10 @@ void ProfileSyncService::ConfigureDataTypeManager() {
factory_->CreateDataTypeManager(backend_.get(),
data_type_controllers_));
registrar_.Add(this,
- NotificationType::SYNC_CONFIGURE_START,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START,
Source<DataTypeManager>(data_type_manager_.get()));
registrar_.Add(this,
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
Source<DataTypeManager>(data_type_manager_.get()));
// We create the migrator at the same time.
@@ -1238,16 +1238,16 @@ void ProfileSyncService::GetEncryptedDataTypes(
}
}
-void ProfileSyncService::Observe(NotificationType type,
+void ProfileSyncService::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::SYNC_CONFIGURE_START: {
+ switch (type) {
+ case chrome::NOTIFICATION_SYNC_CONFIGURE_START: {
NotifyObservers();
// TODO(sync): Maybe toast?
break;
}
- case NotificationType::SYNC_CONFIGURE_DONE: {
+ case chrome::NOTIFICATION_SYNC_CONFIGURE_DONE: {
DataTypeManager::ConfigureResultWithErrorLocation* result_with_location =
Details<DataTypeManager::ConfigureResultWithErrorLocation>(
details).ptr();
@@ -1300,7 +1300,7 @@ void ProfileSyncService::Observe(NotificationType type,
}
break;
}
- case NotificationType::PREF_CHANGED: {
+ case chrome::NOTIFICATION_PREF_CHANGED: {
std::string* pref_name = Details<std::string>(details).ptr();
if (*pref_name == prefs::kSyncManaged) {
NotifyObservers();
@@ -1312,7 +1312,7 @@ void ProfileSyncService::Observe(NotificationType type,
}
break;
}
- case NotificationType::GOOGLE_SIGNIN_SUCCESSFUL: {
+ case chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL: {
const GoogleServiceSigninSuccessDetails* successful =
(Details<const GoogleServiceSigninSuccessDetails>(details).ptr());
// We pass 'false' to SetPassphrase to denote that this is an implicit
@@ -1323,13 +1323,13 @@ void ProfileSyncService::Observe(NotificationType type,
SetPassphrase(successful->password, false, true);
break;
}
- case NotificationType::GOOGLE_SIGNIN_FAILED: {
+ case chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED: {
GoogleServiceAuthError error =
*(Details<const GoogleServiceAuthError>(details).ptr());
UpdateAuthErrorState(error);
break;
}
- case NotificationType::TOKEN_AVAILABLE: {
+ case chrome::NOTIFICATION_TOKEN_AVAILABLE: {
if (AreCredentialsAvailable()) {
if (backend_initialized_) {
backend_->UpdateCredentials(GetCredentials());
@@ -1340,7 +1340,7 @@ void ProfileSyncService::Observe(NotificationType type,
}
break;
}
- case NotificationType::TOKEN_LOADING_FINISHED: {
+ case chrome::NOTIFICATION_TOKEN_LOADING_FINISHED: {
// If not in Chrome OS, and we have a username without tokens,
// the user will need to signin again, so sign out.
if (cros_user_.empty() &&
@@ -1350,7 +1350,7 @@ void ProfileSyncService::Observe(NotificationType type,
}
break;
}
- case NotificationType::COOKIE_CHANGED: {
+ case chrome::NOTIFICATION_COOKIE_CHANGED: {
OnCookieChanged(Source<Profile>(source).ptr(),
Details<ChromeCookieDetails>(details).ptr());
break;
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index c25acb8..8e8c658 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -27,9 +27,9 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/unrecoverable_error_handler.h"
#include "chrome/common/net/gaia/google_service_auth_error.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 "googleurl/src/gurl.h"
class NotificationDetails;
@@ -398,7 +398,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
browser_sync::ChangeProcessor* change_processor);
// NotificationObserver implementation.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index eecc767..f00e7ba 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -41,11 +41,11 @@
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/autofill_table.h"
#include "chrome/browser/webdata/web_database.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/test/sync/engine/test_id_factory.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
using base::Time;
@@ -871,7 +871,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddEntry) {
AutofillChangeList changes;
changes.push_back(AutofillChange(AutofillChange::ADD, added_entry.key()));
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillChangeList>(&changes));
@@ -900,7 +900,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddProfile) {
AutofillProfileChange change(AutofillProfileChange::ADD,
added_profile.guid(), &added_profile);
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillProfileChange>(&change));
@@ -934,7 +934,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateEntry) {
changes.push_back(AutofillChange(AutofillChange::UPDATE,
updated_entry.key()));
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillChangeList>(&changes));
@@ -964,7 +964,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveEntry) {
changes.push_back(AutofillChange(AutofillChange::REMOVE,
original_entry.key()));
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillChangeList>(&changes));
@@ -1002,7 +1002,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveProfile) {
AutofillProfileChange change(AutofillProfileChange::REMOVE,
sync_profile.guid(), NULL);
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_PROFILE_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillProfileChange>(&change));
@@ -1029,7 +1029,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeError) {
changes.push_back(AutofillChange(AutofillChange::ADD,
evil_entry.key()));
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&db_thread_));
- notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillChangeList>(&changes));
@@ -1041,7 +1041,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeError) {
EXPECT_TRUE(service_->unrecoverable_error_detected());
// Ensure future autofill notifications don't crash.
- notifier->Notify(NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ notifier->Notify(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(web_data_service_.get()),
Details<AutofillChangeList>(&changes));
}
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc
index 0433b67..01bb428 100644
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/sync/engine/test_id_factory.h"
@@ -34,7 +35,6 @@
#include "content/browser/browser_thread.h"
#include "content/common/notification_observer_mock.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "webkit/glue/password_form.h"
@@ -161,10 +161,10 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest {
notification_service_ = new ThreadNotificationService(&db_thread_);
notification_service_->Init();
registrar_.Add(&observer_,
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
NotificationService::AllSources());
registrar_.Add(&observer_,
- NotificationType::SYNC_CONFIGURE_BLOCKED,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED,
NotificationService::AllSources());
}
@@ -222,11 +222,11 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest {
EXPECT_CALL(observer_,
Observe(
- NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_));
+ int(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE),_,_));
EXPECT_CALL(observer_,
Observe(
- NotificationType(
- NotificationType::SYNC_CONFIGURE_BLOCKED),_,_))
+ int(
+ chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED),_,_))
.WillOnce(InvokeWithoutArgs(QuitMessageLoop));
service_->RegisterDataTypeController(data_type_controller);
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc
index 590b2ad..e470daf 100644
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/test/browser_with_test_window_test.h"
#include "chrome/test/profile_mock.h"
@@ -78,15 +79,15 @@ class ProfileSyncServiceSessionTest
helper_.set_service(session_service);
service()->SetWindowType(window_id_, Browser::TYPE_TABBED);
service()->SetWindowBounds(window_id_, window_bounds_, false);
- registrar_.Add(this, NotificationType::FOREIGN_SESSION_UPDATED,
+ registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
NotificationService::AllSources());
}
- void Observe(NotificationType type,
+ void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::FOREIGN_SESSION_UPDATED:
+ switch (type) {
+ case chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED:
notified_of_update_ = true;
break;
default:
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index dc1db0c..beb9673 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -13,12 +13,12 @@
#include "chrome/browser/sync/profile_sync_factory_mock.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/testing_profile.h"
#include "content/browser/browser_thread.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
using browser_sync::DataTypeManager;
@@ -251,9 +251,9 @@ TEST_F(ProfileSyncServiceStartupTest, SKIP_MACOSX(StartFailure)) {
configure_result, FROM_HERE, syncable::ModelTypeSet());
EXPECT_CALL(*data_type_manager, Configure(_, _)).
WillRepeatedly(DoAll(NotifyFromDataTypeManager(data_type_manager,
- NotificationType::SYNC_CONFIGURE_START),
+ chrome::NOTIFICATION_SYNC_CONFIGURE_START),
NotifyFromDataTypeManagerWithResult(data_type_manager,
- NotificationType::SYNC_CONFIGURE_DONE,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
&result)));
EXPECT_CALL(*data_type_manager, state()).
WillOnce(Return(DataTypeManager::STOPPED));
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
index f065743..bb2a4f9 100644
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/test_profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/test/profile_mock.h"
#include "chrome/test/sync/engine/test_id_factory.h"
@@ -434,7 +435,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAdd) {
history::URLsModifiedDetails details;
details.changed_urls.push_back(added_entry);
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_TYPED_URLS_MODIFIED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
Details<history::URLsModifiedDetails>(&details));
std::vector<history::URLRow> new_sync_entries;
@@ -470,7 +471,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) {
history::URLsModifiedDetails details;
details.changed_urls.push_back(updated_entry);
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_TYPED_URLS_MODIFIED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED,
Details<history::URLsModifiedDetails>(&details));
std::vector<history::URLRow> new_sync_entries;
@@ -497,7 +498,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddFromVisit) {
details.row = added_entry;
details.transition = PageTransition::TYPED;
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_URL_VISITED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
Details<history::URLVisitedDetails>(&details));
std::vector<history::URLRow> new_sync_entries;
@@ -534,7 +535,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) {
details.row = updated_entry;
details.transition = PageTransition::TYPED;
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_URL_VISITED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
Details<history::URLVisitedDetails>(&details));
std::vector<history::URLRow> new_sync_entries;
@@ -573,7 +574,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
// Should ignore this change because it's not TYPED.
details.transition = PageTransition::RELOAD;
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_URL_VISITED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
Details<history::URLVisitedDetails>(&details));
GetTypedUrlsFromSyncDB(&new_sync_entries);
@@ -589,7 +590,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
&updated_visits));
details.row = twelve_visits;
details.transition = PageTransition::TYPED;
- notifier->Notify(NotificationType::HISTORY_URL_VISITED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
Details<history::URLVisitedDetails>(&details));
GetTypedUrlsFromSyncDB(&new_sync_entries);
// Should be no changes to the sync DB from this notification.
@@ -603,7 +604,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
&updated_visits));
details.row = twenty_visits;
details.transition = PageTransition::TYPED;
- notifier->Notify(NotificationType::HISTORY_URL_VISITED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
Details<history::URLVisitedDetails>(&details));
GetTypedUrlsFromSyncDB(&new_sync_entries);
ASSERT_EQ(1U, new_sync_entries.size());
@@ -636,7 +637,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemove) {
changes.all_history = false;
changes.urls.insert(GURL("http://mine.com"));
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_URLS_DELETED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_DELETED,
Details<history::URLsDeletedDetails>(&changes));
std::vector<history::URLRow> new_sync_entries;
@@ -670,7 +671,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveAll) {
history::URLsDeletedDetails changes;
changes.all_history = true;
scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_));
- notifier->Notify(NotificationType::HISTORY_URLS_DELETED,
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_DELETED,
Details<history::URLsDeletedDetails>(&changes));
std::vector<history::URLRow> new_sync_entries;
diff --git a/chrome/browser/sync/profile_sync_test_util.cc b/chrome/browser/sync/profile_sync_test_util.cc
index a533fd4..26c89a4 100644
--- a/chrome/browser/sync/profile_sync_test_util.cc
+++ b/chrome/browser/sync/profile_sync_test_util.cc
@@ -49,12 +49,12 @@ ThreadNotifier::ThreadNotifier(base::Thread* notify_thread)
: done_event_(false, false),
notify_thread_(notify_thread) {}
-void ThreadNotifier::Notify(NotificationType type,
+void ThreadNotifier::Notify(int type,
const NotificationDetails& details) {
Notify(type, NotificationService::AllSources(), details);
}
-void ThreadNotifier::Notify(NotificationType type,
+void ThreadNotifier::Notify(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -70,7 +70,7 @@ void ThreadNotifier::Notify(NotificationType type,
ThreadNotifier::~ThreadNotifier() {}
-void ThreadNotifier::NotifyTask(NotificationType type,
+void ThreadNotifier::NotifyTask(int type,
const NotificationSource& source,
const NotificationDetails& details) {
NotificationService::current()->Notify(type, source, details);
diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h
index 9adfe3c..561f124 100644
--- a/chrome/browser/sync/profile_sync_test_util.h
+++ b/chrome/browser/sync/profile_sync_test_util.h
@@ -14,9 +14,9 @@
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
#include "content/browser/browser_thread.h"
+#include "content/common/content_notification_types.h"
#include "content/common/notification_service.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace base {
@@ -67,9 +67,9 @@ class ThreadNotifier : // NOLINT
public:
explicit ThreadNotifier(base::Thread* notify_thread);
- void Notify(NotificationType type, const NotificationDetails& details);
+ void Notify(int type, const NotificationDetails& details);
- void Notify(NotificationType type,
+ void Notify(int type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -77,7 +77,7 @@ class ThreadNotifier : // NOLINT
friend class base::RefCountedThreadSafe<ThreadNotifier>;
virtual ~ThreadNotifier();
- void NotifyTask(NotificationType type,
+ void NotifyTask(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/signin_manager.cc b/chrome/browser/sync/signin_manager.cc
index 58e516a..1ecd9cd 100644
--- a/chrome/browser/sync/signin_manager.cc
+++ b/chrome/browser/sync/signin_manager.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/chrome_switches.h"
@@ -42,10 +43,10 @@ void SigninManager::Initialize(Profile* profile) {
void SigninManager::CleanupNotificationRegistration() {
#if !defined(OS_CHROMEOS)
if (registrar_.IsRegistered(this,
- NotificationType::TOKEN_AVAILABLE,
+ chrome::NOTIFICATION_TOKEN_AVAILABLE,
NotificationService::AllSources())) {
registrar_.Remove(this,
- NotificationType::TOKEN_AVAILABLE,
+ chrome::NOTIFICATION_TOKEN_AVAILABLE,
NotificationService::AllSources());
}
#endif
@@ -92,7 +93,7 @@ void SigninManager::StartSignIn(const std::string& username,
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableAutoLogin)) {
registrar_.Add(this,
- NotificationType::TOKEN_AVAILABLE,
+ chrome::NOTIFICATION_TOKEN_AVAILABLE,
NotificationService::AllSources());
}
#endif
@@ -147,7 +148,7 @@ void SigninManager::OnGetUserInfoSuccess(const std::string& key,
GoogleServiceSigninSuccessDetails details(username_, password_);
NotificationService::current()->Notify(
- NotificationType::GOOGLE_SIGNIN_SUCCESSFUL,
+ chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
Source<Profile>(profile_),
Details<const GoogleServiceSigninSuccessDetails>(&details));
@@ -180,7 +181,7 @@ void SigninManager::OnTokenAuthFailure(const GoogleServiceAuthError& error) {
void SigninManager::OnClientLoginFailure(const GoogleServiceAuthError& error) {
NotificationService::current()->Notify(
- NotificationType::GOOGLE_SIGNIN_FAILED,
+ chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
Source<Profile>(profile_),
Details<const GoogleServiceAuthError>(&error));
@@ -198,11 +199,11 @@ void SigninManager::OnClientLoginFailure(const GoogleServiceAuthError& error) {
SignOut();
}
-void SigninManager::Observe(NotificationType type,
+void SigninManager::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
#if !defined(OS_CHROMEOS)
- DCHECK(type == NotificationType::TOKEN_AVAILABLE);
+ DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE);
TokenService::TokenAvailableDetails* tok_details =
Details<TokenService::TokenAvailableDetails>(details).ptr();
diff --git a/chrome/browser/sync/signin_manager.h b/chrome/browser/sync/signin_manager.h
index 76a8e78..4632eaf 100644
--- a/chrome/browser/sync/signin_manager.h
+++ b/chrome/browser/sync/signin_manager.h
@@ -82,7 +82,7 @@ class SigninManager : public GaiaAuthConsumer , public NotificationObserver {
OVERRIDE;
// NotificationObserver
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
diff --git a/chrome/browser/sync/signin_manager_unittest.cc b/chrome/browser/sync/signin_manager_unittest.cc
index d9fadb3..7d1325a 100644
--- a/chrome/browser/sync/signin_manager_unittest.cc
+++ b/chrome/browser/sync/signin_manager_unittest.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/net/gaia/token_service_unittest.h"
#include "chrome/browser/password_manager/encryptor.h"
#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/test/signaling_task.h"
#include "chrome/test/testing_profile.h"
@@ -22,9 +23,10 @@ class SigninManagerTest : public TokenServiceTestHarness {
virtual void SetUp() {
TokenServiceTestHarness::SetUp();
manager_.reset(new SigninManager());
- google_login_success_.ListenFor(NotificationType::GOOGLE_SIGNIN_SUCCESSFUL,
- Source<Profile>(profile_.get()));
- google_login_failure_.ListenFor(NotificationType::GOOGLE_SIGNIN_FAILED,
+ google_login_success_.ListenFor(
+ chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
+ Source<Profile>(profile_.get()));
+ google_login_failure_.ListenFor(chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
Source<Profile>(profile_.get()));
URLFetcher::set_factory(&factory_);
diff --git a/chrome/browser/sync/syncable/model_type.cc b/chrome/browser/sync/syncable/model_type.cc
index ced99b3..868b43c 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -440,58 +440,58 @@ void PostTimeToTypeHistogram(ModelType model_type, base::TimeDelta time) {
// TODO(akalin): Figure out a better way to do these mappings.
namespace {
-const char kBookmarkNotificationType[] = "BOOKMARK";
-const char kPreferenceNotificationType[] = "PREFERENCE";
-const char kPasswordNotificationType[] = "PASSWORD";
-const char kAutofillNotificationType[] = "AUTOFILL";
-const char kThemeNotificationType[] = "THEME";
-const char kTypedUrlNotificationType[] = "TYPED_URL";
-const char kExtensionNotificationType[] = "EXTENSION";
-const char kNigoriNotificationType[] = "NIGORI";
-const char kAppNotificationType[] = "APP";
-const char kSearchEngineNotificationType[] = "SEARCH_ENGINE";
-const char kSessionNotificationType[] = "SESSION";
-const char kAutofillProfileNotificationType[] = "AUTOFILL_PROFILE";
+const char kBookmarkint[] = "BOOKMARK";
+const char kPreferenceint[] = "PREFERENCE";
+const char kPasswordint[] = "PASSWORD";
+const char kAutofillint[] = "AUTOFILL";
+const char kThemeint[] = "THEME";
+const char kTypedUrlint[] = "TYPED_URL";
+const char kExtensionint[] = "EXTENSION";
+const char kNigoriint[] = "NIGORI";
+const char kAppint[] = "APP";
+const char kSearchEngineint[] = "SEARCH_ENGINE";
+const char kSessionint[] = "SESSION";
+const char kAutofillProfileint[] = "AUTOFILL_PROFILE";
} // namespace
-bool RealModelTypeToNotificationType(ModelType model_type,
+bool RealModelTypeToint(ModelType model_type,
std::string* notification_type) {
switch (model_type) {
case BOOKMARKS:
- *notification_type = kBookmarkNotificationType;
+ *notification_type = kBookmarkint;
return true;
case PREFERENCES:
- *notification_type = kPreferenceNotificationType;
+ *notification_type = kPreferenceint;
return true;
case PASSWORDS:
- *notification_type = kPasswordNotificationType;
+ *notification_type = kPasswordint;
return true;
case AUTOFILL:
- *notification_type = kAutofillNotificationType;
+ *notification_type = kAutofillint;
return true;
case THEMES:
- *notification_type = kThemeNotificationType;
+ *notification_type = kThemeint;
return true;
case TYPED_URLS:
- *notification_type = kTypedUrlNotificationType;
+ *notification_type = kTypedUrlint;
return true;
case EXTENSIONS:
- *notification_type = kExtensionNotificationType;
+ *notification_type = kExtensionint;
return true;
case NIGORI:
- *notification_type = kNigoriNotificationType;
+ *notification_type = kNigoriint;
return true;
case APPS:
- *notification_type = kAppNotificationType;
+ *notification_type = kAppint;
return true;
case SEARCH_ENGINES:
- *notification_type = kSearchEngineNotificationType;
+ *notification_type = kSearchEngineint;
return true;
case SESSIONS:
- *notification_type = kSessionNotificationType;
+ *notification_type = kSessionint;
return true;
case AUTOFILL_PROFILE:
- *notification_type = kAutofillProfileNotificationType;
+ *notification_type = kAutofillProfileint;
return true;
default:
break;
@@ -500,42 +500,42 @@ bool RealModelTypeToNotificationType(ModelType model_type,
return false;
}
-bool NotificationTypeToRealModelType(const std::string& notification_type,
+bool intToRealModelType(const std::string& notification_type,
ModelType* model_type) {
- if (notification_type == kBookmarkNotificationType) {
+ if (notification_type == kBookmarkint) {
*model_type = BOOKMARKS;
return true;
- } else if (notification_type == kPreferenceNotificationType) {
+ } else if (notification_type == kPreferenceint) {
*model_type = PREFERENCES;
return true;
- } else if (notification_type == kPasswordNotificationType) {
+ } else if (notification_type == kPasswordint) {
*model_type = PASSWORDS;
return true;
- } else if (notification_type == kAutofillNotificationType) {
+ } else if (notification_type == kAutofillint) {
*model_type = AUTOFILL;
return true;
- } else if (notification_type == kThemeNotificationType) {
+ } else if (notification_type == kThemeint) {
*model_type = THEMES;
return true;
- } else if (notification_type == kTypedUrlNotificationType) {
+ } else if (notification_type == kTypedUrlint) {
*model_type = TYPED_URLS;
return true;
- } else if (notification_type == kExtensionNotificationType) {
+ } else if (notification_type == kExtensionint) {
*model_type = EXTENSIONS;
return true;
- } else if (notification_type == kNigoriNotificationType) {
+ } else if (notification_type == kNigoriint) {
*model_type = NIGORI;
return true;
- } else if (notification_type == kAppNotificationType) {
+ } else if (notification_type == kAppint) {
*model_type = APPS;
return true;
- } else if (notification_type == kSearchEngineNotificationType) {
+ } else if (notification_type == kSearchEngineint) {
*model_type = SEARCH_ENGINES;
return true;
- } else if (notification_type == kSessionNotificationType) {
+ } else if (notification_type == kSessionint) {
*model_type = SESSIONS;
return true;
- } else if (notification_type == kAutofillProfileNotificationType) {
+ } else if (notification_type == kAutofillProfileint) {
*model_type = AUTOFILL_PROFILE;
return true;
}
diff --git a/chrome/browser/sync/syncable/model_type.h b/chrome/browser/sync/syncable/model_type.h
index 16c4db7..ed84384 100644
--- a/chrome/browser/sync/syncable/model_type.h
+++ b/chrome/browser/sync/syncable/model_type.h
@@ -151,13 +151,13 @@ void PostTimeToTypeHistogram(ModelType model_type, base::TimeDelta time);
// subscribing to server-issued notifications). Returns true iff
// |model_type| was a real model type and |notification_type| was
// filled in.
-bool RealModelTypeToNotificationType(ModelType model_type,
+bool RealModelTypeToint(ModelType model_type,
std::string* notification_type);
// Converts a notification type to a real model type. Returns true
// iff |notification_type| was the notification type of a real model
// type and |model_type| was filled in.
-bool NotificationTypeToRealModelType(const std::string& notification_type,
+bool intToRealModelType(const std::string& notification_type,
ModelType* model_type);
} // namespace syncable
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index 6aef798..1436a21 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/sync/sessions/session_state.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/sync/test_http_bridge_factory.h"
using browser_sync::ModelSafeRoutingInfo;
@@ -245,11 +246,11 @@ void TestProfileSyncService::OnBackendInitialized() {
}
}
-void TestProfileSyncService::Observe(NotificationType type,
+void TestProfileSyncService::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
ProfileSyncService::Observe(type, source, details);
- if (type == NotificationType::SYNC_CONFIGURE_DONE &&
+ if (type == chrome::NOTIFICATION_SYNC_CONFIGURE_DONE &&
!synchronous_sync_configuration_) {
MessageLoop::current()->Quit();
}
diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h
index d9bba61..86ca121 100644
--- a/chrome/browser/sync/test_profile_sync_service.h
+++ b/chrome/browser/sync/test_profile_sync_service.h
@@ -99,7 +99,7 @@ class TestProfileSyncService : public ProfileSyncService {
virtual void OnBackendInitialized();
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/sync/util/extensions_activity_monitor.cc b/chrome/browser/sync/util/extensions_activity_monitor.cc
index 60f6d1a..d00a0b4 100644
--- a/chrome/browser/sync/util/extensions_activity_monitor.cc
+++ b/chrome/browser/sync/util/extensions_activity_monitor.cc
@@ -6,6 +6,7 @@
#include "base/task.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
@@ -31,7 +32,8 @@ class RegistrationTask : public Task {
// the fly so there is no reliable object to point to (same problem if we
// wanted to use the string name). Thus, we use all sources and filter in
// Observe.
- registrar_->Add(monitor_, NotificationType::EXTENSION_BOOKMARKS_API_INVOKED,
+ registrar_->Add(monitor_,
+ chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
NotificationService::AllSources());
}
@@ -78,7 +80,7 @@ void ExtensionsActivityMonitor::PutRecords(const Records& records) {
}
}
-void ExtensionsActivityMonitor::Observe(NotificationType type,
+void ExtensionsActivityMonitor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
base::AutoLock lock(records_lock_);
diff --git a/chrome/browser/sync/util/extensions_activity_monitor.h b/chrome/browser/sync/util/extensions_activity_monitor.h
index 6d085e6..9166b70 100644
--- a/chrome/browser/sync/util/extensions_activity_monitor.h
+++ b/chrome/browser/sync/util/extensions_activity_monitor.h
@@ -57,7 +57,7 @@ class ExtensionsActivityMonitor : public NotificationObserver {
void PutRecords(const Records& records);
// NotificationObserver implementation. Called on |ui_loop_|.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
private:
diff --git a/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc
index b7e8e7c2..3631a77 100644
--- a/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc
+++ b/chrome/browser/sync/util/extensions_activity_monitor_unittest.cc
@@ -9,6 +9,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/browser/browser_thread.h"
@@ -46,7 +47,7 @@ class BookmarkAPIEventTask : public Task {
virtual void Run() {
for (size_t i = 0; i < repeats_; i++) {
NotificationService::current()->Notify(
- NotificationType::EXTENSION_BOOKMARKS_API_INVOKED,
+ chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
Source<Extension>(extension_.get()),
Details<const BookmarksFunction>(function_.get()));
}