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

Side by Side Diff: chrome/renderer/content_settings_observer.cc

Issue 290573010: Clean up in browser side of allowFileSystem. [chromium] (4/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asyn_codereview
Patch Set: rebase Created 6 years, 7 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/renderer/content_settings_observer.h" 5 #include "chrome/renderer/content_settings_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return false; 259 return false;
260 260
261 bool result = false; 261 bool result = false;
262 Send(new ChromeViewHostMsg_AllowDatabase( 262 Send(new ChromeViewHostMsg_AllowDatabase(
263 routing_id(), GURL(frame->document().securityOrigin().toString()), 263 routing_id(), GURL(frame->document().securityOrigin().toString()),
264 GURL(frame->top()->document().securityOrigin().toString()), 264 GURL(frame->top()->document().securityOrigin().toString()),
265 name, display_name, &result)); 265 name, display_name, &result));
266 return result; 266 return result;
267 } 267 }
268 268
269 bool ContentSettingsObserver::allowFileSystem() {
270 WebFrame* frame = render_frame()->GetWebFrame();
271 if (frame->document().securityOrigin().isUnique() ||
272 frame->top()->document().securityOrigin().isUnique())
273 return false;
274
275 bool result = false;
276 Send(new ChromeViewHostMsg_RequestFileSystemAccessSync(
277 routing_id(), GURL(frame->document().securityOrigin().toString()),
278 GURL(frame->top()->document().securityOrigin().toString()), &result));
279 return result;
280 }
281
282 void ContentSettingsObserver::requestFileSystemAccessAsync( 269 void ContentSettingsObserver::requestFileSystemAccessAsync(
283 const WebPermissionCallbacks& callbacks) { 270 const WebPermissionCallbacks& callbacks) {
284 WebFrame* frame = render_frame()->GetWebFrame(); 271 WebFrame* frame = render_frame()->GetWebFrame();
285 if (frame->document().securityOrigin().isUnique() || 272 if (frame->document().securityOrigin().isUnique() ||
286 frame->top()->document().securityOrigin().isUnique()) { 273 frame->top()->document().securityOrigin().isUnique()) {
287 WebPermissionCallbacks permissionCallbacks(callbacks); 274 WebPermissionCallbacks permissionCallbacks(callbacks);
288 permissionCallbacks.doDeny(); 275 permissionCallbacks.doDeny();
289 return; 276 return;
290 } 277 }
291 ++current_request_id_; 278 ++current_request_id_;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 697
711 // If the scheme is file:, an empty file name indicates a directory listing, 698 // If the scheme is file:, an empty file name indicates a directory listing,
712 // which requires JavaScript to function properly. 699 // which requires JavaScript to function properly.
713 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { 700 if (EqualsASCII(origin.protocol(), content::kFileScheme)) {
714 return document_url.SchemeIs(content::kFileScheme) && 701 return document_url.SchemeIs(content::kFileScheme) &&
715 document_url.ExtractFileName().empty(); 702 document_url.ExtractFileName().empty();
716 } 703 }
717 704
718 return false; 705 return false;
719 } 706 }
OLDNEW
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | chrome/renderer/worker_permission_client_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698