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

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

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 manager, 4011 manager,
4012 service, 4012 service,
4013 this, 4013 this,
4014 reply_message); 4014 reply_message);
4015 4015
4016 FilePath extension_path(path_string); 4016 FilePath extension_path(path_string);
4017 // If the given path has a 'crx' extension, assume it is a packed extension 4017 // If the given path has a 'crx' extension, assume it is a packed extension
4018 // and install it. Otherwise load it as an unpacked extension. 4018 // and install it. Otherwise load it as an unpacked extension.
4019 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) { 4019 if (extension_path.MatchesExtension(FILE_PATH_LITERAL(".crx"))) {
4020 ExtensionInstallPrompt* client = 4020 ExtensionInstallPrompt* client =
4021 (with_ui ? new ExtensionInstallPrompt(browser) : NULL); 4021 (with_ui ? chrome::CreateExtensionInstallPromptWithBrowser(
Aaron Boodman 2012/07/03 00:52:14 I'm no style expert, but this looks weird.
Ben Goodger (Google) 2012/07/03 19:17:00 Done.
4022 browser) : NULL);
4022 scoped_refptr<CrxInstaller> installer( 4023 scoped_refptr<CrxInstaller> installer(
4023 CrxInstaller::Create(service, client)); 4024 CrxInstaller::Create(service, client));
4024 if (!with_ui) 4025 if (!with_ui)
4025 installer->set_allow_silent_install(true); 4026 installer->set_allow_silent_install(true);
4026 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); 4027 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION);
4027 if (from_webstore) 4028 if (from_webstore)
4028 installer->set_creation_flags(Extension::FROM_WEBSTORE); 4029 installer->set_creation_flags(Extension::FROM_WEBSTORE);
4029 installer->InstallCrx(extension_path); 4030 installer->InstallCrx(extension_path);
4030 } else { 4031 } else {
4031 scoped_refptr<extensions::UnpackedInstaller> installer( 4032 scoped_refptr<extensions::UnpackedInstaller> installer(
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after
6733 void TestingAutomationProvider::OnRemoveProvider() { 6734 void TestingAutomationProvider::OnRemoveProvider() {
6734 if (g_browser_process) 6735 if (g_browser_process)
6735 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6736 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6736 } 6737 }
6737 6738
6738 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6739 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6739 WebContents* tab) { 6740 WebContents* tab) {
6740 if (chrome::GetActiveWebContents(browser) != tab) 6741 if (chrome::GetActiveWebContents(browser) != tab)
6741 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); 6742 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true);
6742 } 6743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698