| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4044 new ExtensionReadyNotificationObserver( | 4044 new ExtensionReadyNotificationObserver( |
| 4045 manager, | 4045 manager, |
| 4046 service, | 4046 service, |
| 4047 this, | 4047 this, |
| 4048 reply_message); | 4048 reply_message); |
| 4049 | 4049 |
| 4050 FilePath extension_path(path_string); | 4050 FilePath extension_path(path_string); |
| 4051 // If the given path has a 'crx' extension, assume it is a packed extension | 4051 // If the given path has a 'crx' extension, assume it is a packed extension |
| 4052 // and install it. Otherwise load it as an unpacked extension. | 4052 // and install it. Otherwise load it as an unpacked extension. |
| 4053 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { | 4053 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { |
| 4054 ExtensionInstallPrompt* client = | 4054 ExtensionInstallPrompt* client = (with_ui ? |
| 4055 (with_ui ? new ExtensionInstallPrompt(browser) : NULL); | 4055 chrome::CreateExtensionInstallPromptWithBrowser(browser) : |
| 4056 NULL); |
| 4056 scoped_refptr<CrxInstaller> installer( | 4057 scoped_refptr<CrxInstaller> installer( |
| 4057 CrxInstaller::Create(service, client)); | 4058 CrxInstaller::Create(service, client)); |
| 4058 if (!with_ui) | 4059 if (!with_ui) |
| 4059 installer->set_allow_silent_install(true); | 4060 installer->set_allow_silent_install(true); |
| 4060 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 4061 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 4061 if (from_webstore) | 4062 if (from_webstore) |
| 4062 installer->set_creation_flags(Extension::FROM_WEBSTORE); | 4063 installer->set_creation_flags(Extension::FROM_WEBSTORE); |
| 4063 installer->InstallCrx(extension_path); | 4064 installer->InstallCrx(extension_path); |
| 4064 } else { | 4065 } else { |
| 4065 scoped_refptr<extensions::UnpackedInstaller> installer( | 4066 scoped_refptr<extensions::UnpackedInstaller> installer( |
| (...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6767 void TestingAutomationProvider::OnRemoveProvider() { | 6768 void TestingAutomationProvider::OnRemoveProvider() { |
| 6768 if (g_browser_process) | 6769 if (g_browser_process) |
| 6769 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6770 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6770 } | 6771 } |
| 6771 | 6772 |
| 6772 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6773 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6773 WebContents* tab) { | 6774 WebContents* tab) { |
| 6774 if (chrome::GetActiveWebContents(browser) != tab) | 6775 if (chrome::GetActiveWebContents(browser) != tab) |
| 6775 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6776 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
| 6776 } | 6777 } |
| OLD | NEW |