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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker_controller.cc

Issue 10399069: Reland 137540 - Disable off-store extension installs by default. Also get rid of ExtensionService::… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « chrome/browser/extensions/webstore_installer.cc ('k') | chrome/common/chrome_switches.h » ('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/ui/intents/web_intent_picker_controller.h" 5 #include "chrome/browser/ui/intents/web_intent_picker_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 302
303 void WebIntentPickerController::OnInlineDispositionWebContentsCreated( 303 void WebIntentPickerController::OnInlineDispositionWebContentsCreated(
304 content::WebContents* web_contents) { 304 content::WebContents* web_contents) {
305 if (web_contents) 305 if (web_contents)
306 intents_dispatcher_->DispatchIntent(web_contents); 306 intents_dispatcher_->DispatchIntent(web_contents);
307 } 307 }
308 308
309 void WebIntentPickerController::OnExtensionInstallRequested( 309 void WebIntentPickerController::OnExtensionInstallRequested(
310 const std::string& id) { 310 const std::string& id) {
311 scoped_ptr<WebstoreInstaller::Approval> approval(
312 WebstoreInstaller::Approval::CreateWithInstallPrompt(
313 wrapper_->profile()));
314
311 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( 315 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
312 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id, 316 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id,
313 scoped_ptr<WebstoreInstaller::Approval>(NULL), 317 approval.Pass(), WebstoreInstaller::FLAG_INLINE_INSTALL);
314 WebstoreInstaller::FLAG_INLINE_INSTALL);
315 318
316 pending_async_count_++; 319 pending_async_count_++;
317 installer->Start(); 320 installer->Start();
318 } 321 }
319 322
320 void WebIntentPickerController::OnExtensionLinkClicked(const std::string& id) { 323 void WebIntentPickerController::OnExtensionLinkClicked(const std::string& id) {
321 // Navigate from source tab. 324 // Navigate from source tab.
322 Browser* browser = 325 Browser* browser =
323 browser::FindBrowserWithWebContents(wrapper_->web_contents()); 326 browser::FindBrowserWithWebContents(wrapper_->web_contents());
324 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix() + id); 327 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix() + id);
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 // If picker is non-NULL, it was set by a test. 688 // If picker is non-NULL, it was set by a test.
686 if (picker_ == NULL) 689 if (picker_ == NULL)
687 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); 690 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get());
688 picker_shown_ = true; 691 picker_shown_ = true;
689 } 692 }
690 693
691 void WebIntentPickerController::ClosePicker() { 694 void WebIntentPickerController::ClosePicker() {
692 if (picker_) 695 if (picker_)
693 picker_->Close(); 696 picker_->Close();
694 } 697 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698