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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 817103002: Only take basename of default_file_name when starting a File Chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change to filter at the IPC Created 5 years, 12 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
« no previous file with comments | « no previous file | content/renderer/render_view_impl.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 (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 "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 HostZoomMapImpl* host_zoom_map = 1438 HostZoomMapImpl* host_zoom_map =
1439 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); 1439 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1440 1440
1441 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), 1441 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(),
1442 GetRoutingID(), 1442 GetRoutingID(),
1443 zoom_level, 1443 zoom_level,
1444 net::GetHostOrSpecFromURL(url)); 1444 net::GetHostOrSpecFromURL(url));
1445 } 1445 }
1446 1446
1447 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1447 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1448 // Do not allow messages with absolute paths in them as this can permit a
1449 // renderer to coerce the browser to perform I/O on a renderer controlled
1450 // path.
1451 if (params.default_file_name.IsAbsolute()) {
Lei Zhang 2015/01/05 22:43:55 Should we check and make sure the file name does n
1452 GetProcess()->ReceivedBadMessage();
1453 return;
1454 }
1455
1448 delegate_->RunFileChooser(this, params); 1456 delegate_->RunFileChooser(this, params);
1449 } 1457 }
1450 1458
1451 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { 1459 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) {
1452 #if defined(OS_WIN) 1460 #if defined(OS_WIN)
1453 if (editable) { 1461 if (editable) {
1454 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); 1462 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard();
1455 delegate_->SetIsVirtualKeyboardRequested(true); 1463 delegate_->SetIsVirtualKeyboardRequested(true);
1456 } else { 1464 } else {
1457 virtual_keyboard_requested_ = false; 1465 virtual_keyboard_requested_ = false;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 FrameTree* frame_tree = delegate_->GetFrameTree(); 1497 FrameTree* frame_tree = delegate_->GetFrameTree();
1490 1498
1491 frame_tree->ResetForMainFrameSwap(); 1499 frame_tree->ResetForMainFrameSwap();
1492 } 1500 }
1493 1501
1494 void RenderViewHostImpl::SelectWordAroundCaret() { 1502 void RenderViewHostImpl::SelectWordAroundCaret() {
1495 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1503 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1496 } 1504 }
1497 1505
1498 } // namespace content 1506 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698