OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 APPS_SAVED_DEVICES_SERVICE_H_ | 5 #ifndef APPS_SAVED_DEVICES_SERVICE_H_ |
6 #define APPS_SAVED_DEVICES_SERVICE_H_ | 6 #define APPS_SAVED_DEVICES_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 }; | 88 }; |
89 | 89 |
90 explicit SavedDevicesService(Profile* profile); | 90 explicit SavedDevicesService(Profile* profile); |
91 virtual ~SavedDevicesService(); | 91 virtual ~SavedDevicesService(); |
92 | 92 |
93 static SavedDevicesService* Get(Profile* profile); | 93 static SavedDevicesService* Get(Profile* profile); |
94 | 94 |
95 // Returns the SavedDevices for |extension_id|, creating it if necessary. | 95 // Returns the SavedDevices for |extension_id|, creating it if necessary. |
96 SavedDevices* GetOrInsert(const std::string& extension_id); | 96 SavedDevices* GetOrInsert(const std::string& extension_id); |
97 | 97 |
98 std::vector<SavedDeviceEntry> GetAllDevices( | 98 std::vector<base::string16> GetPermissionMessageStrings( |
99 const std::string& extension_id) const; | 99 const std::string& extension_id) const; |
100 | 100 |
101 // Clears the SavedDevices for |extension_id|. | 101 // Clears the SavedDevices for |extension_id|. |
102 void Clear(const std::string& extension_id); | 102 void Clear(const std::string& extension_id); |
103 | 103 |
104 private: | 104 private: |
105 // content::NotificationObserver. | 105 // content::NotificationObserver. |
106 virtual void Observe(int type, | 106 virtual void Observe(int type, |
107 const content::NotificationSource& source, | 107 const content::NotificationSource& source, |
108 const content::NotificationDetails& details) OVERRIDE; | 108 const content::NotificationDetails& details) OVERRIDE; |
109 | 109 |
110 // Returns the SavedDevices for |extension_id| or NULL if one does not exist. | 110 // Returns the SavedDevices for |extension_id| or NULL if one does not exist. |
111 SavedDevices* Get(const std::string& extension_id) const; | 111 SavedDevices* Get(const std::string& extension_id) const; |
112 | 112 |
113 std::map<std::string, SavedDevices*> extension_id_to_saved_devices_; | 113 std::map<std::string, SavedDevices*> extension_id_to_saved_devices_; |
114 Profile* profile_; | 114 Profile* profile_; |
115 content::NotificationRegistrar registrar_; | 115 content::NotificationRegistrar registrar_; |
116 base::ThreadChecker thread_checker_; | 116 base::ThreadChecker thread_checker_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(SavedDevicesService); | 118 DISALLOW_COPY_AND_ASSIGN(SavedDevicesService); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace apps | 121 } // namespace apps |
122 | 122 |
123 #endif // APPS_SAVED_DEVICES_SERVICE_H_ | 123 #endif // APPS_SAVED_DEVICES_SERVICE_H_ |
OLD | NEW |