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

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

Issue 11016022: Don't show downloads from web intents picker in shelf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | 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"
11 #include "base/md5.h" 11 #include "base/md5.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/download/download_util.h"
15 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/platform_app_launcher.h" 17 #include "chrome/browser/extensions/platform_app_launcher.h"
17 #include "chrome/browser/extensions/webstore_installer.h" 18 #include "chrome/browser/extensions/webstore_installer.h"
18 #include "chrome/browser/favicon/favicon_service.h" 19 #include "chrome/browser/favicon/favicon_service.h"
19 #include "chrome/browser/favicon/favicon_service_factory.h" 20 #include "chrome/browser/favicon/favicon_service_factory.h"
20 #include "chrome/browser/intents/cws_intents_registry_factory.h" 21 #include "chrome/browser/intents/cws_intents_registry_factory.h"
21 #include "chrome/browser/intents/default_web_intent_service.h" 22 #include "chrome/browser/intents/default_web_intent_service.h"
22 #include "chrome/browser/intents/intent_service_host.h" 23 #include "chrome/browser/intents/intent_service_host.h"
23 #include "chrome/browser/intents/native_services.h" 24 #include "chrome/browser/intents/native_services.h"
24 #include "chrome/browser/intents/web_intents_registry_factory.h" 25 #include "chrome/browser/intents/web_intents_registry_factory.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 CancelDownload(); 537 CancelDownload();
537 #if defined(TOOLKIT_VIEWS) 538 #if defined(TOOLKIT_VIEWS)
538 if (cancelled_) 539 if (cancelled_)
539 OnUserCancelledPickerDialog(); 540 OnUserCancelledPickerDialog();
540 #endif 541 #endif
541 } 542 }
542 543
543 void WebIntentPickerController::OnExtensionDownloadStarted( 544 void WebIntentPickerController::OnExtensionDownloadStarted(
544 const std::string& id, 545 const std::string& id,
545 content::DownloadItem* item) { 546 content::DownloadItem* item) {
547 download_util::SetShouldShowInShelf(item, false);
546 download_id_ = item->GetGlobalId(); 548 download_id_ = item->GetGlobalId();
547 picker_model_->UpdateExtensionDownloadState(item); 549 picker_model_->UpdateExtensionDownloadState(item);
548 } 550 }
549 551
550 void WebIntentPickerController::OnExtensionDownloadProgress( 552 void WebIntentPickerController::OnExtensionDownloadProgress(
551 const std::string& id, 553 const std::string& id,
552 content::DownloadItem* item) { 554 content::DownloadItem* item) {
553 picker_model_->UpdateExtensionDownloadState(item); 555 picker_model_->UpdateExtensionDownloadState(item);
554 } 556 }
555 557
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 content::DownloadManager* download_manager = 1122 content::DownloadManager* download_manager =
1121 content::BrowserContext::GetDownloadManager(profile); 1123 content::BrowserContext::GetDownloadManager(profile);
1122 if (!download_manager) 1124 if (!download_manager)
1123 return; 1125 return;
1124 content::DownloadItem* item = 1126 content::DownloadItem* item =
1125 download_manager->GetDownload(download_id_.local()); 1127 download_manager->GetDownload(download_id_.local());
1126 if (item) 1128 if (item)
1127 item->Cancel(true); 1129 item->Cancel(true);
1128 download_id_ = content::DownloadId(); 1130 download_id_ = content::DownloadId();
1129 } 1131 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698