Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/background/background_application_list_model_unittest.cc

Issue 10675007: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase again Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // TODO(rickcam): Bug 73183: Add unit tests for image loading 5 // TODO(rickcam): Bug 73183: Add unit tests for image loading
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <set> 8 #include <set>
9 9
10 #include "chrome/browser/background/background_application_list_model.h" 10 #include "chrome/browser/background/background_application_list_model.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 void AddBackgroundPermission(ExtensionService* service, 92 void AddBackgroundPermission(ExtensionService* service,
93 Extension* extension) { 93 Extension* extension) {
94 if (BackgroundApplicationListModel::IsBackgroundApp(*extension, 94 if (BackgroundApplicationListModel::IsBackgroundApp(*extension,
95 service->profile())) { 95 service->profile())) {
96 return; 96 return;
97 } 97 }
98 98
99 static scoped_refptr<Extension> temporary = 99 static scoped_refptr<Extension> temporary =
100 CreateExtension(GenerateUniqueExtensionName(), true); 100 CreateExtension(GenerateUniqueExtensionName(), true);
101 scoped_refptr<const ExtensionPermissionSet> permissions = 101 scoped_refptr<const extensions::PermissionSet> permissions =
102 temporary->GetActivePermissions(); 102 temporary->GetActivePermissions();
103 extensions::PermissionsUpdater(service->profile()).AddPermissions( 103 extensions::PermissionsUpdater(service->profile()).AddPermissions(
104 extension, permissions.get()); 104 extension, permissions.get());
105 } 105 }
106 106
107 void RemoveBackgroundPermission(ExtensionService* service, 107 void RemoveBackgroundPermission(ExtensionService* service,
108 Extension* extension) { 108 Extension* extension) {
109 if (!BackgroundApplicationListModel::IsBackgroundApp(*extension, 109 if (!BackgroundApplicationListModel::IsBackgroundApp(*extension,
110 service->profile())) { 110 service->profile())) {
111 return; 111 return;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 break; 352 break;
353 case 2: 353 case 2:
354 TogglePermission(service, &extensions, model.get(), &expected, &count); 354 TogglePermission(service, &extensions, model.get(), &expected, &count);
355 break; 355 break;
356 default: 356 default:
357 NOTREACHED(); 357 NOTREACHED();
358 break; 358 break;
359 } 359 }
360 } 360 }
361 } 361 }
OLDNEW
« no previous file with comments | « chrome/browser/background/background_application_list_model.cc ('k') | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698