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

Side by Side Diff: chrome/browser/extensions/extension_special_storage_policy.cc

Issue 1030133002: Move the check for fileBrowserHandler permission to FileBrowserHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test for OS != OS_CHROMEOS. Created 5 years, 9 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 #include "chrome/browser/extensions/extension_special_storage_policy.h" 5 #include "chrome/browser/extensions/extension_special_storage_policy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return true; 122 return true;
123 ContentSettingsForOneType entries; 123 ContentSettingsForOneType entries;
124 cookie_settings_->GetCookieSettings(&entries); 124 cookie_settings_->GetCookieSettings(&entries);
125 for (size_t i = 0; i < entries.size(); ++i) { 125 for (size_t i = 0; i < entries.size(); ++i) {
126 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY) 126 if (entries[i].setting == CONTENT_SETTING_SESSION_ONLY)
127 return true; 127 return true;
128 } 128 }
129 return false; 129 return false;
130 } 130 }
131 131
132 bool ExtensionSpecialStoragePolicy::IsFileHandler(
133 const std::string& extension_id) {
134 base::AutoLock locker(lock_);
135 return file_handler_extensions_.ContainsExtension(extension_id);
136 }
137
138 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { 132 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
139 base::AutoLock locker(lock_); 133 base::AutoLock locker(lock_);
140 return isolated_extensions_.Contains(origin); 134 return isolated_extensions_.Contains(origin);
141 } 135 }
142 136
143 bool ExtensionSpecialStoragePolicy::NeedsProtection( 137 bool ExtensionSpecialStoragePolicy::NeedsProtection(
144 const extensions::Extension* extension) { 138 const extensions::Extension* extension) {
145 return extension->is_hosted_app() && !extension->from_bookmark(); 139 return extension->is_hosted_app() && !extension->from_bookmark();
146 } 140 }
147 141
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 349 }
356 350
357 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { 351 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() {
358 ClearCache(); 352 ClearCache();
359 extensions_.Clear(); 353 extensions_.Clear();
360 } 354 }
361 355
362 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { 356 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() {
363 STLDeleteValues(&cached_results_); 357 STLDeleteValues(&cached_results_);
364 } 358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698