| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 // The observer will delete itself when done. | 801 // The observer will delete itself when done. |
| 802 new ExtensionReadyNotificationObserver( | 802 new ExtensionReadyNotificationObserver( |
| 803 manager, | 803 manager, |
| 804 this, | 804 this, |
| 805 AutomationMsg_InstallExtensionAndGetHandle::ID, | 805 AutomationMsg_InstallExtensionAndGetHandle::ID, |
| 806 reply_message); | 806 reply_message); |
| 807 | 807 |
| 808 ExtensionInstallUI* client = | 808 ExtensionInstallUI* client = |
| 809 (with_ui ? new ExtensionInstallUI(profile_) : NULL); | 809 (with_ui ? new ExtensionInstallUI(profile_) : NULL); |
| 810 scoped_refptr<CrxInstaller> installer(service->MakeCrxInstaller(client)); | 810 scoped_refptr<CrxInstaller> installer(service->MakeCrxInstaller(client)); |
| 811 if (!with_ui) |
| 812 installer->set_allow_silent_install(true); |
| 811 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 813 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 812 installer->InstallCrx(crx_path); | 814 installer->InstallCrx(crx_path); |
| 813 } else { | 815 } else { |
| 814 AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams( | 816 AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams( |
| 815 reply_message, 0); | 817 reply_message, 0); |
| 816 Send(reply_message); | 818 Send(reply_message); |
| 817 } | 819 } |
| 818 } | 820 } |
| 819 | 821 |
| 820 void AutomationProvider::UninstallExtension(int extension_handle, | 822 void AutomationProvider::UninstallExtension(int extension_handle, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 | 964 |
| 963 void AutomationProvider::SaveAsAsync(int tab_handle) { | 965 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 964 NavigationController* tab = NULL; | 966 NavigationController* tab = NULL; |
| 965 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 967 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
| 966 if (tab_contents) { | 968 if (tab_contents) { |
| 967 TabContentsWrapper* wrapper = | 969 TabContentsWrapper* wrapper = |
| 968 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); | 970 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); |
| 969 wrapper->download_tab_helper()->OnSavePage(); | 971 wrapper->download_tab_helper()->OnSavePage(); |
| 970 } | 972 } |
| 971 } | 973 } |
| OLD | NEW |