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