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 #include "chrome/browser/extensions/error_console/error_console.h" | 5 #include "chrome/browser/extensions/error_console/error_console.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 notification_registrar_.Add( | 193 notification_registrar_.Add( |
194 this, | 194 this, |
195 chrome::NOTIFICATION_PROFILE_DESTROYED, | 195 chrome::NOTIFICATION_PROFILE_DESTROYED, |
196 content::NotificationService::AllBrowserContextsAndSources()); | 196 content::NotificationService::AllBrowserContextsAndSources()); |
197 notification_registrar_.Add( | 197 notification_registrar_.Add( |
198 this, | 198 this, |
199 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 199 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
200 content::Source<Profile>(profile_)); | 200 content::Source<Profile>(profile_)); |
201 notification_registrar_.Add( | 201 notification_registrar_.Add( |
202 this, | 202 this, |
203 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 203 chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED, |
204 content::Source<Profile>(profile_)); | 204 content::Source<Profile>(profile_)); |
205 | 205 |
206 const ExtensionSet& extensions = | 206 const ExtensionSet& extensions = |
207 ExtensionRegistry::Get(profile_)->enabled_extensions(); | 207 ExtensionRegistry::Get(profile_)->enabled_extensions(); |
208 for (ExtensionSet::const_iterator iter = extensions.begin(); | 208 for (ExtensionSet::const_iterator iter = extensions.begin(); |
209 iter != extensions.end(); | 209 iter != extensions.end(); |
210 ++iter) { | 210 ++iter) { |
211 AddManifestErrorsForExtension(iter->get()); | 211 AddManifestErrorsForExtension(iter->get()); |
212 } | 212 } |
213 } | 213 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // destroy all incognito errors. | 256 // destroy all incognito errors. |
257 if (profile->IsOffTheRecord() && profile_->IsSameProfile(profile)) | 257 if (profile->IsOffTheRecord() && profile_->IsSameProfile(profile)) |
258 errors_.RemoveIncognitoErrors(); | 258 errors_.RemoveIncognitoErrors(); |
259 break; | 259 break; |
260 } | 260 } |
261 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 261 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
262 // No need to check the profile here, since we registered to only receive | 262 // No need to check the profile here, since we registered to only receive |
263 // notifications from our own. | 263 // notifications from our own. |
264 errors_.Remove(content::Details<Extension>(details).ptr()->id()); | 264 errors_.Remove(content::Details<Extension>(details).ptr()->id()); |
265 break; | 265 break; |
266 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { | 266 case chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED: { |
267 const InstalledExtensionInfo* info = | 267 const InstalledExtensionInfo* info = |
268 content::Details<InstalledExtensionInfo>(details).ptr(); | 268 content::Details<InstalledExtensionInfo>(details).ptr(); |
269 | 269 |
270 // We don't want to have manifest errors from previous installs. We want | 270 // We don't want to have manifest errors from previous installs. We want |
271 // to keep runtime errors, though, because extensions are reloaded on a | 271 // to keep runtime errors, though, because extensions are reloaded on a |
272 // refresh of chrome:extensions, and we don't want to wipe our history | 272 // refresh of chrome:extensions, and we don't want to wipe our history |
273 // whenever that happens. | 273 // whenever that happens. |
274 errors_.RemoveErrorsForExtensionOfType(info->extension->id(), | 274 errors_.RemoveErrorsForExtensionOfType(info->extension->id(), |
275 ExtensionError::MANIFEST_ERROR); | 275 ExtensionError::MANIFEST_ERROR); |
276 | 276 |
(...skipping 16 matching lines...) Expand all Loading... |
293 ExtensionRegistry::Get(profile_)->GetExtensionById( | 293 ExtensionRegistry::Get(profile_)->GetExtensionById( |
294 extension_id, ExtensionRegistry::EVERYTHING); | 294 extension_id, ExtensionRegistry::EVERYTHING); |
295 if (extension && extension->location() == Manifest::UNPACKED) | 295 if (extension && extension->location() == Manifest::UNPACKED) |
296 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; | 296 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; |
297 | 297 |
298 // Otherwise, use the default mask. | 298 // Otherwise, use the default mask. |
299 return default_mask_; | 299 return default_mask_; |
300 } | 300 } |
301 | 301 |
302 } // namespace extensions | 302 } // namespace extensions |
OLD | NEW |