Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698