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

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

Issue 11044020: Make Web Intents picker in Views conform to latest mocks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 8 years, 2 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
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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 extension_id, 552 extension_id,
553 &services); 553 &services);
554 554
555 // Extension must be registered with registry by now. 555 // Extension must be registered with registry by now.
556 DCHECK(services.size() > 0); 556 DCHECK(services.size() > 0);
557 557
558 // TODO(binji): We're going to need to disambiguate if there are multiple 558 // TODO(binji): We're going to need to disambiguate if there are multiple
559 // services. For now, just choose the first. 559 // services. For now, just choose the first.
560 const webkit_glue::WebIntentServiceData& service_data = services[0]; 560 const webkit_glue::WebIntentServiceData& service_data = services[0];
561 561
562 picker_model_->AddInstalledService( 562 picker_model_->RemoveSuggestedExtension(extension_id);
563 service_data.title, service_data.service_url, 563 AddServiceToModel(service_data);
564 service_data.disposition);
565 OnServiceChosen(service_data.service_url, service_data.disposition, 564 OnServiceChosen(service_data.service_url, service_data.disposition,
566 kEnableDefaults); 565 kEnableDefaults);
567 AsyncOperationFinished(); 566 AsyncOperationFinished();
568 } 567 }
569 568
570 void WebIntentPickerController::OnExtensionInstallFailure( 569 void WebIntentPickerController::OnExtensionInstallFailure(
571 const std::string& id, 570 const std::string& id,
572 const std::string& error, 571 const std::string& error,
573 WebstoreInstaller::FailureReason reason) { 572 WebstoreInstaller::FailureReason reason) {
574 // If the user cancelled the install then don't show an error message. 573 // If the user cancelled the install then don't show an error message.
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 content::DownloadManager* download_manager = 1111 content::DownloadManager* download_manager =
1113 content::BrowserContext::GetDownloadManager(profile); 1112 content::BrowserContext::GetDownloadManager(profile);
1114 if (!download_manager) 1113 if (!download_manager)
1115 return; 1114 return;
1116 content::DownloadItem* item = 1115 content::DownloadItem* item =
1117 download_manager->GetDownload(download_id_.local()); 1116 download_manager->GetDownload(download_id_.local());
1118 if (item) 1117 if (item)
1119 item->Cancel(true); 1118 item->Cancel(true);
1120 download_id_ = content::DownloadId(); 1119 download_id_ = content::DownloadId();
1121 } 1120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698