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

Side by Side Diff: trunk/src/chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 22825010: Revert 217247 "Whitelist TimeScapes to access restricted native ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | 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 "chrome/browser/chromeos/fileapi/file_system_backend.h" 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return true; 135 return true;
136 136
137 // No extra check is needed for isolated file systems. 137 // No extra check is needed for isolated file systems.
138 if (url.mount_type() == fileapi::kFileSystemTypeIsolated) 138 if (url.mount_type() == fileapi::kFileSystemTypeIsolated)
139 return true; 139 return true;
140 140
141 if (!CanHandleURL(url)) 141 if (!CanHandleURL(url))
142 return false; 142 return false;
143 143
144 std::string extension_id = origin_url.host(); 144 std::string extension_id = origin_url.host();
145 // TODO(mtomasz): Temporarily whitelist TimeScapes. Remove this in M-31.
146 // See: crbug.com/271946
147 if (extension_id == "mppoamgbcpnkpacolchbacppkflagjbp" &&
148 url.mount_type() == fileapi::kFileSystemTypeRestrictedNativeLocal) {
149 return true;
150 }
151
152 // Check first to make sure this extension has fileBrowserHander permissions. 145 // Check first to make sure this extension has fileBrowserHander permissions.
153 if (!special_storage_policy_->IsFileHandler(extension_id)) 146 if (!special_storage_policy_->IsFileHandler(extension_id))
154 return false; 147 return false;
155 148
156 return file_access_permissions_->HasAccessPermission(extension_id, 149 return file_access_permissions_->HasAccessPermission(extension_id,
157 url.virtual_path()); 150 url.virtual_path());
158 } 151 }
159 152
160 void FileSystemBackend::GrantFullAccessToExtension( 153 void FileSystemBackend::GrantFullAccessToExtension(
161 const std::string& extension_id) { 154 const std::string& extension_id) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 std::string mount_name = url.filesystem_id(); 313 std::string mount_name = url.filesystem_id();
321 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) && 314 if (!mount_points_->GetRegisteredPath(mount_name, &root_path) &&
322 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) { 315 !system_mount_points_->GetRegisteredPath(mount_name, &root_path)) {
323 return base::FilePath(); 316 return base::FilePath();
324 } 317 }
325 318
326 return root_path.DirName(); 319 return root_path.DirName();
327 } 320 }
328 321
329 } // namespace chromeos 322 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698