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

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

Issue 15575002: Use DownloadManager::Observer in TestDownloadShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing OVERRIDE Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/download/test_download_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TEST_DOWNLOAD_SHELF_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_
6 #define CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_ 6 #define CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/download/download_shelf.h" 11 #include "chrome/browser/download/download_shelf.h"
12 12 #include "content/public/browser/download_manager.h"
13 namespace content {
14 class DownloadManager;
15 }
16 13
17 // An implementation of DownloadShelf for testing. 14 // An implementation of DownloadShelf for testing.
18 class TestDownloadShelf : public DownloadShelf { 15 class TestDownloadShelf : public DownloadShelf,
16 public content::DownloadManager::Observer {
19 public: 17 public:
20 TestDownloadShelf(); 18 TestDownloadShelf();
21 virtual ~TestDownloadShelf(); 19 virtual ~TestDownloadShelf();
22 20
23 // DownloadShelf: 21 // DownloadShelf:
24 virtual bool IsShowing() const OVERRIDE; 22 virtual bool IsShowing() const OVERRIDE;
25 virtual bool IsClosing() const OVERRIDE; 23 virtual bool IsClosing() const OVERRIDE;
26 virtual Browser* browser() const OVERRIDE; 24 virtual Browser* browser() const OVERRIDE;
27 25
28 // Return |true| if a download was added to this shelf. 26 // Return |true| if a download was added to this shelf.
29 bool did_add_download() const { return did_add_download_; } 27 bool did_add_download() const { return did_add_download_; }
30 28
31 // Set download_manager_ (and the result of calling GetDownloadManager()) 29 // Set download_manager_ (and the result of calling GetDownloadManager())
32 void set_download_manager(content::DownloadManager* download_manager); 30 void set_download_manager(content::DownloadManager* download_manager);
33 31
32 // DownloadManager::Observer implementation.
33 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE;
34
34 protected: 35 protected:
35 virtual void DoAddDownload(content::DownloadItem* download) OVERRIDE; 36 virtual void DoAddDownload(content::DownloadItem* download) OVERRIDE;
36 virtual void DoShow() OVERRIDE; 37 virtual void DoShow() OVERRIDE;
37 virtual void DoClose(CloseReason reason) OVERRIDE; 38 virtual void DoClose(CloseReason reason) OVERRIDE;
38 virtual base::TimeDelta GetTransientDownloadShowDelay() OVERRIDE; 39 virtual base::TimeDelta GetTransientDownloadShowDelay() OVERRIDE;
39 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; 40 virtual content::DownloadManager* GetDownloadManager() OVERRIDE;
40 41
41 private: 42 private:
42 bool is_showing_; 43 bool is_showing_;
43 bool did_add_download_; 44 bool did_add_download_;
44 scoped_refptr<content::DownloadManager> download_manager_; 45 content::DownloadManager* download_manager_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(TestDownloadShelf); 47 DISALLOW_COPY_AND_ASSIGN(TestDownloadShelf);
47 }; 48 };
48 49
49 #endif // CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_ 50 #endif // CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/test_download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698