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 EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 ~IdleManager() override; | 76 ~IdleManager() override; |
77 | 77 |
78 void Init(); | 78 void Init(); |
79 | 79 |
80 // KeyedService implementation. | 80 // KeyedService implementation. |
81 void Shutdown() override; | 81 void Shutdown() override; |
82 | 82 |
83 // ExtensionRegistryObserver implementation. | 83 // ExtensionRegistryObserver implementation. |
84 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 84 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
85 const Extension* extension, | 85 const Extension* extension, |
86 UnloadedExtensionInfo::Reason reason) override; | 86 UnloadedExtensionReason reason) override; |
87 | 87 |
88 // EventRouter::Observer implementation. | 88 // EventRouter::Observer implementation. |
89 void OnListenerAdded(const EventListenerInfo& details) override; | 89 void OnListenerAdded(const EventListenerInfo& details) override; |
90 void OnListenerRemoved(const EventListenerInfo& details) override; | 90 void OnListenerRemoved(const EventListenerInfo& details) override; |
91 | 91 |
92 void QueryState(int threshold, const QueryStateCallback& notify); | 92 void QueryState(int threshold, const QueryStateCallback& notify); |
93 void SetThreshold(const std::string& extension_id, int threshold); | 93 void SetThreshold(const std::string& extension_id, int threshold); |
94 static std::unique_ptr<base::Value> CreateIdleValue(ui::IdleState idle_state); | 94 static std::unique_ptr<base::Value> CreateIdleValue(ui::IdleState idle_state); |
95 | 95 |
96 // Override default event class. Callee assumes ownership. Used for testing. | 96 // Override default event class. Callee assumes ownership. Used for testing. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 extension_registry_observer_; | 141 extension_registry_observer_; |
142 | 142 |
143 base::WeakPtrFactory<IdleManager> weak_factory_; | 143 base::WeakPtrFactory<IdleManager> weak_factory_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(IdleManager); | 145 DISALLOW_COPY_AND_ASSIGN(IdleManager); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace extensions | 148 } // namespace extensions |
149 | 149 |
150 #endif // EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ | 150 #endif // EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ |
OLD | NEW |