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

Side by Side Diff: apps/saved_files_service.cc

Issue 314113010: Remove deprecated permissions functions from Extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « apps/app_window.cc ('k') | chrome/browser/background/background_application_list_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "apps/saved_files_service.h" 5 #include "apps/saved_files_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "apps/saved_files_service_factory.h" 9 #include "apps/saved_files_service_factory.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
12 #include "base/value_conversions.h" 12 #include "base/value_conversions.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "content/public/browser/notification_service.h" 15 #include "content/public/browser/notification_service.h"
16 #include "extensions/browser/extension_host.h" 16 #include "extensions/browser/extension_host.h"
17 #include "extensions/browser/extension_prefs.h" 17 #include "extensions/browser/extension_prefs.h"
18 #include "extensions/browser/extension_system.h" 18 #include "extensions/browser/extension_system.h"
19 #include "extensions/browser/extension_util.h" 19 #include "extensions/browser/extension_util.h"
20 #include "extensions/common/permissions/api_permission.h" 20 #include "extensions/common/permissions/api_permission.h"
21 #include "extensions/common/permissions/permission_set.h" 21 #include "extensions/common/permissions/permission_set.h"
22 #include "extensions/common/permissions/permissions_data.h"
22 23
23 namespace apps { 24 namespace apps {
24 25
25 using extensions::APIPermission; 26 using extensions::APIPermission;
26 using extensions::Extension; 27 using extensions::Extension;
27 using extensions::ExtensionHost; 28 using extensions::ExtensionHost;
28 using extensions::ExtensionPrefs; 29 using extensions::ExtensionPrefs;
29 30
30 namespace { 31 namespace {
31 32
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 256
256 const SavedFileEntry* SavedFilesService::GetFileEntry( 257 const SavedFileEntry* SavedFilesService::GetFileEntry(
257 const std::string& extension_id, 258 const std::string& extension_id,
258 const std::string& id) { 259 const std::string& id) {
259 return GetOrInsert(extension_id)->GetFileEntry(id); 260 return GetOrInsert(extension_id)->GetFileEntry(id);
260 } 261 }
261 262
262 void SavedFilesService::ClearQueueIfNoRetainPermission( 263 void SavedFilesService::ClearQueueIfNoRetainPermission(
263 const Extension* extension) { 264 const Extension* extension) {
264 if (extensions::util::IsEphemeralApp(extension->id(), profile_) || 265 if (extensions::util::IsEphemeralApp(extension->id(), profile_) ||
265 !extension->GetActivePermissions()->HasAPIPermission( 266 !extension->permissions_data()->active_permissions()->HasAPIPermission(
266 APIPermission::kFileSystemRetainEntries)) { 267 APIPermission::kFileSystemRetainEntries)) {
267 ClearQueue(extension); 268 ClearQueue(extension);
268 } 269 }
269 } 270 }
270 271
271 void SavedFilesService::ClearQueue(const extensions::Extension* extension) { 272 void SavedFilesService::ClearQueue(const extensions::Extension* extension) {
272 ClearSavedFileEntries(ExtensionPrefs::Get(profile_), extension->id()); 273 ClearSavedFileEntries(ExtensionPrefs::Get(profile_), extension->id());
273 Clear(extension->id()); 274 Clear(extension->id());
274 } 275 }
275 276
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 void SavedFilesService::SetLruSizeForTest(int size) { 452 void SavedFilesService::SetLruSizeForTest(int size) {
452 g_max_saved_file_entries = size; 453 g_max_saved_file_entries = size;
453 } 454 }
454 455
455 // static 456 // static
456 void SavedFilesService::ClearLruSizeForTest() { 457 void SavedFilesService::ClearLruSizeForTest() {
457 g_max_saved_file_entries = kMaxSavedFileEntries; 458 g_max_saved_file_entries = kMaxSavedFileEntries;
458 } 459 }
459 460
460 } // namespace apps 461 } // namespace apps
OLDNEW
« no previous file with comments | « apps/app_window.cc ('k') | chrome/browser/background/background_application_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698