OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ |
6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ | 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 // Invoked by Observe for NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED. | 138 // Invoked by Observe for NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED. |
139 void OnExtensionPermissionsUpdated( | 139 void OnExtensionPermissionsUpdated( |
140 const extensions::Extension* extension, | 140 const extensions::Extension* extension, |
141 extensions::UpdatedExtensionPermissionsInfo::Reason reason, | 141 extensions::UpdatedExtensionPermissionsInfo::Reason reason, |
142 const extensions::PermissionSet* permissions); | 142 const extensions::PermissionSet* permissions); |
143 | 143 |
144 // Refresh the list of background applications and generate notifications. | 144 // Refresh the list of background applications and generate notifications. |
145 void Update(); | 145 void Update(); |
146 | 146 |
147 // Determines if the given extension has to be considered a "background app" | |
148 // due to its use of PushMessaging. Normally every extension that expectes | |
149 // push messages is classified as "background app", however there are some | |
150 // rare exceptions, so this function implements a whitelist. | |
151 static bool RequiresBackgroundModeForPushMessaging( | |
152 const extensions::Extension& extension); | |
153 | |
154 ApplicationMap applications_; | 147 ApplicationMap applications_; |
155 extensions::ExtensionList extensions_; | 148 extensions::ExtensionList extensions_; |
156 ObserverList<Observer, true> observers_; | 149 ObserverList<Observer, true> observers_; |
157 Profile* profile_; | 150 Profile* profile_; |
158 content::NotificationRegistrar registrar_; | 151 content::NotificationRegistrar registrar_; |
159 bool ready_; | 152 bool ready_; |
160 | 153 |
161 DISALLOW_COPY_AND_ASSIGN(BackgroundApplicationListModel); | 154 DISALLOW_COPY_AND_ASSIGN(BackgroundApplicationListModel); |
162 }; | 155 }; |
163 | 156 |
164 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ | 157 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_APPLICATION_LIST_MODEL_H_ |
OLD | NEW |