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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 // WebContentsViewAura, aura::client::DragDropDelegate implementation: | 1486 // WebContentsViewAura, aura::client::DragDropDelegate implementation: |
1487 | 1487 |
1488 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) { | 1488 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) { |
1489 current_rvh_for_drag_ = web_contents_->GetRenderViewHost(); | 1489 current_rvh_for_drag_ = web_contents_->GetRenderViewHost(); |
1490 current_drop_data_.reset(new DropData()); | 1490 current_drop_data_.reset(new DropData()); |
1491 | 1491 |
1492 PrepareDropData(current_drop_data_.get(), event.data()); | 1492 PrepareDropData(current_drop_data_.get(), event.data()); |
1493 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); | 1493 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); |
1494 | 1494 |
1495 // Give the delegate an opportunity to cancel the drag. | 1495 // Give the delegate an opportunity to cancel the drag. |
1496 if (!web_contents_->GetDelegate()->CanDragEnter(web_contents_, | 1496 if (web_contents_->GetDelegate() && |
1497 *current_drop_data_.get(), | 1497 !web_contents_->GetDelegate()->CanDragEnter( |
1498 op)) { | 1498 web_contents_, *current_drop_data_.get(), op)) { |
1499 current_drop_data_.reset(NULL); | 1499 current_drop_data_.reset(NULL); |
1500 return; | 1500 return; |
1501 } | 1501 } |
1502 | 1502 |
1503 if (drag_dest_delegate_) | 1503 if (drag_dest_delegate_) |
1504 drag_dest_delegate_->DragInitialize(web_contents_); | 1504 drag_dest_delegate_->DragInitialize(web_contents_); |
1505 | 1505 |
1506 gfx::Point screen_pt = | 1506 gfx::Point screen_pt = |
1507 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); | 1507 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); |
1508 web_contents_->GetRenderViewHost()->DragTargetDragEnter( | 1508 web_contents_->GetRenderViewHost()->DragTargetDragEnter( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 if (visible) { | 1608 if (visible) { |
1609 if (!web_contents_->should_normally_be_visible()) | 1609 if (!web_contents_->should_normally_be_visible()) |
1610 web_contents_->WasShown(); | 1610 web_contents_->WasShown(); |
1611 } else { | 1611 } else { |
1612 if (web_contents_->should_normally_be_visible()) | 1612 if (web_contents_->should_normally_be_visible()) |
1613 web_contents_->WasHidden(); | 1613 web_contents_->WasHidden(); |
1614 } | 1614 } |
1615 } | 1615 } |
1616 | 1616 |
1617 } // namespace content | 1617 } // namespace content |
OLD | NEW |