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

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

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lint Created 8 years, 4 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_COMPLETION_OBSERVER_WIN_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
6 #define CHROME_BROWSER_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "content/public/browser/download_item.h" 11 #include "content/public/browser/download_item.h"
12 #include "content/public/browser/download_manager.h" 12 #include "content/public/browser/download_manager.h"
13 13
14 // Tracks download item completions and notifies any interested parties 14 // Tracks download item completions and notifies any interested parties
15 // (Windows 8 metro) about the same. On Windows 8 we display metro style 15 // (Windows 8 metro) about the same. On Windows 8 we display metro style
16 // notifications when a download completes. 16 // notifications when a download completes.
17 class DownloadCompletionObserver 17 class DownloadCompletionObserver
18 : public content::DownloadManager::Observer, 18 : public content::DownloadManager::Observer,
19 public content::DownloadItem::Observer { 19 public content::DownloadItem::Observer {
20 public: 20 public:
21 explicit DownloadCompletionObserver(content::DownloadManager* manager); 21 explicit DownloadCompletionObserver(content::DownloadManager* manager);
22 ~DownloadCompletionObserver(); 22 ~DownloadCompletionObserver();
23 23
24 // Methods inherited from content::DownloadManager::Observer. 24 // Methods inherited from content::DownloadManager::Observer.
25 virtual void OnDownloadCreated( 25 virtual void OnDownloadCreated(
26 content::DownloadManager* manager, content::DownloadItem* download) 26 content::DownloadManager* manager, content::DownloadItem* download)
27 OVERRIDE; 27 OVERRIDE;
28 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; 28 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE;
29 29
30 // Methods inherited from content::DownloadItem::Observer. 30 // Methods inherited from content::DownloadItem::Observer.
31 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 31 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
32 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} 32 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
33 33
34 private: 34 private:
35 void ClearDownloadItems(); 35 void ClearDownloadItems();
36 36
37 std::set<content::DownloadItem*> download_items_; 37 std::set<content::DownloadItem*> download_items_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(DownloadCompletionObserver); 39 DISALLOW_COPY_AND_ASSIGN(DownloadCompletionObserver);
40 }; 40 };
41 41
42 #endif // CHROME_BROWSER_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_ 42 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698