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

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

Issue 11640007: Make the UI an observer of downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android clang build Created 7 years, 9 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 bool ShouldShowDownloadStartedAnimation() const; 98 bool ShouldShowDownloadStartedAnimation() const;
99 99
100 // Returns |true| if this download should be displayed in the downloads shelf. 100 // Returns |true| if this download should be displayed in the downloads shelf.
101 bool ShouldShowInShelf() const; 101 bool ShouldShowInShelf() const;
102 102
103 // Change whether the download should be displayed on the downloads 103 // Change whether the download should be displayed on the downloads
104 // shelf. Setting this is only effective if the download hasn't already been 104 // shelf. Setting this is only effective if the download hasn't already been
105 // displayed in the shelf. 105 // displayed in the shelf.
106 void SetShouldShowInShelf(bool should_show); 106 void SetShouldShowInShelf(bool should_show);
107 107
108 // Returns |true| if the UI should be notified when the download is ready to
109 // be presented in the UI. By default, this value is |false| and should be
110 // changed explicitly using SetShouldNotifyUI(). Note that this is indpendent
111 // of ShouldShowInShelf() since there might be actions other than showing in
112 // the shelf that the UI must perform.
113 bool ShouldNotifyUI() const;
114
115 // Change what's returned by ShouldNotifyUI().
116 void SetShouldNotifyUI(bool should_notify);
117
108 content::DownloadItem* download() { return download_; } 118 content::DownloadItem* download() { return download_; }
109 119
110 private: 120 private:
111 // Returns a string representations of the current download progress sizes. If 121 // Returns a string representations of the current download progress sizes. If
112 // the total size of the download is known, this string looks like: "100/200 122 // the total size of the download is known, this string looks like: "100/200
113 // MB" where the numerator is the transferred size and the denominator is the 123 // MB" where the numerator is the transferred size and the denominator is the
114 // total size. If the total isn't known, returns the transferred size as a 124 // total size. If the total isn't known, returns the transferred size as a
115 // string (e.g.: "100 MB"). 125 // string (e.g.: "100 MB").
116 string16 GetProgressSizesString() const; 126 string16 GetProgressSizesString() const;
117 127
118 // Returns a string indicating the status of an in-progress download. 128 // Returns a string indicating the status of an in-progress download.
119 string16 GetInProgressStatusString() const; 129 string16 GetInProgressStatusString() const;
120 130
121 // The DownloadItem that this model represents. Note that DownloadItemModel 131 // The DownloadItem that this model represents. Note that DownloadItemModel
122 // itself shouldn't maintain any state since there can be more than one 132 // itself shouldn't maintain any state since there can be more than one
123 // DownloadItemModel in use with the same DownloadItem. 133 // DownloadItemModel in use with the same DownloadItem.
124 content::DownloadItem* download_; 134 content::DownloadItem* download_;
125 135
126 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); 136 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel);
127 }; 137 };
128 138
129 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ 139 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698