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

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

Issue 11419169: Use DownloadItemModel for storing chrome/ specific UI data for DownloadItems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years 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
« chrome/browser/ui/browser.cc ('K') | « 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/download/download_item_model.h"
16 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/extension_system.h" 17 #include "chrome/browser/extensions/extension_system.h"
18 #include "chrome/browser/extensions/platform_app_launcher.h" 18 #include "chrome/browser/extensions/platform_app_launcher.h"
19 #include "chrome/browser/extensions/webstore_installer.h" 19 #include "chrome/browser/extensions/webstore_installer.h"
20 #include "chrome/browser/intents/cws_intents_registry_factory.h" 20 #include "chrome/browser/intents/cws_intents_registry_factory.h"
21 #include "chrome/browser/intents/default_web_intent_service.h" 21 #include "chrome/browser/intents/default_web_intent_service.h"
22 #include "chrome/browser/intents/intent_service_host.h" 22 #include "chrome/browser/intents/intent_service_host.h"
23 #include "chrome/browser/intents/native_services.h" 23 #include "chrome/browser/intents/native_services.h"
24 #include "chrome/browser/intents/web_intents_registry_factory.h" 24 #include "chrome/browser/intents/web_intents_registry_factory.h"
25 #include "chrome/browser/intents/web_intents_reporting.h" 25 #include "chrome/browser/intents/web_intents_reporting.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 CancelDownload(); 471 CancelDownload();
472 #if defined(TOOLKIT_VIEWS) 472 #if defined(TOOLKIT_VIEWS)
473 if (cancelled_) 473 if (cancelled_)
474 OnUserCancelledPickerDialog(); 474 OnUserCancelledPickerDialog();
475 #endif 475 #endif
476 } 476 }
477 477
478 void WebIntentPickerController::OnExtensionDownloadStarted( 478 void WebIntentPickerController::OnExtensionDownloadStarted(
479 const std::string& id, 479 const std::string& id,
480 content::DownloadItem* item) { 480 content::DownloadItem* item) {
481 download_util::SetShouldShowInShelf(item, false); 481 DownloadItemModel(item).SetShouldShowInShelf(false);
482 download_id_ = item->GetGlobalId(); 482 download_id_ = item->GetGlobalId();
483 picker_model_->UpdateExtensionDownloadState(item); 483 picker_model_->UpdateExtensionDownloadState(item);
484 } 484 }
485 485
486 void WebIntentPickerController::OnExtensionDownloadProgress( 486 void WebIntentPickerController::OnExtensionDownloadProgress(
487 const std::string& id, 487 const std::string& id,
488 content::DownloadItem* item) { 488 content::DownloadItem* item) {
489 picker_model_->UpdateExtensionDownloadState(item); 489 picker_model_->UpdateExtensionDownloadState(item);
490 } 490 }
491 491
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 content::DownloadManager* download_manager = 967 content::DownloadManager* download_manager =
968 content::BrowserContext::GetDownloadManager(profile); 968 content::BrowserContext::GetDownloadManager(profile);
969 if (!download_manager) 969 if (!download_manager)
970 return; 970 return;
971 content::DownloadItem* item = 971 content::DownloadItem* item =
972 download_manager->GetDownload(download_id_.local()); 972 download_manager->GetDownload(download_id_.local());
973 if (item) 973 if (item)
974 item->Cancel(true); 974 item->Cancel(true);
975 download_id_ = content::DownloadId(); 975 download_id_ = content::DownloadId();
976 } 976 }
OLDNEW
« chrome/browser/ui/browser.cc ('K') | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698