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: content/browser/download/download_status_updater.h

Issue 8381009: Const-ify DownloadStatusUpdaterDelegate methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 14
15 class DownloadStatusUpdaterDelegate; 15 class DownloadStatusUpdaterDelegate;
16 16
17 // Keeps track of download progress for the entire browser. 17 // Keeps track of download progress for the entire browser.
18 class CONTENT_EXPORT DownloadStatusUpdater 18 class CONTENT_EXPORT DownloadStatusUpdater
19 : public base::SupportsWeakPtr<DownloadStatusUpdater> { 19 : public base::SupportsWeakPtr<DownloadStatusUpdater> {
20 public: 20 public:
21 DownloadStatusUpdater(); 21 DownloadStatusUpdater();
22 ~DownloadStatusUpdater(); 22 ~DownloadStatusUpdater();
23 23
24 void AddDelegate(DownloadStatusUpdaterDelegate* delegate); 24 void AddDelegate(DownloadStatusUpdaterDelegate* delegate);
25 void RemoveDelegate(DownloadStatusUpdaterDelegate* delegate); 25 void RemoveDelegate(DownloadStatusUpdaterDelegate* delegate);
26 26
27 // If the progress is known (i.e. we know the final size of all downloads), 27 // If the progress is known (i.e. we know the final size of all downloads),
28 // returns true and puts a percentage (in range [0-1]) in |progress|. Also 28 // returns true and puts a percentage (in range [0-1]) in |progress|. Also
29 // returns the number of current downloads in |download_count|. 29 // returns the number of current downloads in |download_count|.
30 bool GetProgress(float* progress, int* download_count); 30 bool GetProgress(float* progress, int* download_count) const;
31 31
32 private: 32 private:
33 // Returns the number of downloads that are in progress. 33 // Returns the number of downloads that are in progress.
34 int64 GetInProgressDownloadCount(); 34 int64 GetInProgressDownloadCount() const;
35 35
36 typedef std::set<DownloadStatusUpdaterDelegate*> DelegateSet; 36 typedef std::set<DownloadStatusUpdaterDelegate*> DelegateSet;
37 DelegateSet delegates_; 37 DelegateSet delegates_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(DownloadStatusUpdater); 39 DISALLOW_COPY_AND_ASSIGN(DownloadStatusUpdater);
40 }; 40 };
41 41
42 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_ 42 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATUS_UPDATER_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_manager.cc ('k') | content/browser/download/download_status_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698