Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3639)

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 7548024: Refactor: Make PyAuto InstallExtension() take a string. Delete dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial commit. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 155af6c78b7e40825ce1b50951ed4c5918996d7d..f7eb1d54dab65a0324dadf8635b198bdb6f6414b 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -464,61 +464,6 @@ bool DidExtensionHostsStopLoading(ExtensionProcessManager* manager) {
return true;
}
-ExtensionInstallNotificationObserver::ExtensionInstallNotificationObserver(
- AutomationProvider* automation, int id, IPC::Message* reply_message)
- : automation_(automation->AsWeakPtr()),
- id_(id),
- reply_message_(reply_message) {
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
- NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
- NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
- NotificationService::AllSources());
-}
-
-ExtensionInstallNotificationObserver::~ExtensionInstallNotificationObserver() {
-}
-
-void ExtensionInstallNotificationObserver::Observe(
- int type, const NotificationSource& source,
- const NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_EXTENSION_LOADED:
- SendResponse(AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED);
- break;
- case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR:
- case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED:
- SendResponse(AUTOMATION_MSG_EXTENSION_INSTALL_FAILED);
- break;
- default:
- NOTREACHED();
- break;
- }
-
- delete this;
-}
-
-void ExtensionInstallNotificationObserver::SendResponse(
- AutomationMsg_ExtensionResponseValues response) {
- if (!automation_ || !reply_message_.get()) {
- delete this;
- return;
- }
-
- switch (id_) {
- case AutomationMsg_InstallExtension::ID:
- AutomationMsg_InstallExtension::WriteReplyParams(reply_message_.get(),
- response);
- break;
- default:
- NOTREACHED();
- break;
- }
-
- automation_->Send(reply_message_.release());
-}
-
ExtensionUninstallObserver::ExtensionUninstallObserver(
AutomationProvider* automation,
IPC::Message* reply_message,
@@ -626,12 +571,12 @@ void ExtensionReadyNotificationObserver::Observe(
break;
}
- if (id_ == AutomationMsg_InstallExtensionAndGetHandle::ID) {
+ if (id_ == AutomationMsg_InstallExtension::ID) {
// A handle of zero indicates an error.
int extension_handle = 0;
if (extension_)
extension_handle = automation_->AddExtension(extension_);
- AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams(
+ AutomationMsg_InstallExtension::WriteReplyParams(
reply_message_.get(), extension_handle);
} else if (id_ == AutomationMsg_EnableExtension::ID) {
AutomationMsg_EnableExtension::WriteReplyParams(reply_message_.get(), true);

Powered by Google App Engine
This is Rietveld 408576698