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

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation_manager.h

Issue 666153002: Standardize usage of virtual/override/final in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
40 // Manages image writer operations for the current profile. Including clean-up 40 // Manages image writer operations for the current profile. Including clean-up
41 // and message routing. 41 // and message routing.
42 class OperationManager : public BrowserContextKeyedAPI, 42 class OperationManager : public BrowserContextKeyedAPI,
43 public content::NotificationObserver, 43 public content::NotificationObserver,
44 public extensions::ExtensionRegistryObserver, 44 public extensions::ExtensionRegistryObserver,
45 public base::SupportsWeakPtr<OperationManager> { 45 public base::SupportsWeakPtr<OperationManager> {
46 public: 46 public:
47 typedef std::string ExtensionId; 47 typedef std::string ExtensionId;
48 48
49 explicit OperationManager(content::BrowserContext* context); 49 explicit OperationManager(content::BrowserContext* context);
50 virtual ~OperationManager(); 50 ~OperationManager() override;
51 51
52 virtual void Shutdown() override; 52 void Shutdown() override;
53 53
54 // Starts a WriteFromUrl operation. 54 // Starts a WriteFromUrl operation.
55 void StartWriteFromUrl(const ExtensionId& extension_id, 55 void StartWriteFromUrl(const ExtensionId& extension_id,
56 GURL url, 56 GURL url,
57 const std::string& hash, 57 const std::string& hash,
58 const std::string& device_path, 58 const std::string& device_path,
59 const Operation::StartWriteCallback& callback); 59 const Operation::StartWriteCallback& callback);
60 60
61 // Starts a WriteFromFile operation. 61 // Starts a WriteFromFile operation.
62 void StartWriteFromFile(const ExtensionId& extension_id, 62 void StartWriteFromFile(const ExtensionId& extension_id,
(...skipping 27 matching lines...) Expand all
90 static BrowserContextKeyedAPIFactory<OperationManager>* GetFactoryInstance(); 90 static BrowserContextKeyedAPIFactory<OperationManager>* GetFactoryInstance();
91 static OperationManager* Get(content::BrowserContext* context); 91 static OperationManager* Get(content::BrowserContext* context);
92 92
93 private: 93 private:
94 94
95 static const char* service_name() { 95 static const char* service_name() {
96 return "OperationManager"; 96 return "OperationManager";
97 } 97 }
98 98
99 // NotificationObserver implementation. 99 // NotificationObserver implementation.
100 virtual void Observe(int type, 100 void Observe(int type,
101 const content::NotificationSource& source, 101 const content::NotificationSource& source,
102 const content::NotificationDetails& details) override; 102 const content::NotificationDetails& details) override;
103 103
104 // ExtensionRegistryObserver implementation. 104 // ExtensionRegistryObserver implementation.
105 virtual void OnExtensionUnloaded( 105 void OnExtensionUnloaded(content::BrowserContext* browser_context,
106 content::BrowserContext* browser_context, 106 const Extension* extension,
107 const Extension* extension, 107 UnloadedExtensionInfo::Reason reason) override;
108 UnloadedExtensionInfo::Reason reason) override;
109 108
110 Operation* GetOperation(const ExtensionId& extension_id); 109 Operation* GetOperation(const ExtensionId& extension_id);
111 void DeleteOperation(const ExtensionId& extension_id); 110 void DeleteOperation(const ExtensionId& extension_id);
112 111
113 friend class BrowserContextKeyedAPIFactory<OperationManager>; 112 friend class BrowserContextKeyedAPIFactory<OperationManager>;
114 typedef std::map<ExtensionId, scoped_refptr<Operation> > OperationMap; 113 typedef std::map<ExtensionId, scoped_refptr<Operation> > OperationMap;
115 114
116 content::BrowserContext* browser_context_; 115 content::BrowserContext* browser_context_;
117 OperationMap operations_; 116 OperationMap operations_;
118 content::NotificationRegistrar registrar_; 117 content::NotificationRegistrar registrar_;
119 118
120 // Listen to extension unloaded notification. 119 // Listen to extension unloaded notification.
121 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 120 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
122 extension_registry_observer_; 121 extension_registry_observer_;
123 122
124 base::WeakPtrFactory<OperationManager> weak_factory_; 123 base::WeakPtrFactory<OperationManager> weak_factory_;
125 124
126 DISALLOW_COPY_AND_ASSIGN(OperationManager); 125 DISALLOW_COPY_AND_ASSIGN(OperationManager);
127 }; 126 };
128 127
129 } // namespace image_writer 128 } // namespace image_writer
130 } // namespace extensions 129 } // namespace extensions
131 130
132 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_ H_ 131 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698