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 <memory> |
8 #include <string> | 9 #include <string> |
| 10 #include <vector> |
9 | 11 |
10 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/scoped_observer.h" | 14 #include "base/scoped_observer.h" |
13 #include "components/sync/device_info/device_info_tracker.h" | 15 #include "components/sync/device_info/device_info_tracker.h" |
14 #include "extensions/browser/browser_context_keyed_api_factory.h" | 16 #include "extensions/browser/browser_context_keyed_api_factory.h" |
15 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
16 #include "extensions/browser/extension_registry_observer.h" | 18 #include "extensions/browser/extension_registry_observer.h" |
17 | 19 |
18 class Profile; | 20 class Profile; |
(...skipping 12 matching lines...) Expand all Loading... |
31 struct EventListenerInfo; | 33 struct EventListenerInfo; |
32 | 34 |
33 // An object of this class is created for each extension that has registered | 35 // 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 | 36 // to be notified for device info change. The objects listen for notification |
35 // from sync on device info change. On receiving the notification the | 37 // from sync on device info change. On receiving the notification the |
36 // new list of devices is constructed and passed back to the extension. | 38 // 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 | 39 // 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 | 40 // public ids for devices(public ids for a device, is not the same for |
39 // all extensions). | 41 // all extensions). |
40 class SignedInDevicesChangeObserver | 42 class SignedInDevicesChangeObserver |
41 : public sync_driver::DeviceInfoTracker::Observer { | 43 : public syncer::DeviceInfoTracker::Observer { |
42 public: | 44 public: |
43 SignedInDevicesChangeObserver(const std::string& extension_id, | 45 SignedInDevicesChangeObserver(const std::string& extension_id, |
44 Profile* profile); | 46 Profile* profile); |
45 virtual ~SignedInDevicesChangeObserver(); | 47 virtual ~SignedInDevicesChangeObserver(); |
46 | 48 |
47 void OnDeviceInfoChange() override; | 49 void OnDeviceInfoChange() override; |
48 | 50 |
49 const std::string& extension_id() { | 51 const std::string& extension_id() { |
50 return extension_id_; | 52 return extension_id_; |
51 } | 53 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 extension_registry_observer_; | 99 extension_registry_observer_; |
98 | 100 |
99 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); | 101 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); |
100 | 102 |
101 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); | 103 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); |
102 }; | 104 }; |
103 | 105 |
104 } // namespace extensions | 106 } // namespace extensions |
105 | 107 |
106 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ | 108 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ |
OLD | NEW |