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_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 DOWNLOADS_FUNCTION_SET_DESTINATION = 6, | 59 DOWNLOADS_FUNCTION_SET_DESTINATION = 6, |
60 DOWNLOADS_FUNCTION_ACCEPT_DANGER = 7, | 60 DOWNLOADS_FUNCTION_ACCEPT_DANGER = 7, |
61 DOWNLOADS_FUNCTION_SHOW = 8, | 61 DOWNLOADS_FUNCTION_SHOW = 8, |
62 DOWNLOADS_FUNCTION_DRAG = 9, | 62 DOWNLOADS_FUNCTION_DRAG = 9, |
63 DOWNLOADS_FUNCTION_GET_FILE_ICON = 10, | 63 DOWNLOADS_FUNCTION_GET_FILE_ICON = 10, |
64 // Insert new values here, not at the beginning. | 64 // Insert new values here, not at the beginning. |
65 DOWNLOADS_FUNCTION_LAST | 65 DOWNLOADS_FUNCTION_LAST |
66 }; | 66 }; |
67 | 67 |
68 protected: | 68 protected: |
| 69 virtual ~DownloadsFunctionInterface() {} |
| 70 |
69 // Return true if args_ is well-formed, otherwise set error_ and return false. | 71 // Return true if args_ is well-formed, otherwise set error_ and return false. |
70 virtual bool ParseArgs() = 0; | 72 virtual bool ParseArgs() = 0; |
71 | 73 |
72 // Implementation-specific logic. "Do the thing that you do." Should return | 74 // Implementation-specific logic. "Do the thing that you do." Should return |
73 // true if the call succeeded and false otherwise. | 75 // true if the call succeeded and false otherwise. |
74 virtual bool RunInternal() = 0; | 76 virtual bool RunInternal() = 0; |
75 | 77 |
76 // Which subclass is this. | 78 // Which subclass is this. |
77 virtual DownloadsFunctionName function() const = 0; | 79 virtual DownloadsFunctionName function() const = 0; |
78 | 80 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 Profile* profile_; | 376 Profile* profile_; |
375 content::DownloadManager* manager_; | 377 content::DownloadManager* manager_; |
376 ItemMap downloads_; | 378 ItemMap downloads_; |
377 ItemJsonMap item_jsons_; | 379 ItemJsonMap item_jsons_; |
378 OnChangedStatMap on_changed_stats_; | 380 OnChangedStatMap on_changed_stats_; |
379 | 381 |
380 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 382 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
381 }; | 383 }; |
382 | 384 |
383 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 385 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
OLD | NEW |