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 "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 12 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
13 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 13 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
14 #include "extensions/browser/event_router.h" | 14 #include "extensions/browser/event_router.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
| 17 |
17 namespace content { | 18 namespace content { |
18 class NotificationDetails; | 19 class BrowserContext; |
19 class NotificationObserver; | 20 class NotificationDetails; |
20 class NotificationRegistrar; | 21 class NotificationObserver; |
| 22 class NotificationRegistrar; |
21 } // namespace content | 23 } // namespace content |
22 | 24 |
23 namespace extensions { | 25 namespace extensions { |
24 class ProfileKeyedAPI; | 26 class ProfileKeyedAPI; |
25 | 27 |
26 struct EventListenerInfo; | 28 struct EventListenerInfo; |
27 | 29 |
28 // An object of this class is created for each extension that has registered | 30 // An object of this class is created for each extension that has registered |
29 // to be notified for device info change. The objects listen for notification | 31 // to be notified for device info change. The objects listen for notification |
30 // from sync on device info change. On receiving the notification the | 32 // from sync on device info change. On receiving the notification the |
(...skipping 20 matching lines...) Expand all Loading... |
51 content::NotificationRegistrar registrar_; | 53 content::NotificationRegistrar registrar_; |
52 }; | 54 }; |
53 | 55 |
54 class SignedInDevicesManager | 56 class SignedInDevicesManager |
55 : public ProfileKeyedAPI, | 57 : public ProfileKeyedAPI, |
56 public content::NotificationObserver, | 58 public content::NotificationObserver, |
57 public EventRouter::Observer { | 59 public EventRouter::Observer { |
58 public: | 60 public: |
59 // Default constructor used for testing. | 61 // Default constructor used for testing. |
60 SignedInDevicesManager(); | 62 SignedInDevicesManager(); |
61 explicit SignedInDevicesManager(Profile* profile); | 63 explicit SignedInDevicesManager(content::BrowserContext* context); |
62 virtual ~SignedInDevicesManager(); | 64 virtual ~SignedInDevicesManager(); |
63 | 65 |
64 // ProfileKeyedAPI implementation. | 66 // ProfileKeyedAPI implementation. |
65 static ProfileKeyedAPIFactory<SignedInDevicesManager>* GetFactoryInstance(); | 67 static ProfileKeyedAPIFactory<SignedInDevicesManager>* GetFactoryInstance(); |
66 | 68 |
67 // NotificationObserver: | 69 // NotificationObserver: |
68 virtual void Observe(int type, | 70 virtual void Observe(int type, |
69 const content::NotificationSource& source, | 71 const content::NotificationSource& source, |
70 const content::NotificationDetails& details) OVERRIDE; | 72 const content::NotificationDetails& details) OVERRIDE; |
71 | 73 |
(...skipping 17 matching lines...) Expand all Loading... |
89 ScopedVector<SignedInDevicesChangeObserver> change_observers_; | 91 ScopedVector<SignedInDevicesChangeObserver> change_observers_; |
90 | 92 |
91 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); | 93 FRIEND_TEST_ALL_PREFIXES(SignedInDevicesManager, UpdateListener); |
92 | 94 |
93 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); | 95 DISALLOW_COPY_AND_ASSIGN(SignedInDevicesManager); |
94 }; | 96 }; |
95 | 97 |
96 } // namespace extensions | 98 } // namespace extensions |
97 | 99 |
98 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ | 100 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_MAN
AGER_H__ |
99 | |
OLD | NEW |