OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_LOCATION_LOCATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOCATION_LOCATION_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_LOCATION_LOCATION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_LOCATION_LOCATION_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const content::Geoposition& position, | 71 const content::Geoposition& position, |
72 api::location::Coordinates* coordinates); | 72 api::location::Coordinates* coordinates); |
73 | 73 |
74 // Sends a location update to the extension. | 74 // Sends a location update to the extension. |
75 void SendLocationUpdate(const std::string& extension_id, | 75 void SendLocationUpdate(const std::string& extension_id, |
76 const std::string& request_name, | 76 const std::string& request_name, |
77 const content::Geoposition& position); | 77 const content::Geoposition& position); |
78 | 78 |
79 // ExtensionRegistryObserver implementation. | 79 // ExtensionRegistryObserver implementation. |
80 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 80 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
81 const Extension* extension) OVERRIDE; | 81 const Extension* extension) override; |
82 virtual void OnExtensionUnloaded( | 82 virtual void OnExtensionUnloaded( |
83 content::BrowserContext* browser_context, | 83 content::BrowserContext* browser_context, |
84 const Extension* extension, | 84 const Extension* extension, |
85 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 85 UnloadedExtensionInfo::Reason reason) override; |
86 | 86 |
87 // BrowserContextKeyedAPI implementation. | 87 // BrowserContextKeyedAPI implementation. |
88 static const char* service_name() { return "LocationManager"; } | 88 static const char* service_name() { return "LocationManager"; } |
89 | 89 |
90 content::BrowserContext* const browser_context_; | 90 content::BrowserContext* const browser_context_; |
91 | 91 |
92 // A map of our pending location requests, per extension. | 92 // A map of our pending location requests, per extension. |
93 // Invariant: None of the LocationRequestLists are empty. | 93 // Invariant: None of the LocationRequestLists are empty. |
94 LocationRequestMap location_requests_; | 94 LocationRequestMap location_requests_; |
95 | 95 |
96 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 96 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
97 extension_registry_observer_; | 97 extension_registry_observer_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(LocationManager); | 99 DISALLOW_COPY_AND_ASSIGN(LocationManager); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace extensions | 102 } // namespace extensions |
103 | 103 |
104 #endif // CHROME_BROWSER_EXTENSIONS_API_LOCATION_LOCATION_MANAGER_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_API_LOCATION_LOCATION_MANAGER_H_ |
OLD | NEW |