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

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

Issue 7466033: Fix warning prompting on closing a window that will cancel downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last little things from Achuith and Miranda. 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 11 matching lines...) Expand all
22 explicit DownloadService(Profile* profile); 22 explicit DownloadService(Profile* profile);
23 virtual ~DownloadService(); 23 virtual ~DownloadService();
24 24
25 // Get the download manager. Creates the download manager if 25 // Get the download manager. Creates the download manager if
26 // it does not already exist. 26 // it does not already exist.
27 DownloadManager* GetDownloadManager(); 27 DownloadManager* GetDownloadManager();
28 28
29 // Has a download manager been created? (By calling above function.) 29 // Has a download manager been created? (By calling above function.)
30 bool HasCreatedDownloadManager(); 30 bool HasCreatedDownloadManager();
31 31
32 // Number of downloads associated with this instance of the service.
33 int DownloadCount();
achuithb 2011/10/14 19:22:10 nit: const
Randy Smith (Not in Mondays) 2011/10/14 19:30:47 Done.
34
35 // Number of downloads associated with all profiles.
36 static int TotalDownloadCount();
Paweł Hajdan Jr. 2011/10/14 21:26:19 nit: Unless there is an existing convention, I'd l
Randy Smith (Not in Mondays) 2011/10/15 01:42:20 Done.
37
32 // Sets the DownloadManagerDelegate associated with this object and 38 // Sets the DownloadManagerDelegate associated with this object and
33 // its DownloadManager. Takes ownership of |delegate|, and destroys 39 // its DownloadManager. Takes ownership of |delegate|, and destroys
34 // the previous delegate. For testing. 40 // the previous delegate. For testing.
35 void SetDownloadManagerDelegateForTesting( 41 void SetDownloadManagerDelegateForTesting(
36 ChromeDownloadManagerDelegate* delegate); 42 ChromeDownloadManagerDelegate* delegate);
37 43
38 // Will be called to release references on other services as part 44 // Will be called to release references on other services as part
39 // of Profile shutdown. 45 // of Profile shutdown.
40 virtual void Shutdown() OVERRIDE; 46 virtual void Shutdown() OVERRIDE;
41 47
42 private: 48 private:
43 bool download_manager_created_; 49 bool download_manager_created_;
44 Profile* profile_; 50 Profile* profile_;
45 51
46 // Both of these objects are owned by this class. 52 // Both of these objects are owned by this class.
47 // DownloadManager is RefCountedThreadSafe because of references 53 // DownloadManager is RefCountedThreadSafe because of references
48 // from DownloadFile objects on the FILE thread, and may need to be 54 // from DownloadFile objects on the FILE thread, and may need to be
49 // kept alive until those objects are deleted. 55 // kept alive until those objects are deleted.
50 // ChromeDownloadManagerDelegate may be the target of callbacks from 56 // ChromeDownloadManagerDelegate may be the target of callbacks from
51 // the history service/DB thread and must be kept alive for those 57 // the history service/DB thread and must be kept alive for those
52 // callbacks. 58 // callbacks.
53 scoped_refptr<DownloadManager> manager_; 59 scoped_refptr<DownloadManager> manager_;
54 scoped_refptr<ChromeDownloadManagerDelegate> manager_delegate_; 60 scoped_refptr<ChromeDownloadManagerDelegate> manager_delegate_;
55 61
56 DISALLOW_COPY_AND_ASSIGN(DownloadService); 62 DISALLOW_COPY_AND_ASSIGN(DownloadService);
57 }; 63 };
58 64
59 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ 65 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698