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

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

Issue 9837054: Improve WebstoreInstaller error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 void WebIntentPickerController::OnInlineDispositionWebContentsCreated( 271 void WebIntentPickerController::OnInlineDispositionWebContentsCreated(
272 content::WebContents* web_contents) { 272 content::WebContents* web_contents) {
273 if (web_contents) 273 if (web_contents)
274 intents_dispatcher_->DispatchIntent(web_contents); 274 intents_dispatcher_->DispatchIntent(web_contents);
275 } 275 }
276 276
277 void WebIntentPickerController::OnExtensionInstallRequested( 277 void WebIntentPickerController::OnExtensionInstallRequested(
278 const std::string& id) { 278 const std::string& id) {
279 webstore_installer_ = new WebstoreInstaller( 279 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
280 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id, 280 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id,
281 WebstoreInstaller::FLAG_INLINE_INSTALL); 281 WebstoreInstaller::FLAG_INLINE_INSTALL);
282 282
283 pending_async_count_++; 283 pending_async_count_++;
284 webstore_installer_->Start(); 284 installer->Start();
285 } 285 }
286 286
287 void WebIntentPickerController::OnCancelled() { 287 void WebIntentPickerController::OnCancelled() {
288 if (!intents_dispatcher_) 288 if (!intents_dispatcher_)
289 return; 289 return;
290 290
291 if (service_tab_) { 291 if (service_tab_) {
292 intents_dispatcher_->SendReplyMessage( 292 intents_dispatcher_->SendReplyMessage(
293 webkit_glue::WEB_INTENT_SERVICE_TAB_CLOSED, string16()); 293 webkit_glue::WEB_INTENT_SERVICE_TAB_CLOSED, string16());
294 } else { 294 } else {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 if (--pending_async_count_ == 0) { 527 if (--pending_async_count_ == 0) {
528 picker_->OnPendingAsyncCompleted(); 528 picker_->OnPendingAsyncCompleted();
529 } 529 }
530 } 530 }
531 531
532 void WebIntentPickerController::ClosePicker() { 532 void WebIntentPickerController::ClosePicker() {
533 if (picker_) { 533 if (picker_) {
534 picker_->Close(); 534 picker_->Close();
535 } 535 }
536 } 536 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698