| OLD | NEW | 
|---|
| 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_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 
| 6 #define CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 
| 7 | 7 | 
| 8 #include <set> | 8 #include <set> | 
| 9 | 9 | 
| 10 #include "base/macros.h" | 10 #include "base/macros.h" | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 43    public: | 43    public: | 
| 44     Observer() {} | 44     Observer() {} | 
| 45     virtual ~Observer() {} | 45     virtual ~Observer() {} | 
| 46 | 46 | 
| 47     virtual void OnDownloadCreated( | 47     virtual void OnDownloadCreated( | 
| 48         content::DownloadManager* manager, content::DownloadItem* item) {} | 48         content::DownloadManager* manager, content::DownloadItem* item) {} | 
| 49     virtual void OnDownloadUpdated( | 49     virtual void OnDownloadUpdated( | 
| 50         content::DownloadManager* manager, content::DownloadItem* item) {} | 50         content::DownloadManager* manager, content::DownloadItem* item) {} | 
| 51     virtual void OnDownloadOpened( | 51     virtual void OnDownloadOpened( | 
| 52         content::DownloadManager* manager, content::DownloadItem* item) {} | 52         content::DownloadManager* manager, content::DownloadItem* item) {} | 
|  | 53     virtual void OnDownloadShown( | 
|  | 54         content::DownloadManager* manager, content::DownloadItem* item) {} | 
| 53     virtual void OnDownloadRemoved( | 55     virtual void OnDownloadRemoved( | 
| 54         content::DownloadManager* manager, content::DownloadItem* item) {} | 56         content::DownloadManager* manager, content::DownloadItem* item) {} | 
| 55 | 57 | 
| 56    private: | 58    private: | 
| 57     DISALLOW_COPY_AND_ASSIGN(Observer); | 59     DISALLOW_COPY_AND_ASSIGN(Observer); | 
| 58   }; | 60   }; | 
| 59 | 61 | 
| 60   AllDownloadItemNotifier(content::DownloadManager* manager, | 62   AllDownloadItemNotifier(content::DownloadManager* manager, | 
| 61                           Observer* observer); | 63                           Observer* observer); | 
| 62 | 64 | 
| 63   ~AllDownloadItemNotifier() override; | 65   ~AllDownloadItemNotifier() override; | 
| 64 | 66 | 
| 65   // Returns NULL if the manager has gone down. | 67   // Returns NULL if the manager has gone down. | 
| 66   content::DownloadManager* GetManager() const { return manager_; } | 68   content::DownloadManager* GetManager() const { return manager_; } | 
| 67 | 69 | 
| 68  private: | 70  private: | 
| 69   // content::DownloadManager::Observer | 71   // content::DownloadManager::Observer | 
| 70   void ManagerGoingDown(content::DownloadManager* manager) override; | 72   void ManagerGoingDown(content::DownloadManager* manager) override; | 
| 71   void OnDownloadCreated(content::DownloadManager* manager, | 73   void OnDownloadCreated(content::DownloadManager* manager, | 
| 72                          content::DownloadItem* item) override; | 74                          content::DownloadItem* item) override; | 
| 73 | 75 | 
| 74   // content::DownloadItem::Observer | 76   // content::DownloadItem::Observer | 
| 75   void OnDownloadUpdated(content::DownloadItem* item) override; | 77   void OnDownloadUpdated(content::DownloadItem* item) override; | 
| 76   void OnDownloadOpened(content::DownloadItem* item) override; | 78   void OnDownloadOpened(content::DownloadItem* item) override; | 
|  | 79   void OnDownloadShown(content::DownloadItem* item) override; | 
| 77   void OnDownloadRemoved(content::DownloadItem* item) override; | 80   void OnDownloadRemoved(content::DownloadItem* item) override; | 
| 78   void OnDownloadDestroyed(content::DownloadItem* item) override; | 81   void OnDownloadDestroyed(content::DownloadItem* item) override; | 
| 79 | 82 | 
| 80   content::DownloadManager* manager_; | 83   content::DownloadManager* manager_; | 
| 81   AllDownloadItemNotifier::Observer* observer_; | 84   AllDownloadItemNotifier::Observer* observer_; | 
| 82   std::set<content::DownloadItem*> observing_; | 85   std::set<content::DownloadItem*> observing_; | 
| 83 | 86 | 
| 84   DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifier); | 87   DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifier); | 
| 85 }; | 88 }; | 
| 86 | 89 | 
| 87 #endif  // CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 90 #endif  // CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 
| OLD | NEW | 
|---|