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