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

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: Add a .cc file for constants to be able to compile in debug mode 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 content::DownloadManager* download_manager = 1115 content::DownloadManager* download_manager =
1117 content::BrowserContext::GetDownloadManager(profile); 1116 content::BrowserContext::GetDownloadManager(profile);
1118 if (!download_manager) 1117 if (!download_manager)
1119 return; 1118 return;
1120 content::DownloadItem* item = 1119 content::DownloadItem* item =
1121 download_manager->GetDownload(download_id_.local()); 1120 download_manager->GetDownload(download_id_.local());
1122 if (item) 1121 if (item)
1123 item->Cancel(true); 1122 item->Cancel(true);
1124 download_id_ = content::DownloadId(); 1123 download_id_ = content::DownloadId();
1125 } 1124 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker.h ('k') | chrome/browser/ui/intents/web_intent_picker_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698