| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "content/browser/renderer_host/dip_util.h" | 8 #include "content/browser/renderer_host/dip_util.h" |
| 9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 10 #include "content/browser/web_contents/interstitial_page_impl.h" | 10 #include "content/browser/web_contents/interstitial_page_impl.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 const gfx::Rect& new_bounds) { | 491 const gfx::Rect& new_bounds) { |
| 492 SizeChangedCommon(new_bounds.size()); | 492 SizeChangedCommon(new_bounds.size()); |
| 493 if (delegate_.get()) | 493 if (delegate_.get()) |
| 494 delegate_->SizeChanged(new_bounds.size()); | 494 delegate_->SizeChanged(new_bounds.size()); |
| 495 | 495 |
| 496 // Constrained web dialogs, need to be kept centered over our content area. | 496 // Constrained web dialogs, need to be kept centered over our content area. |
| 497 for (size_t i = 0; i < window_->children().size(); i++) { | 497 for (size_t i = 0; i < window_->children().size(); i++) { |
| 498 if (window_->children()[i]->GetProperty( | 498 if (window_->children()[i]->GetProperty( |
| 499 aura::client::kConstrainedWindowKey)) { | 499 aura::client::kConstrainedWindowKey)) { |
| 500 gfx::Rect bounds = window_->children()[i]->bounds(); | 500 gfx::Rect bounds = window_->children()[i]->bounds(); |
| 501 bounds.Offset((new_bounds.width() - old_bounds.width()) / 2, | 501 bounds.set_origin( |
| 502 (new_bounds.height() - old_bounds.height()) / 2); | 502 gfx::Point((new_bounds.width() - bounds.width()) / 2, |
| 503 (new_bounds.height() - bounds.height()) / 2)); |
| 503 window_->children()[i]->SetBounds(bounds); | 504 window_->children()[i]->SetBounds(bounds); |
| 504 } | 505 } |
| 505 } | 506 } |
| 506 } | 507 } |
| 507 | 508 |
| 508 void WebContentsViewAura::OnFocus(aura::Window* old_focused_window) { | 509 void WebContentsViewAura::OnFocus(aura::Window* old_focused_window) { |
| 509 } | 510 } |
| 510 | 511 |
| 511 void WebContentsViewAura::OnBlur() { | 512 void WebContentsViewAura::OnBlur() { |
| 512 } | 513 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 OnDragEntered(event); | 659 OnDragEntered(event); |
| 659 | 660 |
| 660 web_contents_->GetRenderViewHost()->DragTargetDrop( | 661 web_contents_->GetRenderViewHost()->DragTargetDrop( |
| 661 event.location(), | 662 event.location(), |
| 662 gfx::Screen::GetCursorScreenPoint(), | 663 gfx::Screen::GetCursorScreenPoint(), |
| 663 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 664 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 664 if (drag_dest_delegate_) | 665 if (drag_dest_delegate_) |
| 665 drag_dest_delegate_->OnDrop(); | 666 drag_dest_delegate_->OnDrop(); |
| 666 return current_drag_op_; | 667 return current_drag_op_; |
| 667 } | 668 } |
| OLD | NEW |