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 4028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4039 this, | 4039 this, |
4040 reply_message); | 4040 reply_message); |
4041 | 4041 |
4042 FilePath extension_path(path_string); | 4042 FilePath extension_path(path_string); |
4043 // If the given path has a 'crx' extension, assume it is a packed extension | 4043 // If the given path has a 'crx' extension, assume it is a packed extension |
4044 // and install it. Otherwise load it as an unpacked extension. | 4044 // and install it. Otherwise load it as an unpacked extension. |
4045 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { | 4045 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { |
4046 ExtensionInstallPrompt* client = (with_ui ? | 4046 ExtensionInstallPrompt* client = (with_ui ? |
4047 chrome::CreateExtensionInstallPromptWithBrowser(browser) : | 4047 chrome::CreateExtensionInstallPromptWithBrowser(browser) : |
4048 NULL); | 4048 NULL); |
4049 scoped_refptr<CrxInstaller> installer( | 4049 scoped_refptr<extensions::CrxInstaller> installer( |
4050 CrxInstaller::Create(service, client)); | 4050 extensions::CrxInstaller::Create(service, client)); |
4051 if (!with_ui) | 4051 if (!with_ui) |
4052 installer->set_allow_silent_install(true); | 4052 installer->set_allow_silent_install(true); |
4053 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 4053 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
4054 if (from_webstore) | 4054 if (from_webstore) |
4055 installer->set_creation_flags(Extension::FROM_WEBSTORE); | 4055 installer->set_creation_flags(Extension::FROM_WEBSTORE); |
4056 installer->InstallCrx(extension_path); | 4056 installer->InstallCrx(extension_path); |
4057 } else { | 4057 } else { |
4058 scoped_refptr<extensions::UnpackedInstaller> installer( | 4058 scoped_refptr<extensions::UnpackedInstaller> installer( |
4059 extensions::UnpackedInstaller::Create(service)); | 4059 extensions::UnpackedInstaller::Create(service)); |
4060 installer->set_prompt_for_plugins(with_ui); | 4060 installer->set_prompt_for_plugins(with_ui); |
(...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6904 void TestingAutomationProvider::OnRemoveProvider() { | 6904 void TestingAutomationProvider::OnRemoveProvider() { |
6905 if (g_browser_process) | 6905 if (g_browser_process) |
6906 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6906 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6907 } | 6907 } |
6908 | 6908 |
6909 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6909 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
6910 WebContents* tab) { | 6910 WebContents* tab) { |
6911 if (chrome::GetActiveWebContents(browser) != tab) | 6911 if (chrome::GetActiveWebContents(browser) != tab) |
6912 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6912 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
6913 } | 6913 } |
OLD | NEW |