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