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

Unified Diff: chrome/browser/download/download_completion_observer_win.h

Issue 10832174: Fire a notification in Windows 8 metro chrome which informs the user about a completed download. Th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_completion_observer_win.h
===================================================================
--- chrome/browser/download/download_completion_observer_win.h (revision 0)
+++ chrome/browser/download/download_completion_observer_win.h (revision 0)
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
+#define CHROME_BROWSER_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
+
+#include <set>
+
+#include "base/basictypes.h"
+#include "content/public/browser/download_item.h"
+#include "content/public/browser/download_manager.h"
+
+// Tracks download item completions and notifies any interested parties
+// (Windows 8 metro) about the same. On Windows 8 we display metro style
+// notifications when a download completes.
+class DownloadCompletionObserver
+ : public content::DownloadManager::Observer,
+ public content::DownloadItem::Observer {
+ public:
+ explicit DownloadCompletionObserver(content::DownloadManager* manager);
+ ~DownloadCompletionObserver();
+
+ // Methods inherited from content::DownloadManager::Observer.
+ virtual void OnDownloadCreated(
+ content::DownloadManager* manager, content::DownloadItem* download)
+ OVERRIDE;
+ virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE;
+
+ // Methods inherited from content::DownloadItem::Observer.
+ virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
+ virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {}
+
+ private:
+ void ClearDownloadItems();
+
+ std::set<content::DownloadItem*> download_items_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadCompletionObserver);
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_COMPLETION_OBSERVER_WIN_H_
Property changes on: chrome\browser\download\download_completion_observer_win.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698