| 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 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3967 new ExtensionReadyNotificationObserver( | 3967 new ExtensionReadyNotificationObserver( |
| 3968 manager, | 3968 manager, |
| 3969 service, | 3969 service, |
| 3970 this, | 3970 this, |
| 3971 reply_message); | 3971 reply_message); |
| 3972 | 3972 |
| 3973 FilePath extension_path(path_string); | 3973 FilePath extension_path(path_string); |
| 3974 // If the given path has a 'crx' extension, assume it is a packed extension | 3974 // If the given path has a 'crx' extension, assume it is a packed extension |
| 3975 // and install it. Otherwise load it as an unpacked extension. | 3975 // and install it. Otherwise load it as an unpacked extension. |
| 3976 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { | 3976 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { |
| 3977 ExtensionInstallUI* client = | 3977 ExtensionInstallPrompt* client = |
| 3978 (with_ui ? new ExtensionInstallUI(browser->profile()) : NULL); | 3978 (with_ui ? new ExtensionInstallPrompt(browser->profile()) : NULL); |
| 3979 scoped_refptr<CrxInstaller> installer( | 3979 scoped_refptr<CrxInstaller> installer( |
| 3980 CrxInstaller::Create(service, client)); | 3980 CrxInstaller::Create(service, client)); |
| 3981 if (!with_ui) | 3981 if (!with_ui) |
| 3982 installer->set_allow_silent_install(true); | 3982 installer->set_allow_silent_install(true); |
| 3983 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 3983 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 3984 installer->InstallCrx(extension_path); | 3984 installer->InstallCrx(extension_path); |
| 3985 } else { | 3985 } else { |
| 3986 scoped_refptr<extensions::UnpackedInstaller> installer( | 3986 scoped_refptr<extensions::UnpackedInstaller> installer( |
| 3987 extensions::UnpackedInstaller::Create(service)); | 3987 extensions::UnpackedInstaller::Create(service)); |
| 3988 installer->set_prompt_for_plugins(with_ui); | 3988 installer->set_prompt_for_plugins(with_ui); |
| (...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6667 } | 6667 } |
| 6668 | 6668 |
| 6669 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6669 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6670 WebContents* tab) { | 6670 WebContents* tab) { |
| 6671 if (browser->GetActiveWebContents() != tab || | 6671 if (browser->GetActiveWebContents() != tab || |
| 6672 browser != BrowserList::GetLastActive()) { | 6672 browser != BrowserList::GetLastActive()) { |
| 6673 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), | 6673 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), |
| 6674 true /* user_gesture */); | 6674 true /* user_gesture */); |
| 6675 } | 6675 } |
| 6676 } | 6676 } |
| OLD | NEW |