Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 10905290: Keep a web dialog window centered over the content area (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698