OLD | NEW |
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 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 // still fire though, which causes read permissions to be granted to the | 1485 // still fire though, which causes read permissions to be granted to the |
1486 // renderer for any file paths in the drop. | 1486 // renderer for any file paths in the drop. |
1487 filtered_data.filenames.clear(); | 1487 filtered_data.filenames.clear(); |
1488 for (std::vector<DropData::FileInfo>::const_iterator it = | 1488 for (std::vector<DropData::FileInfo>::const_iterator it = |
1489 drop_data.filenames.begin(); | 1489 drop_data.filenames.begin(); |
1490 it != drop_data.filenames.end(); ++it) { | 1490 it != drop_data.filenames.end(); ++it) { |
1491 base::FilePath path(base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path))); | 1491 base::FilePath path(base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path))); |
1492 if (policy->CanReadFile(GetProcess()->GetID(), path)) | 1492 if (policy->CanReadFile(GetProcess()->GetID(), path)) |
1493 filtered_data.filenames.push_back(*it); | 1493 filtered_data.filenames.push_back(*it); |
1494 } | 1494 } |
1495 ui::ScaleFactor scale_factor = GetScaleFactorForView(GetView()); | 1495 float scale = ui::GetImageScale(GetScaleFactorForView(GetView())); |
1496 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale_factor)); | 1496 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale)); |
1497 view->StartDragging(filtered_data, drag_operations_mask, image, | 1497 view->StartDragging(filtered_data, drag_operations_mask, image, |
1498 bitmap_offset_in_dip, event_info); | 1498 bitmap_offset_in_dip, event_info); |
1499 } | 1499 } |
1500 | 1500 |
1501 void RenderViewHostImpl::OnUpdateDragCursor(WebDragOperation current_op) { | 1501 void RenderViewHostImpl::OnUpdateDragCursor(WebDragOperation current_op) { |
1502 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 1502 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
1503 if (view) | 1503 if (view) |
1504 view->UpdateDragCursor(current_op); | 1504 view->UpdateDragCursor(current_op); |
1505 } | 1505 } |
1506 | 1506 |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 2065 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
2066 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2066 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
2067 file != file_paths.end(); ++file) { | 2067 file != file_paths.end(); ++file) { |
2068 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2068 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
2069 return false; | 2069 return false; |
2070 } | 2070 } |
2071 return true; | 2071 return true; |
2072 } | 2072 } |
2073 | 2073 |
2074 } // namespace content | 2074 } // namespace content |
OLD | NEW |