Chromium Code Reviews| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 | 482 |
| 483 gfx::Size WebContentsViewAura::GetMinimumSize() const { | 483 gfx::Size WebContentsViewAura::GetMinimumSize() const { |
| 484 return gfx::Size(); | 484 return gfx::Size(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void WebContentsViewAura::OnBoundsChanged(const gfx::Rect& old_bounds, | 487 void WebContentsViewAura::OnBoundsChanged(const gfx::Rect& old_bounds, |
| 488 const gfx::Rect& new_bounds) { | 488 const gfx::Rect& new_bounds) { |
| 489 SizeChangedCommon(new_bounds.size()); | 489 SizeChangedCommon(new_bounds.size()); |
| 490 if (delegate_.get()) | 490 if (delegate_.get()) |
| 491 delegate_->SizeChanged(new_bounds.size()); | 491 delegate_->SizeChanged(new_bounds.size()); |
| 492 | |
| 493 // Constrained web dialog windows, need to be kept centered over our content | |
| 494 // area. Note that the dialog is the second child - so we start with index 1. | |
| 495 for (size_t i = 1; i < window_->children().size(); i++) { | |
|
sky
2012/09/14 17:23:21
Now you've got me worried. Add a property that is
Mr4D (OOO till 08-26)
2012/09/14 20:44:03
Aha! I knew it! :) Done.
| |
| 496 gfx::Rect bounds = window_->children()[i]->bounds(); | |
| 497 bounds.Offset((new_bounds.width() - old_bounds.width()) / 2, | |
| 498 (new_bounds.height() - old_bounds.height()) / 2); | |
| 499 window_->children()[i]->SetBounds(bounds); | |
| 500 } | |
| 492 } | 501 } |
| 493 | 502 |
| 494 void WebContentsViewAura::OnFocus(aura::Window* old_focused_window) { | 503 void WebContentsViewAura::OnFocus(aura::Window* old_focused_window) { |
| 495 } | 504 } |
| 496 | 505 |
| 497 void WebContentsViewAura::OnBlur() { | 506 void WebContentsViewAura::OnBlur() { |
| 498 } | 507 } |
| 499 | 508 |
| 500 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { | 509 gfx::NativeCursor WebContentsViewAura::GetCursor(const gfx::Point& point) { |
| 501 return gfx::kNullCursor; | 510 return gfx::kNullCursor; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 OnDragEntered(event); | 653 OnDragEntered(event); |
| 645 | 654 |
| 646 web_contents_->GetRenderViewHost()->DragTargetDrop( | 655 web_contents_->GetRenderViewHost()->DragTargetDrop( |
| 647 event.location(), | 656 event.location(), |
| 648 gfx::Screen::GetCursorScreenPoint(), | 657 gfx::Screen::GetCursorScreenPoint(), |
| 649 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 658 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 650 if (drag_dest_delegate_) | 659 if (drag_dest_delegate_) |
| 651 drag_dest_delegate_->OnDrop(); | 660 drag_dest_delegate_->OnDrop(); |
| 652 return current_drag_op_; | 661 return current_drag_op_; |
| 653 } | 662 } |
| OLD | NEW |