OLD | NEW |
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_EXTENSION_API_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSION_API_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSION_API_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSION_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 class ExtensionDownloadsEventRouter : public DownloadManager::Observer { | 256 class ExtensionDownloadsEventRouter : public DownloadManager::Observer { |
257 public: | 257 public: |
258 explicit ExtensionDownloadsEventRouter(Profile* profile); | 258 explicit ExtensionDownloadsEventRouter(Profile* profile); |
259 virtual ~ExtensionDownloadsEventRouter(); | 259 virtual ~ExtensionDownloadsEventRouter(); |
260 | 260 |
261 virtual void ModelChanged() OVERRIDE; | 261 virtual void ModelChanged() OVERRIDE; |
262 virtual void ManagerGoingDown() OVERRIDE; | 262 virtual void ManagerGoingDown() OVERRIDE; |
263 | 263 |
264 private: | 264 private: |
| 265 void Init(DownloadManager* manager); |
265 void DispatchEvent(const char* event_name, base::Value* json_arg); | 266 void DispatchEvent(const char* event_name, base::Value* json_arg); |
266 typedef base::hash_map<int, DownloadItem*> ItemMap; | 267 typedef base::hash_map<int, DownloadItem*> ItemMap; |
267 typedef std::set<int> DownloadIdSet; | 268 typedef std::set<int> DownloadIdSet; |
268 | 269 |
269 Profile* profile_; | 270 Profile* profile_; |
270 DownloadManager* manager_; | 271 DownloadManager* manager_; |
271 DownloadIdSet downloads_; | 272 DownloadIdSet downloads_; |
272 | 273 |
273 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 274 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
274 }; | 275 }; |
275 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSION_API_H_ | 276 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSION_API_H_ |
OLD | NEW |