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

Side by Side Diff: chrome/browser/download/download_item_model.h

Issue 230103002: [Downloads] Ask DownloadHistory if a download was from history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move responsibility of determining whether to show a download in the UI to DownloadItemModel Created 6 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
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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Returns |true| if this download should be displayed in the downloads shelf. 111 // Returns |true| if this download should be displayed in the downloads shelf.
112 bool ShouldShowInShelf() const; 112 bool ShouldShowInShelf() const;
113 113
114 // Change whether the download should be displayed on the downloads 114 // Change whether the download should be displayed on the downloads
115 // shelf. Setting this is only effective if the download hasn't already been 115 // shelf. Setting this is only effective if the download hasn't already been
116 // displayed in the shelf. 116 // displayed in the shelf.
117 void SetShouldShowInShelf(bool should_show); 117 void SetShouldShowInShelf(bool should_show);
118 118
119 // Returns |true| if the UI should be notified when the download is ready to 119 // Returns |true| if the UI should be notified when the download is ready to
120 // be presented in the UI. By default, this value is |false| and should be 120 // be presented in the UI. Note that this is indpendent of ShouldShowInShelf()
121 // changed explicitly using SetShouldNotifyUI(). Note that this is indpendent 121 // since there might be actions other than showing in the shelf that the UI
122 // of ShouldShowInShelf() since there might be actions other than showing in 122 // must perform.
123 // the shelf that the UI must perform.
124 bool ShouldNotifyUI() const; 123 bool ShouldNotifyUI() const;
125 124
126 // Change what's returned by ShouldNotifyUI(). 125 // Returns |true| if the UI has been notified about this download. By default,
127 void SetShouldNotifyUI(bool should_notify); 126 // this value is |false| and should be changed explicitly using
127 // SetWasUINotified().
128 bool WasUINotified() const;
129
130 // Change what's returned by WasUINotified().
131 void SetWasUINotified(bool should_notify);
128 132
129 // Returns |true| if opening in the browser is preferred for this download. If 133 // Returns |true| if opening in the browser is preferred for this download. If
130 // |false|, the download should be opened with the system default application. 134 // |false|, the download should be opened with the system default application.
131 bool ShouldPreferOpeningInBrowser() const; 135 bool ShouldPreferOpeningInBrowser() const;
132 136
133 // Change what's returned by ShouldPreferOpeningInBrowser to |preference|. 137 // Change what's returned by ShouldPreferOpeningInBrowser to |preference|.
134 void SetShouldPreferOpeningInBrowser(bool preference); 138 void SetShouldPreferOpeningInBrowser(bool preference);
135 139
136 // Open the download using the platform handler for the download. The behavior 140 // Open the download using the platform handler for the download. The behavior
137 // of this method will be different from DownloadItem::OpenDownload() if 141 // of this method will be different from DownloadItem::OpenDownload() if
(...skipping 15 matching lines...) Expand all
153 157
154 // The DownloadItem that this model represents. Note that DownloadItemModel 158 // The DownloadItem that this model represents. Note that DownloadItemModel
155 // itself shouldn't maintain any state since there can be more than one 159 // itself shouldn't maintain any state since there can be more than one
156 // DownloadItemModel in use with the same DownloadItem. 160 // DownloadItemModel in use with the same DownloadItem.
157 content::DownloadItem* download_; 161 content::DownloadItem* download_;
158 162
159 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); 163 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel);
160 }; 164 };
161 165
162 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ 166 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698