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_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MANAGE
R_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MANAGE
R_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MANAGE
R_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MANAGE
R_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
13 #include "chrome/browser/sync/glue/device_info_tracker.h" | 13 #include "components/sync_driver/device_info_tracker.h" |
14 #include "extensions/browser/browser_context_keyed_api_factory.h" | 14 #include "extensions/browser/browser_context_keyed_api_factory.h" |
15 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
16 #include "extensions/browser/extension_registry_observer.h" | 16 #include "extensions/browser/extension_registry_observer.h" |
17 | 17 |
18 class Profile; | 18 class Profile; |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class BrowserContext; | 21 class BrowserContext; |
22 class NotificationDetails; | 22 class NotificationDetails; |
23 class NotificationObserver; | 23 class NotificationObserver; |
24 class NotificationRegistrar; | 24 class NotificationRegistrar; |
25 } // namespace content | 25 } // namespace content |
26 | 26 |
27 namespace extensions { | 27 namespace extensions { |
28 class BrowserContextKeyedAPI; | 28 class BrowserContextKeyedAPI; |
29 class ExtensionRegistry; | 29 class ExtensionRegistry; |
30 | 30 |
31 struct EventListenerInfo; | 31 struct EventListenerInfo; |
32 | 32 |
33 // An object of this class is created for each extension that has registered | 33 // An object of this class is created for each extension that has registered |
34 // to be notified for device info change. The objects listen for notification | 34 // to be notified for device info change. The objects listen for notification |
35 // from sync on device info change. On receiving the notification the | 35 // from sync on device info change. On receiving the notification the |
36 // new list of devices is constructed and passed back to the extension. | 36 // new list of devices is constructed and passed back to the extension. |
37 // The extension id is part of this object as it is needed to fill in the | 37 // The extension id is part of this object as it is needed to fill in the |
38 // public ids for devices(public ids for a device, is not the same for | 38 // public ids for devices(public ids for a device, is not the same for |
39 // all extensions). | 39 // all extensions). |
40 class SignedInDevicesChangeObserver | 40 class SignedInDevicesChangeObserver |
41 : public browser_sync::DeviceInfoTracker::Observer { | 41 : public sync_driver::DeviceInfoTracker::Observer { |
42 public: | 42 public: |
43 SignedInDevicesChangeObserver(const std::string& extension_id, | 43 SignedInDevicesChangeObserver(const std::string& extension_id, |
44 Profile* profile); | 44 Profile* profile); |
45 virtual ~SignedInDevicesChangeObserver(); | 45 virtual ~SignedInDevicesChangeObserver(); |
46 | 46 |
47 virtual void OnDeviceInfoChange() OVERRIDE; | 47 virtual void OnDeviceInfoChange() OVERRIDE; |
48 | 48 |
49 const std::string& extension_id() { | 49 const std::string& extension_id() { |
50 return extension_id_; | 50 return extension_id_; |
51 } | 51 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 extension_registry_observer_; | 98 extension_registry_observer_; |
99 | 99 |
100 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); | 100 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); | 102 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace extensions | 105 } // namespace extensions |
106 | 106 |
107 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ | 107 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ |
OLD | NEW |