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 #include "chrome/browser/background/background_application_list_model.h" | 5 #include "chrome/browser/background/background_application_list_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 const Extension* extension) { | 356 const Extension* extension) { |
357 if (!IsBackgroundApp(*extension, profile_)) | 357 if (!IsBackgroundApp(*extension, profile_)) |
358 return; | 358 return; |
359 Update(); | 359 Update(); |
360 DissociateApplicationData(extension); | 360 DissociateApplicationData(extension); |
361 } | 361 } |
362 | 362 |
363 void BackgroundApplicationListModel::OnExtensionPermissionsUpdated( | 363 void BackgroundApplicationListModel::OnExtensionPermissionsUpdated( |
364 const Extension* extension, | 364 const Extension* extension, |
365 UpdatedExtensionPermissionsInfo::Reason reason, | 365 UpdatedExtensionPermissionsInfo::Reason reason, |
366 const PermissionSet* permissions) { | 366 const PermissionSet& permissions) { |
367 if (permissions->HasAPIPermission(APIPermission::kBackground)) { | 367 if (permissions.HasAPIPermission(APIPermission::kBackground)) { |
368 switch (reason) { | 368 switch (reason) { |
369 case UpdatedExtensionPermissionsInfo::ADDED: | 369 case UpdatedExtensionPermissionsInfo::ADDED: |
370 DCHECK(IsBackgroundApp(*extension, profile_)); | 370 DCHECK(IsBackgroundApp(*extension, profile_)); |
371 OnExtensionLoaded(extension); | 371 OnExtensionLoaded(extension); |
372 break; | 372 break; |
373 case UpdatedExtensionPermissionsInfo::REMOVED: | 373 case UpdatedExtensionPermissionsInfo::REMOVED: |
374 DCHECK(!IsBackgroundApp(*extension, profile_)); | 374 DCHECK(!IsBackgroundApp(*extension, profile_)); |
375 Update(); | 375 Update(); |
376 DissociateApplicationData(extension); | 376 DissociateApplicationData(extension); |
377 break; | 377 break; |
(...skipping 26 matching lines...) Expand all Loading... |
404 (*old_cursor)->name() == (*new_cursor)->name() && | 404 (*old_cursor)->name() == (*new_cursor)->name() && |
405 (*old_cursor)->id() == (*new_cursor)->id()) { | 405 (*old_cursor)->id() == (*new_cursor)->id()) { |
406 ++old_cursor; | 406 ++old_cursor; |
407 ++new_cursor; | 407 ++new_cursor; |
408 } | 408 } |
409 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 409 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
410 extensions_ = extensions; | 410 extensions_ = extensions; |
411 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); | 411 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); |
412 } | 412 } |
413 } | 413 } |
OLD | NEW |