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 4035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = |
4055 (with_ui ? new ExtensionInstallPrompt(browser) : NULL); | 4055 (with_ui ? new ExtensionInstallPrompt(browser) : NULL); |
4056 scoped_refptr<CrxInstaller> installer( | 4056 scoped_refptr<extensions::CrxInstaller> installer( |
4057 CrxInstaller::Create(service, client)); | 4057 extensions::CrxInstaller::Create(service, client)); |
4058 if (!with_ui) | 4058 if (!with_ui) |
4059 installer->set_allow_silent_install(true); | 4059 installer->set_allow_silent_install(true); |
4060 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 4060 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
4061 if (from_webstore) | 4061 if (from_webstore) |
4062 installer->set_creation_flags(Extension::FROM_WEBSTORE); | 4062 installer->set_creation_flags(Extension::FROM_WEBSTORE); |
4063 installer->InstallCrx(extension_path); | 4063 installer->InstallCrx(extension_path); |
4064 } else { | 4064 } else { |
4065 scoped_refptr<extensions::UnpackedInstaller> installer( | 4065 scoped_refptr<extensions::UnpackedInstaller> installer( |
4066 extensions::UnpackedInstaller::Create(service)); | 4066 extensions::UnpackedInstaller::Create(service)); |
4067 installer->set_prompt_for_plugins(with_ui); | 4067 installer->set_prompt_for_plugins(with_ui); |
(...skipping 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6767 void TestingAutomationProvider::OnRemoveProvider() { | 6767 void TestingAutomationProvider::OnRemoveProvider() { |
6768 if (g_browser_process) | 6768 if (g_browser_process) |
6769 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6769 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6770 } | 6770 } |
6771 | 6771 |
6772 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6772 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
6773 WebContents* tab) { | 6773 WebContents* tab) { |
6774 if (chrome::GetActiveWebContents(browser) != tab) | 6774 if (chrome::GetActiveWebContents(browser) != tab) |
6775 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6775 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
6776 } | 6776 } |
OLD | NEW |