OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSION_ACTION_STORAGE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_STORAGE_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_STORAGE_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_STORAGE_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public ExtensionRegistryObserver { | 27 public ExtensionRegistryObserver { |
28 public: | 28 public: |
29 explicit ExtensionActionStorageManager(content::BrowserContext* context); | 29 explicit ExtensionActionStorageManager(content::BrowserContext* context); |
30 virtual ~ExtensionActionStorageManager(); | 30 virtual ~ExtensionActionStorageManager(); |
31 | 31 |
32 private: | 32 private: |
33 // ExtensionActionAPI::Observer: | 33 // ExtensionActionAPI::Observer: |
34 virtual void OnExtensionActionUpdated( | 34 virtual void OnExtensionActionUpdated( |
35 ExtensionAction* extension_action, | 35 ExtensionAction* extension_action, |
36 content::WebContents* web_contents, | 36 content::WebContents* web_contents, |
37 content::BrowserContext* browser_context) OVERRIDE; | 37 content::BrowserContext* browser_context) override; |
38 virtual void OnExtensionActionAPIShuttingDown() OVERRIDE; | 38 virtual void OnExtensionActionAPIShuttingDown() override; |
39 | 39 |
40 // ExtensionRegistryObserver: | 40 // ExtensionRegistryObserver: |
41 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 41 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
42 const Extension* extension) OVERRIDE; | 42 const Extension* extension) override; |
43 | 43 |
44 // Reads/Writes the ExtensionAction's default values to/from storage. | 44 // Reads/Writes the ExtensionAction's default values to/from storage. |
45 void WriteToStorage(ExtensionAction* extension_action); | 45 void WriteToStorage(ExtensionAction* extension_action); |
46 void ReadFromStorage( | 46 void ReadFromStorage( |
47 const std::string& extension_id, scoped_ptr<base::Value> value); | 47 const std::string& extension_id, scoped_ptr<base::Value> value); |
48 | 48 |
49 // Returns the Extensions StateStore for the |browser_context_|. | 49 // Returns the Extensions StateStore for the |browser_context_|. |
50 // May return NULL. | 50 // May return NULL. |
51 StateStore* GetStateStore(); | 51 StateStore* GetStateStore(); |
52 | 52 |
53 content::BrowserContext* browser_context_; | 53 content::BrowserContext* browser_context_; |
54 | 54 |
55 ScopedObserver<ExtensionActionAPI, ExtensionActionAPI::Observer> | 55 ScopedObserver<ExtensionActionAPI, ExtensionActionAPI::Observer> |
56 extension_action_observer_; | 56 extension_action_observer_; |
57 | 57 |
58 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 58 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
59 extension_registry_observer_; | 59 extension_registry_observer_; |
60 | 60 |
61 base::WeakPtrFactory<ExtensionActionStorageManager> weak_factory_; | 61 base::WeakPtrFactory<ExtensionActionStorageManager> weak_factory_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(ExtensionActionStorageManager); | 63 DISALLOW_COPY_AND_ASSIGN(ExtensionActionStorageManager); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace extensions | 66 } // namespace extensions |
67 | 67 |
68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_STORAGE_MANAGER_H_ | 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_STORAGE_MANAGER_H_ |
OLD | NEW |