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

Unified Diff: chrome/browser/automation/automation_provider.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: Fixup per kkania. 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.cc
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 1dfa293b3a6a9784e4a621a1d8f97cef8154933e..6f9472efe4af400a06b2114715a106dfb10cdd85 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -325,13 +325,10 @@ bool AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutomationMsg_ReloadAsync, ReloadAsync)
IPC_MESSAGE_HANDLER(AutomationMsg_StopAsync, StopAsync)
IPC_MESSAGE_HANDLER(AutomationMsg_SetPageFontSize, OnSetPageFontSize)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_InstallExtension,
- InstallExtension)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForExtensionTestResult,
WaitForExtensionTestResult)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(
- AutomationMsg_InstallExtensionAndGetHandle,
- InstallExtensionAndGetHandle)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_InstallExtension,
+ InstallExtension)
IPC_MESSAGE_HANDLER(AutomationMsg_UninstallExtension,
UninstallExtension)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_EnableExtension,
@@ -763,26 +760,6 @@ RenderViewHost* AutomationProvider::GetViewForTab(int tab_handle) {
return NULL;
}
-void AutomationProvider::InstallExtension(const FilePath& crx_path,
- IPC::Message* reply_message) {
- ExtensionService* service = profile_->GetExtensionService();
- if (service) {
- // The observer will delete itself when done.
- new ExtensionInstallNotificationObserver(this,
- AutomationMsg_InstallExtension::ID,
- reply_message);
-
- // Pass NULL for a silent install with no UI.
- scoped_refptr<CrxInstaller> installer(service->MakeCrxInstaller(NULL));
- installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION);
- installer->InstallCrx(crx_path);
- } else {
- AutomationMsg_InstallExtension::WriteReplyParams(
- reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED);
- Send(reply_message);
- }
-}
-
void AutomationProvider::WaitForExtensionTestResult(
IPC::Message* reply_message) {
DCHECK(!reply_message_);
@@ -792,8 +769,9 @@ void AutomationProvider::WaitForExtensionTestResult(
extension_test_result_observer_->MaybeSendResult();
}
-void AutomationProvider::InstallExtensionAndGetHandle(
- const FilePath& crx_path, bool with_ui, IPC::Message* reply_message) {
+void AutomationProvider::InstallExtension(
+ const FilePath& extension_path, bool with_ui,
+ IPC::Message* reply_message) {
ExtensionService* service = profile_->GetExtensionService();
ExtensionProcessManager* manager = profile_->GetExtensionProcessManager();
if (service && manager) {
@@ -801,23 +779,22 @@ void AutomationProvider::InstallExtensionAndGetHandle(
new ExtensionReadyNotificationObserver(
manager,
this,
- AutomationMsg_InstallExtensionAndGetHandle::ID,
+ AutomationMsg_InstallExtension::ID,
reply_message);
- if (crx_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) {
+ if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) {
ExtensionInstallUI* client =
(with_ui ? new ExtensionInstallUI(profile_) : NULL);
scoped_refptr<CrxInstaller> installer(service->MakeCrxInstaller(client));
if (!with_ui)
installer->set_allow_silent_install(true);
installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION);
- installer->InstallCrx(crx_path);
+ installer->InstallCrx(extension_path);
} else {
- service->LoadExtension(crx_path, with_ui);
+ service->LoadExtension(extension_path, with_ui);
}
} else {
- AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams(
- reply_message, 0);
+ AutomationMsg_InstallExtension::WriteReplyParams(reply_message, 0);
Send(reply_message);
}
}
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/automation/automation_provider_observers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698