| Index: chrome/browser/automation/automation_provider_observers.cc
|
| ===================================================================
|
| --- chrome/browser/automation/automation_provider_observers.cc (revision 91771)
|
| +++ chrome/browser/automation/automation_provider_observers.cc (working copy)
|
| @@ -60,6 +60,7 @@
|
| #include "chrome/browser/ui/webui/ntp/most_visited_handler.h"
|
| #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
|
| #include "chrome/common/automation_messages.h"
|
| +#include "chrome/common/chrome_notification_types.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "content/browser/renderer_host/render_process_host.h"
|
| #include "content/browser/renderer_host/render_view_host.h"
|
| @@ -159,7 +160,7 @@
|
|
|
| NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation)
|
| : automation_(automation->AsWeakPtr()) {
|
| - registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD,
|
| + registrar_.Add(this, chrome::INITIAL_NEW_TAB_UI_LOAD,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -169,7 +170,7 @@
|
| void NewTabUILoadObserver::Observe(NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - if (type == NotificationType::INITIAL_NEW_TAB_UI_LOAD) {
|
| + if (type == chrome::INITIAL_NEW_TAB_UI_LOAD) {
|
| Details<int> load_time(details);
|
| if (automation_) {
|
| automation_->Send(
|
| @@ -239,9 +240,9 @@
|
| registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, source);
|
| registrar_.Add(this, NotificationType::LOAD_START, source);
|
| registrar_.Add(this, NotificationType::LOAD_STOP, source);
|
| - registrar_.Add(this, NotificationType::AUTH_NEEDED, source);
|
| - registrar_.Add(this, NotificationType::AUTH_SUPPLIED, source);
|
| - registrar_.Add(this, NotificationType::AUTH_CANCELLED, source);
|
| + registrar_.Add(this, chrome::AUTH_NEEDED, source);
|
| + registrar_.Add(this, chrome::AUTH_SUPPLIED, source);
|
| + registrar_.Add(this, chrome::AUTH_CANCELLED, source);
|
|
|
| if (include_current_navigation && controller->tab_contents()->is_loading())
|
| navigation_started_ = true;
|
| @@ -263,8 +264,8 @@
|
| // afer the load has started (but not after the entry was committed, as
|
| // WaitForNavigation compares times of the last navigation).
|
| // - when this is used with a page requiring authentication, we will not get
|
| - // a NotificationType::NAV_ENTRY_COMMITTED until after we authenticate, so
|
| - // we need the NotificationType::LOAD_START.
|
| + // a chrome::NAV_ENTRY_COMMITTED until after we authenticate, so
|
| + // we need the chrome::LOAD_START.
|
| if (type == NotificationType::NAV_ENTRY_COMMITTED ||
|
| type == NotificationType::LOAD_START) {
|
| navigation_started_ = true;
|
| @@ -274,15 +275,15 @@
|
| if (--navigations_remaining_ == 0)
|
| ConditionMet(AUTOMATION_MSG_NAVIGATION_SUCCESS);
|
| }
|
| - } else if (type == NotificationType::AUTH_SUPPLIED ||
|
| - type == NotificationType::AUTH_CANCELLED) {
|
| + } else if (type == chrome::AUTH_SUPPLIED ||
|
| + type == chrome::AUTH_CANCELLED) {
|
| // The LoginHandler for this tab is no longer valid.
|
| automation_->RemoveLoginHandler(controller_);
|
|
|
| // Treat this as if navigation started again, since load start/stop don't
|
| // occur while authentication is ongoing.
|
| navigation_started_ = true;
|
| - } else if (type == NotificationType::AUTH_NEEDED) {
|
| + } else if (type == chrome::AUTH_NEEDED) {
|
| // Remember the login handler that wants authentication.
|
| // We do this in all cases (not just when navigation_started_ == true) so
|
| // tests can still wait for auth dialogs outside of navigation.
|
| @@ -461,11 +462,11 @@
|
| : automation_(automation->AsWeakPtr()),
|
| id_(id),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_LOADED,
|
| + registrar_.Add(this, chrome::EXTENSION_LOADED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_INSTALL_ERROR,
|
| + registrar_.Add(this, chrome::EXTENSION_INSTALL_ERROR,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
|
| + registrar_.Add(this, chrome::EXTENSION_UPDATE_DISABLED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -476,11 +477,11 @@
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| switch (type.value) {
|
| - case NotificationType::EXTENSION_LOADED:
|
| + case chrome::EXTENSION_LOADED:
|
| SendResponse(AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED);
|
| break;
|
| - case NotificationType::EXTENSION_INSTALL_ERROR:
|
| - case NotificationType::EXTENSION_UPDATE_DISABLED:
|
| + case chrome::EXTENSION_INSTALL_ERROR:
|
| + case chrome::EXTENSION_UPDATE_DISABLED:
|
| SendResponse(AUTOMATION_MSG_EXTENSION_INSTALL_FAILED);
|
| break;
|
| default:
|
| @@ -518,9 +519,9 @@
|
| : automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message),
|
| id_(id) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_UNINSTALLED,
|
| + registrar_.Add(this, chrome::EXTENSION_UNINSTALLED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UNINSTALL_NOT_ALLOWED,
|
| + registrar_.Add(this, chrome::EXTENSION_UNINSTALL_NOT_ALLOWED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -537,7 +538,7 @@
|
| }
|
|
|
| switch (type.value) {
|
| - case NotificationType::EXTENSION_UNINSTALLED: {
|
| + case chrome::EXTENSION_UNINSTALLED: {
|
| UninstalledExtensionInfo* info =
|
| Details<UninstalledExtensionInfo>(details).ptr();
|
| if (id_ == info->extension_id) {
|
| @@ -551,7 +552,7 @@
|
| break;
|
| }
|
|
|
| - case NotificationType::EXTENSION_UNINSTALL_NOT_ALLOWED: {
|
| + case chrome::EXTENSION_UNINSTALL_NOT_ALLOWED: {
|
| const Extension* extension = Details<Extension>(details).ptr();
|
| if (id_ == extension->id()) {
|
| scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
|
| @@ -577,13 +578,13 @@
|
| id_(id),
|
| reply_message_(reply_message),
|
| extension_(NULL) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
|
| + registrar_.Add(this, chrome::EXTENSION_HOST_DID_STOP_LOADING,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_LOADED,
|
| + registrar_.Add(this, chrome::EXTENSION_LOADED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_INSTALL_ERROR,
|
| + registrar_.Add(this, chrome::EXTENSION_INSTALL_ERROR,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
|
| + registrar_.Add(this, chrome::EXTENSION_UPDATE_DISABLED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -599,19 +600,19 @@
|
| }
|
|
|
| switch (type.value) {
|
| - case NotificationType::EXTENSION_HOST_DID_STOP_LOADING:
|
| + case chrome::EXTENSION_HOST_DID_STOP_LOADING:
|
| // Only continue on with this method if our extension has been loaded
|
| // and all the extension hosts have stopped loading.
|
| if (!extension_ || !DidExtensionHostsStopLoading(manager_))
|
| return;
|
| break;
|
| - case NotificationType::EXTENSION_LOADED:
|
| + case chrome::EXTENSION_LOADED:
|
| extension_ = Details<const Extension>(details).ptr();
|
| if (!DidExtensionHostsStopLoading(manager_))
|
| return;
|
| break;
|
| - case NotificationType::EXTENSION_INSTALL_ERROR:
|
| - case NotificationType::EXTENSION_UPDATE_DISABLED:
|
| + case chrome::EXTENSION_INSTALL_ERROR:
|
| + case chrome::EXTENSION_UPDATE_DISABLED:
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -638,7 +639,7 @@
|
|
|
| ExtensionUnloadNotificationObserver::ExtensionUnloadNotificationObserver()
|
| : did_receive_unload_notification_(false) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
|
| + registrar_.Add(this, chrome::EXTENSION_UNLOADED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -648,7 +649,7 @@
|
| void ExtensionUnloadNotificationObserver::Observe(
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - if (type.value == NotificationType::EXTENSION_UNLOADED) {
|
| + if (type.value == chrome::EXTENSION_UNLOADED) {
|
| did_receive_unload_notification_ = true;
|
| } else {
|
| NOTREACHED();
|
| @@ -660,19 +661,19 @@
|
| IPC::Message* reply_message)
|
| : manager_(manager), automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message), updater_finished_(false) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
|
| + registrar_.Add(this, chrome::EXTENSION_HOST_DID_STOP_LOADING,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_INSTALL_ERROR,
|
| + registrar_.Add(this, chrome::EXTENSION_INSTALL_ERROR,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_INSTALL_NOT_ALLOWED,
|
| + registrar_.Add(this, chrome::EXTENSION_INSTALL_NOT_ALLOWED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_LOADED,
|
| + registrar_.Add(this, chrome::EXTENSION_LOADED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
|
| + registrar_.Add(this, chrome::EXTENSION_UPDATE_DISABLED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UPDATE_FOUND,
|
| + registrar_.Add(this, chrome::EXTENSION_UPDATE_FOUND,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_UPDATING_FINISHED,
|
| + registrar_.Add(this, chrome::EXTENSION_UPDATING_FINISHED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -697,20 +698,20 @@
|
| // an extension host stops loading. Updating is not considered complete if
|
| // any extension hosts are still loading.
|
| switch (type.value) {
|
| - case NotificationType::EXTENSION_UPDATE_FOUND:
|
| + case chrome::EXTENSION_UPDATE_FOUND:
|
| // Extension updater has identified an extension that needs to be updated.
|
| in_progress_updates_.insert(*(Details<const std::string>(details).ptr()));
|
| break;
|
|
|
| - case NotificationType::EXTENSION_UPDATING_FINISHED:
|
| + case chrome::EXTENSION_UPDATING_FINISHED:
|
| // Extension updater has completed notifying all extensions to update
|
| // themselves.
|
| updater_finished_ = true;
|
| break;
|
|
|
| - case NotificationType::EXTENSION_LOADED:
|
| - case NotificationType::EXTENSION_INSTALL_NOT_ALLOWED:
|
| - case NotificationType::EXTENSION_UPDATE_DISABLED: {
|
| + case chrome::EXTENSION_LOADED:
|
| + case chrome::EXTENSION_INSTALL_NOT_ALLOWED:
|
| + case chrome::EXTENSION_UPDATE_DISABLED: {
|
| // An extension has either completed update installation and is now
|
| // loaded, or else the install has been skipped because it is
|
| // either not allowed or else has been disabled.
|
| @@ -719,14 +720,14 @@
|
| break;
|
| }
|
|
|
| - case NotificationType::EXTENSION_INSTALL_ERROR: {
|
| + case chrome::EXTENSION_INSTALL_ERROR: {
|
| // An extension had an error on update installation.
|
| CrxInstaller* installer = Source<CrxInstaller>(source).ptr();
|
| in_progress_updates_.erase(installer->expected_id());
|
| break;
|
| }
|
|
|
| - case NotificationType::EXTENSION_HOST_DID_STOP_LOADING:
|
| + case chrome::EXTENSION_HOST_DID_STOP_LOADING:
|
| // Break out to the conditional check below to see if all extension hosts
|
| // have stopped loading.
|
| break;
|
| @@ -751,9 +752,9 @@
|
| ExtensionTestResultNotificationObserver::
|
| ExtensionTestResultNotificationObserver(AutomationProvider* automation)
|
| : automation_(automation->AsWeakPtr()) {
|
| - registrar_.Add(this, NotificationType::EXTENSION_TEST_PASSED,
|
| + registrar_.Add(this, chrome::EXTENSION_TEST_PASSED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::EXTENSION_TEST_FAILED,
|
| + registrar_.Add(this, chrome::EXTENSION_TEST_FAILED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -765,12 +766,12 @@
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| switch (type.value) {
|
| - case NotificationType::EXTENSION_TEST_PASSED:
|
| + case chrome::EXTENSION_TEST_PASSED:
|
| results_.push_back(true);
|
| messages_.push_back("");
|
| break;
|
|
|
| - case NotificationType::EXTENSION_TEST_FAILED:
|
| + case chrome::EXTENSION_TEST_FAILED:
|
| results_.push_back(false);
|
| messages_.push_back(*(Details<std::string>(details).ptr()));
|
| break;
|
| @@ -809,7 +810,7 @@
|
| reply_message_(reply_message),
|
| new_window_id_(extension_misc::kUnknownWindowId),
|
| for_browser_command_(false) {
|
| - registrar_.Add(this, NotificationType::BROWSER_OPENED,
|
| + registrar_.Add(this, chrome::BROWSER_OPENED,
|
| NotificationService::AllSources());
|
| registrar_.Add(this, NotificationType::LOAD_STOP,
|
| NotificationService::AllSources());
|
| @@ -826,7 +827,7 @@
|
| return;
|
| }
|
|
|
| - if (type.value == NotificationType::BROWSER_OPENED) {
|
| + if (type.value == chrome::BROWSER_OPENED) {
|
| // Store the new browser ID and continue waiting for a new tab within it
|
| // to stop loading.
|
| new_window_id_ = ExtensionTabUtil::GetWindowId(
|
| @@ -864,7 +865,7 @@
|
| : automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message),
|
| for_browser_command_(false) {
|
| - registrar_.Add(this, NotificationType::BROWSER_CLOSED,
|
| + registrar_.Add(this, chrome::BROWSER_CLOSED,
|
| Source<Browser>(browser));
|
| }
|
|
|
| @@ -873,7 +874,7 @@
|
| void BrowserClosedNotificationObserver::Observe(
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::BROWSER_CLOSED);
|
| + DCHECK(type == chrome::BROWSER_CLOSED);
|
|
|
| if (!automation_) {
|
| delete this;
|
| @@ -905,9 +906,9 @@
|
| : target_count_(target_count),
|
| automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::BROWSER_OPENED,
|
| + registrar_.Add(this, chrome::BROWSER_OPENED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::BROWSER_CLOSED,
|
| + registrar_.Add(this, chrome::BROWSER_CLOSED,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -918,10 +919,10 @@
|
| NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::BROWSER_OPENED ||
|
| - type == NotificationType::BROWSER_CLOSED);
|
| + DCHECK(type == chrome::BROWSER_OPENED ||
|
| + type == chrome::BROWSER_CLOSED);
|
| int current_count = static_cast<int>(BrowserList::size());
|
| - if (type == NotificationType::BROWSER_CLOSED) {
|
| + if (type == chrome::BROWSER_CLOSED) {
|
| // At the time of the notification the browser being closed is not removed
|
| // from the list. The real count is one less than the reported count.
|
| DCHECK_LT(0, current_count);
|
| @@ -945,7 +946,7 @@
|
| AutomationProvider* automation, IPC::Message* reply_message)
|
| : automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::APP_MODAL_DIALOG_SHOWN,
|
| + registrar_.Add(this, chrome::APP_MODAL_DIALOG_SHOWN,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -955,7 +956,7 @@
|
| void AppModalDialogShownObserver::Observe(
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::APP_MODAL_DIALOG_SHOWN);
|
| + DCHECK(type == chrome::APP_MODAL_DIALOG_SHOWN);
|
|
|
| if (automation_) {
|
| AutomationMsg_WaitForAppModalDialogToBeShown::WriteReplyParams(
|
| @@ -970,7 +971,7 @@
|
| // Define mapping from command to notification
|
| struct CommandNotification {
|
| int command;
|
| - NotificationType::Type notification_type;
|
| + int notification_type;
|
| };
|
|
|
| const struct CommandNotification command_notifications[] = {
|
| @@ -1075,7 +1076,7 @@
|
| }
|
|
|
| bool ExecuteBrowserCommandObserver::GetNotificationType(
|
| - int command, NotificationType::Type* type) {
|
| + int command, int* type) {
|
| if (!type)
|
| return false;
|
| bool found = false;
|
| @@ -1096,7 +1097,7 @@
|
| active_match_ordinal_(-1),
|
| reply_with_json_(reply_with_json),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::FIND_RESULT_AVAILABLE,
|
| + registrar_.Add(this, chrome::FIND_RESULT_AVAILABLE,
|
| Source<TabContents>(parent_tab));
|
| }
|
|
|
| @@ -1152,7 +1153,7 @@
|
| const int FindInPageNotificationObserver::kFindInPageRequestId = -1;
|
|
|
| DomOperationObserver::DomOperationObserver() {
|
| - registrar_.Add(this, NotificationType::DOM_OPERATION_RESPONSE,
|
| + registrar_.Add(this, chrome::DOM_OPERATION_RESPONSE,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -1161,7 +1162,7 @@
|
| void DomOperationObserver::Observe(
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - if (NotificationType::DOM_OPERATION_RESPONSE == type) {
|
| + if (chrome::DOM_OPERATION_RESPONSE == type) {
|
| Details<DomOperationNotificationDetails> dom_op_details(details);
|
| OnDomOperationCompleted(dom_op_details->json());
|
| }
|
| @@ -1199,7 +1200,7 @@
|
| : automation_(automation->AsWeakPtr()),
|
| success_(false),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::PRINT_JOB_EVENT,
|
| + registrar_.Add(this, chrome::PRINT_JOB_EVENT,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -1214,7 +1215,7 @@
|
| NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::PRINT_JOB_EVENT);
|
| + DCHECK(type == chrome::PRINT_JOB_EVENT);
|
| switch (Details<printing::JobEventDetails>(details)->type()) {
|
| case printing::JobEventDetails::JOB_DONE: {
|
| // Succeeded.
|
| @@ -1246,7 +1247,7 @@
|
| }
|
|
|
| MetricEventDurationObserver::MetricEventDurationObserver() {
|
| - registrar_.Add(this, NotificationType::METRIC_EVENT_DURATION,
|
| + registrar_.Add(this, chrome::METRIC_EVENT_DURATION,
|
| NotificationService::AllSources());
|
| }
|
|
|
| @@ -1262,7 +1263,7 @@
|
|
|
| void MetricEventDurationObserver::Observe(NotificationType type,
|
| const NotificationSource& source, const NotificationDetails& details) {
|
| - if (type != NotificationType::METRIC_EVENT_DURATION) {
|
| + if (type != chrome::METRIC_EVENT_DURATION) {
|
| NOTREACHED();
|
| return;
|
| }
|
| @@ -1277,7 +1278,7 @@
|
| TabContents* tab_contents)
|
| : automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message) {
|
| - registrar_.Add(this, NotificationType::PAGE_TRANSLATED,
|
| + registrar_.Add(this, chrome::PAGE_TRANSLATED,
|
| Source<TabContents>(tab_contents));
|
| }
|
|
|
| @@ -1291,7 +1292,7 @@
|
| return;
|
| }
|
|
|
| - DCHECK(type == NotificationType::PAGE_TRANSLATED);
|
| + DCHECK(type == chrome::PAGE_TRANSLATED);
|
| AutomationJSONReply reply(automation_, reply_message_.release());
|
|
|
| PageTranslatedDetails* translated_details =
|
| @@ -1311,7 +1312,7 @@
|
| reply_message_(reply_message),
|
| tab_contents_(tab_contents),
|
| translate_bar_(translate_bar) {
|
| - registrar_.Add(this, NotificationType::TAB_LANGUAGE_DETERMINED,
|
| + registrar_.Add(this, chrome::TAB_LANGUAGE_DETERMINED,
|
| Source<TabContents>(tab_contents));
|
| }
|
|
|
| @@ -1320,7 +1321,7 @@
|
| void TabLanguageDeterminedObserver::Observe(
|
| NotificationType type, const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::TAB_LANGUAGE_DETERMINED);
|
| + DCHECK(type == chrome::TAB_LANGUAGE_DETERMINED);
|
|
|
| if (!automation_) {
|
| delete this;
|
| @@ -1376,8 +1377,8 @@
|
| tab_contents_(tab_contents),
|
| target_count_(target_count) {
|
| Source<TabContentsWrapper> source(tab_contents);
|
| - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_ADDED, source);
|
| - registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, source);
|
| + registrar_.Add(this, chrome::TAB_CONTENTS_INFOBAR_ADDED, source);
|
| + registrar_.Add(this, chrome::TAB_CONTENTS_INFOBAR_REMOVED, source);
|
| CheckCount();
|
| }
|
|
|
| @@ -1386,8 +1387,8 @@
|
| void InfoBarCountObserver::Observe(NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - DCHECK(type == NotificationType::TAB_CONTENTS_INFOBAR_ADDED ||
|
| - type == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED);
|
| + DCHECK(type == chrome::TAB_CONTENTS_INFOBAR_ADDED ||
|
| + type == chrome::TAB_CONTENTS_INFOBAR_REMOVED);
|
| CheckCount();
|
| }
|
|
|
| @@ -1720,7 +1721,7 @@
|
|
|
| void PasswordStoreLoginsChangedObserver::RegisterObserversTask() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
|
| - registrar_.Add(this, NotificationType::LOGINS_CHANGED,
|
| + registrar_.Add(this, chrome::LOGINS_CHANGED,
|
| NotificationService::AllSources());
|
| done_event_.Signal();
|
| }
|
| @@ -1730,7 +1731,7 @@
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
|
| - DCHECK(type.value == NotificationType::LOGINS_CHANGED);
|
| + DCHECK(type.value == chrome::LOGINS_CHANGED);
|
| PasswordStoreChangeList* change_details =
|
| Details<PasswordStoreChangeList>(details).ptr();
|
| if (change_details->size() != 1 ||
|
| @@ -1805,7 +1806,7 @@
|
| Source<NavigationController> source(controller_);
|
| registrar_.Add(this, NotificationType::LOAD_STOP, source);
|
| // Pages requiring auth don't send LOAD_STOP.
|
| - registrar_.Add(this, NotificationType::AUTH_NEEDED, source);
|
| + registrar_.Add(this, chrome::AUTH_NEEDED, source);
|
| }
|
|
|
| OmniboxAcceptNotificationObserver::~OmniboxAcceptNotificationObserver() {
|
| @@ -1816,7 +1817,7 @@
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| if (type == NotificationType::LOAD_STOP ||
|
| - type == NotificationType::AUTH_NEEDED) {
|
| + type == chrome::AUTH_NEEDED) {
|
| if (automation_) {
|
| AutomationJSONReply(automation_,
|
| reply_message_.release()).SendSuccess(NULL);
|
| @@ -1834,7 +1835,7 @@
|
| : automation_(automation->AsWeakPtr()),
|
| reply_message_(reply_message) {
|
| Source<SavePackage> source(save_package);
|
| - registrar_.Add(this, NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED,
|
| + registrar_.Add(this, chrome::SAVE_PACKAGE_SUCCESSFULLY_FINISHED,
|
| source);
|
| }
|
|
|
| @@ -1844,7 +1845,7 @@
|
| NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - if (type == NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED) {
|
| + if (type == chrome::SAVE_PACKAGE_SUCCESSFULLY_FINISHED) {
|
| if (automation_) {
|
| AutomationJSONReply(automation_,
|
| reply_message_.release()).SendSuccess(NULL);
|
| @@ -2048,12 +2049,12 @@
|
| }
|
| ntp_info_->Set("default_sites", default_sites_list);
|
|
|
| - registrar_.Add(this, NotificationType::TOP_SITES_UPDATED,
|
| + registrar_.Add(this, chrome::TOP_SITES_UPDATED,
|
| Source<history::TopSites>(top_sites_));
|
| if (top_sites_->loaded()) {
|
| OnTopSitesLoaded();
|
| } else {
|
| - registrar_.Add(this, NotificationType::TOP_SITES_LOADED,
|
| + registrar_.Add(this, chrome::TOP_SITES_LOADED,
|
| Source<Profile>(automation_->profile()));
|
| }
|
| }
|
| @@ -2063,9 +2064,9 @@
|
| void NTPInfoObserver::Observe(NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - if (type == NotificationType::TOP_SITES_LOADED) {
|
| + if (type == chrome::TOP_SITES_LOADED) {
|
| OnTopSitesLoaded();
|
| - } else if (type == NotificationType::TOP_SITES_UPDATED) {
|
| + } else if (type == chrome::TOP_SITES_UPDATED) {
|
| Details<CancelableRequestProvider::Handle> request_details(details);
|
| if (request_ == *request_details.ptr()) {
|
| top_sites_->GetMostVisitedURLs(
|
| @@ -2121,7 +2122,7 @@
|
| // Need to wait for a new tab in a new window to load.
|
| registrar_.Add(this, NotificationType::LOAD_STOP,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::BROWSER_WINDOW_READY,
|
| + registrar_.Add(this, chrome::BROWSER_WINDOW_READY,
|
| NotificationService::AllSources());
|
| }
|
| }
|
| @@ -2157,7 +2158,7 @@
|
| return;
|
| }
|
| }
|
| - } else if (type.value == NotificationType::BROWSER_WINDOW_READY) {
|
| + } else if (type.value == chrome::BROWSER_WINDOW_READY) {
|
| new_window_id_ = ExtensionTabUtil::GetWindowId(
|
| Source<Browser>(source).ptr());
|
| } else {
|
| @@ -2222,9 +2223,9 @@
|
|
|
| void AutofillChangedObserver::RegisterObserversTask() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
|
| - registrar_.Add(this, NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
|
| + registrar_.Add(this, chrome::AUTOFILL_CREDIT_CARD_CHANGED,
|
| NotificationService::AllSources());
|
| - registrar_.Add(this, NotificationType::AUTOFILL_PROFILE_CHANGED,
|
| + registrar_.Add(this, chrome::AUTOFILL_PROFILE_CHANGED,
|
| NotificationService::AllSources());
|
| done_event_.Signal();
|
| }
|
| @@ -2235,9 +2236,9 @@
|
| const NotificationDetails& details) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
|
|
|
| - if (type.value == NotificationType::AUTOFILL_CREDIT_CARD_CHANGED) {
|
| + if (type.value == chrome::AUTOFILL_CREDIT_CARD_CHANGED) {
|
| num_credit_cards_--;
|
| - } else if (type.value == NotificationType::AUTOFILL_PROFILE_CHANGED) {
|
| + } else if (type.value == chrome::AUTOFILL_PROFILE_CHANGED) {
|
| num_profiles_--;
|
| } else {
|
| NOTREACHED();
|
| @@ -2289,7 +2290,7 @@
|
| if (AreActiveNotificationProcessesReady()) {
|
| SendMessage();
|
| } else {
|
| - registrar_.Add(this, NotificationType::NOTIFY_BALLOON_CONNECTED,
|
| + registrar_.Add(this, chrome::NOTIFY_BALLOON_CONNECTED,
|
| NotificationService::AllSources());
|
| }
|
| }
|
| @@ -2342,7 +2343,7 @@
|
| collection_(
|
| g_browser_process->notification_ui_manager()->balloon_collection()),
|
| count_(count) {
|
| - registrar_.Add(this, NotificationType::NOTIFY_BALLOON_CONNECTED,
|
| + registrar_.Add(this, chrome::NOTIFY_BALLOON_CONNECTED,
|
| NotificationService::AllSources());
|
| collection_->set_on_collection_changed_callback(NewCallback(
|
| this, &OnNotificationBalloonCountObserver::CheckBalloonCount));
|
|
|