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

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

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. Created 4 years, 1 month 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 #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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // of this method will be different from DownloadItem::OpenDownload() if 158 // of this method will be different from DownloadItem::OpenDownload() if
159 // ShouldPreferOpeningInBrowser(). 159 // ShouldPreferOpeningInBrowser().
160 void OpenUsingPlatformHandler(); 160 void OpenUsingPlatformHandler();
161 161
162 // Whether the download was removed and this is currently being undone. 162 // Whether the download was removed and this is currently being undone.
163 bool IsBeingRevived() const; 163 bool IsBeingRevived() const;
164 164
165 // Set whether the download is being revived. 165 // Set whether the download is being revived.
166 void SetIsBeingRevived(bool is_being_revived); 166 void SetIsBeingRevived(bool is_being_revived);
167 167
168 // Returns |true| if user opened or shown download item in shell. Download
169 // shelf checks this for autohide.
170 bool GetOpenedOrShown() const;
171
172 // Sets whether download was opened or shown in shell. Download shelf marks
173 // downloads as shown or opened if user manually closes the shelf.
174 void SetOpenedOrShown(bool opened_or_shown);
175
168 content::DownloadItem* download() { return download_; } 176 content::DownloadItem* download() { return download_; }
169 177
170 // Returns a string representations of the current download progress sizes. If 178 // Returns a string representations of the current download progress sizes. If
171 // the total size of the download is known, this string looks like: "100/200 179 // the total size of the download is known, this string looks like: "100/200
172 // MB" where the numerator is the transferred size and the denominator is the 180 // MB" where the numerator is the transferred size and the denominator is the
173 // total size. If the total isn't known, returns the transferred size as a 181 // total size. If the total isn't known, returns the transferred size as a
174 // string (e.g.: "100 MB"). 182 // string (e.g.: "100 MB").
175 base::string16 GetProgressSizesString() const; 183 base::string16 GetProgressSizesString() const;
176 184
177 private: 185 private:
178 // Returns a string indicating the status of an in-progress download. 186 // Returns a string indicating the status of an in-progress download.
179 base::string16 GetInProgressStatusString() const; 187 base::string16 GetInProgressStatusString() const;
180 188
181 // The DownloadItem that this model represents. Note that DownloadItemModel 189 // The DownloadItem that this model represents. Note that DownloadItemModel
182 // itself shouldn't maintain any state since there can be more than one 190 // itself shouldn't maintain any state since there can be more than one
183 // DownloadItemModel in use with the same DownloadItem. 191 // DownloadItemModel in use with the same DownloadItem.
184 content::DownloadItem* download_; 192 content::DownloadItem* download_;
185 193
186 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); 194 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel);
187 }; 195 };
188 196
189 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ 197 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698