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

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 3431032: Change ChildProcessSecurityPolicy to store a list of allowed flags for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 WebDragOperationsMask operations_allowed) { 456 WebDragOperationsMask operations_allowed) {
457 // Grant the renderer the ability to load the drop_data. 457 // Grant the renderer the ability to load the drop_data.
458 ChildProcessSecurityPolicy* policy = 458 ChildProcessSecurityPolicy* policy =
459 ChildProcessSecurityPolicy::GetInstance(); 459 ChildProcessSecurityPolicy::GetInstance();
460 policy->GrantRequestURL(process()->id(), drop_data.url); 460 policy->GrantRequestURL(process()->id(), drop_data.url);
461 for (std::vector<string16>::const_iterator iter(drop_data.filenames.begin()); 461 for (std::vector<string16>::const_iterator iter(drop_data.filenames.begin());
462 iter != drop_data.filenames.end(); ++iter) { 462 iter != drop_data.filenames.end(); ++iter) {
463 FilePath path = FilePath::FromWStringHack(UTF16ToWideHack(*iter)); 463 FilePath path = FilePath::FromWStringHack(UTF16ToWideHack(*iter));
464 policy->GrantRequestURL(process()->id(), 464 policy->GrantRequestURL(process()->id(),
465 net::FilePathToFileURL(path)); 465 net::FilePathToFileURL(path));
466 policy->GrantUploadFile(process()->id(), path); 466 policy->GrantReadFile(process()->id(), path);
467 } 467 }
468 Send(new ViewMsg_DragTargetDragEnter(routing_id(), drop_data, client_pt, 468 Send(new ViewMsg_DragTargetDragEnter(routing_id(), drop_data, client_pt,
469 screen_pt, operations_allowed)); 469 screen_pt, operations_allowed));
470 } 470 }
471 471
472 void RenderViewHost::DragTargetDragOver( 472 void RenderViewHost::DragTargetDragOver(
473 const gfx::Point& client_pt, const gfx::Point& screen_pt, 473 const gfx::Point& client_pt, const gfx::Point& screen_pt,
474 WebDragOperationsMask operations_allowed) { 474 WebDragOperationsMask operations_allowed) {
475 Send(new ViewMsg_DragTargetDragOver(routing_id(), client_pt, screen_pt, 475 Send(new ViewMsg_DragTargetDragOver(routing_id(), client_pt, screen_pt,
476 operations_allowed)); 476 operations_allowed));
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 668
669 void RenderViewHost::LoadBlockedPlugins() { 669 void RenderViewHost::LoadBlockedPlugins() {
670 Send(new ViewMsg_LoadBlockedPlugins(routing_id())); 670 Send(new ViewMsg_LoadBlockedPlugins(routing_id()));
671 } 671 }
672 672
673 void RenderViewHost::FilesSelectedInChooser( 673 void RenderViewHost::FilesSelectedInChooser(
674 const std::vector<FilePath>& files) { 674 const std::vector<FilePath>& files) {
675 // Grant the security access requested to the given files. 675 // Grant the security access requested to the given files.
676 for (std::vector<FilePath>::const_iterator file = files.begin(); 676 for (std::vector<FilePath>::const_iterator file = files.begin();
677 file != files.end(); ++file) { 677 file != files.end(); ++file) {
678 ChildProcessSecurityPolicy::GetInstance()->GrantUploadFile( 678 ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
679 process()->id(), *file); 679 process()->id(), *file);
680 } 680 }
681 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files)); 681 Send(new ViewMsg_RunFileChooserResponse(routing_id(), files));
682 } 682 }
683 683
684 void RenderViewHost::LoadStateChanged(const GURL& url, 684 void RenderViewHost::LoadStateChanged(const GURL& url,
685 net::LoadState load_state, 685 net::LoadState load_state,
686 uint64 upload_position, 686 uint64 upload_position,
687 uint64 upload_size) { 687 uint64 upload_size) {
688 delegate_->LoadStateChanged(url, load_state, upload_position, upload_size); 688 delegate_->LoadStateChanged(url, load_state, upload_position, upload_size);
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 } 2051 }
2052 2052
2053 void RenderViewHost::OnSetSuggestResult(int32 page_id, 2053 void RenderViewHost::OnSetSuggestResult(int32 page_id,
2054 const std::string& result) { 2054 const std::string& result) {
2055 RenderViewHostDelegate::BrowserIntegration* integration_delegate = 2055 RenderViewHostDelegate::BrowserIntegration* integration_delegate =
2056 delegate_->GetBrowserIntegrationDelegate(); 2056 delegate_->GetBrowserIntegrationDelegate();
2057 if (!integration_delegate) 2057 if (!integration_delegate)
2058 return; 2058 return;
2059 integration_delegate->OnSetSuggestResult(page_id, result); 2059 integration_delegate->OnSetSuggestResult(page_id, result);
2060 } 2060 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698