OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 // NotificationObserver implementation. | 94 // NotificationObserver implementation. |
95 void Observe(int type, | 95 void Observe(int type, |
96 const content::NotificationSource& source, | 96 const content::NotificationSource& source, |
97 const content::NotificationDetails& details) override; | 97 const content::NotificationDetails& details) override; |
98 | 98 |
99 // ExtensionRegistryObserver implementation. | 99 // ExtensionRegistryObserver implementation. |
100 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 100 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
101 const Extension* extension, | 101 const Extension* extension, |
102 UnloadedExtensionInfo::Reason reason) override; | 102 UnloadedExtensionReason reason) override; |
103 | 103 |
104 Operation* GetOperation(const ExtensionId& extension_id); | 104 Operation* GetOperation(const ExtensionId& extension_id); |
105 void DeleteOperation(const ExtensionId& extension_id); | 105 void DeleteOperation(const ExtensionId& extension_id); |
106 | 106 |
107 // Accessor to the associated profile download folder | 107 // Accessor to the associated profile download folder |
108 base::FilePath GetAssociatedDownloadFolder(); | 108 base::FilePath GetAssociatedDownloadFolder(); |
109 | 109 |
110 friend class BrowserContextKeyedAPIFactory<OperationManager>; | 110 friend class BrowserContextKeyedAPIFactory<OperationManager>; |
111 typedef std::map<ExtensionId, scoped_refptr<Operation> > OperationMap; | 111 typedef std::map<ExtensionId, scoped_refptr<Operation> > OperationMap; |
112 | 112 |
113 content::BrowserContext* browser_context_; | 113 content::BrowserContext* browser_context_; |
114 OperationMap operations_; | 114 OperationMap operations_; |
115 content::NotificationRegistrar registrar_; | 115 content::NotificationRegistrar registrar_; |
116 | 116 |
117 // Listen to extension unloaded notification. | 117 // Listen to extension unloaded notification. |
118 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 118 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
119 extension_registry_observer_; | 119 extension_registry_observer_; |
120 | 120 |
121 base::WeakPtrFactory<OperationManager> weak_factory_; | 121 base::WeakPtrFactory<OperationManager> weak_factory_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(OperationManager); | 123 DISALLOW_COPY_AND_ASSIGN(OperationManager); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace image_writer | 126 } // namespace image_writer |
127 } // namespace extensions | 127 } // namespace extensions |
128 | 128 |
129 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ | 129 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ |
OLD | NEW |