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

Side by Side Diff: chrome/browser/download/download_ui_controller.cc

Issue 13859009: Adding a call to support download initiated context menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 7 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
« no previous file with comments | « no previous file | content/browser/android/download_controller_android_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/download/download_ui_controller.h" 5 #include "chrome/browser/download/download_ui_controller.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/download/download_item_model.h" 8 #include "chrome/browser/download/download_item_model.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 21 matching lines...) Expand all
32 DefaultUIControllerDelegateAndroid() {} 32 DefaultUIControllerDelegateAndroid() {}
33 virtual ~DefaultUIControllerDelegateAndroid() {} 33 virtual ~DefaultUIControllerDelegateAndroid() {}
34 34
35 private: 35 private:
36 // DownloadUIController::Delegate 36 // DownloadUIController::Delegate
37 virtual void NotifyDownloadStarting(content::DownloadItem* item) OVERRIDE; 37 virtual void NotifyDownloadStarting(content::DownloadItem* item) OVERRIDE;
38 }; 38 };
39 39
40 void DefaultUIControllerDelegateAndroid::NotifyDownloadStarting( 40 void DefaultUIControllerDelegateAndroid::NotifyDownloadStarting(
41 content::DownloadItem* item) { 41 content::DownloadItem* item) {
42 // GET downloads are delegated to the Android DownloadManager. Chrome is only 42 // GET downloads without authentication are delegated to the Android
43 // responsible for POST downloads. See 43 // DownloadManager. Chrome is responsible for the rest. See
44 // ChromeWebContentsDelegateAndroid::CanDownload(). 44 // InterceptDownloadResourceThrottle::ProcessDownloadRequest().
45 content::DownloadControllerAndroid::Get()->OnPostDownloadStarted(item); 45 content::DownloadControllerAndroid::Get()->OnDownloadStarted(item);
46 } 46 }
47 47
48 #else // OS_ANDROID 48 #else // OS_ANDROID
49 49
50 class DefaultUIControllerDelegate : public DownloadUIController::Delegate { 50 class DefaultUIControllerDelegate : public DownloadUIController::Delegate {
51 public: 51 public:
52 // |profile| is required to outlive DefaultUIControllerDelegate. 52 // |profile| is required to outlive DefaultUIControllerDelegate.
53 explicit DefaultUIControllerDelegate(Profile* profile) 53 explicit DefaultUIControllerDelegate(Profile* profile)
54 : profile_(profile) {} 54 : profile_(profile) {}
55 virtual ~DefaultUIControllerDelegate() {} 55 virtual ~DefaultUIControllerDelegate() {}
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (item->GetTargetFilePath().empty()) 144 if (item->GetTargetFilePath().empty())
145 return; 145 return;
146 146
147 // Can't be complete. That would imply that we didn't receive an 147 // Can't be complete. That would imply that we didn't receive an
148 // OnDownloadUpdated() after the target was determined. 148 // OnDownloadUpdated() after the target was determined.
149 DCHECK(!item->IsComplete()); 149 DCHECK(!item->IsComplete());
150 150
151 DownloadItemModel(item).SetShouldNotifyUI(false); 151 DownloadItemModel(item).SetShouldNotifyUI(false);
152 delegate_->NotifyDownloadStarting(item); 152 delegate_->NotifyDownloadStarting(item);
153 } 153 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/download_controller_android_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698