Chromium Code Reviews| 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..5a77715b4c2a0192839e87e7123e1de505da5af0 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,10 @@ 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 std::string& extension_path, bool with_ui, |
| + IPC::Message* reply_message) { |
| + const FilePath extension_file_path = FilePath(extension_path); |
|
kkania
2011/08/03 16:01:56
this wont compile on windows
|
| ExtensionService* service = profile_->GetExtensionService(); |
| ExtensionProcessManager* manager = profile_->GetExtensionProcessManager(); |
| if (service && manager) { |
| @@ -801,23 +780,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_file_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_file_path); |
| } else { |
| - service->LoadExtension(crx_path, with_ui); |
| + service->LoadExtension(extension_file_path, with_ui); |
| } |
| } else { |
| - AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams( |
| - reply_message, 0); |
| + AutomationMsg_InstallExtension::WriteReplyParams(reply_message, 0); |
| Send(reply_message); |
| } |
| } |