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

Side by Side Diff: ui/views/window/client_view.cc

Issue 10795078: Fixes two bugs related to constrained windows: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « ui/views/window/client_view.h ('k') | 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 "ui/views/window/client_view.h" 5 #include "ui/views/window/client_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/base/hit_test.h" 9 #include "ui/base/hit_test.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 30 matching lines...) Expand all
41 41
42 void ClientView::WidgetClosing() { 42 void ClientView::WidgetClosing() {
43 } 43 }
44 44
45 /////////////////////////////////////////////////////////////////////////////// 45 ///////////////////////////////////////////////////////////////////////////////
46 // ClientView, View overrides: 46 // ClientView, View overrides:
47 47
48 gfx::Size ClientView::GetPreferredSize() { 48 gfx::Size ClientView::GetPreferredSize() {
49 // |contents_view_| is allowed to be NULL up until the point where this view 49 // |contents_view_| is allowed to be NULL up until the point where this view
50 // is attached to a Container. 50 // is attached to a Container.
51 if (contents_view_) 51 return contents_view_ ? contents_view_->GetPreferredSize() : gfx::Size();
52 return contents_view_->GetPreferredSize(); 52 }
53 return gfx::Size(); 53
54 gfx::Size ClientView::GetMinimumSize() {
55 // |contents_view_| is allowed to be NULL up until the point where this view
56 // is attached to a Container.
57 return contents_view_ ? contents_view_->GetMinimumSize() : gfx::Size();
54 } 58 }
55 59
56 void ClientView::Layout() { 60 void ClientView::Layout() {
57 // |contents_view_| is allowed to be NULL up until the point where this view 61 // |contents_view_| is allowed to be NULL up until the point where this view
58 // is attached to a Container. 62 // is attached to a Container.
59 if (contents_view_) 63 if (contents_view_)
60 contents_view_->SetBounds(0, 0, width(), height()); 64 contents_view_->SetBounds(0, 0, width(), height());
61 } 65 }
62 66
63 std::string ClientView::GetClassName() const { 67 std::string ClientView::GetClassName() const {
(...skipping 14 matching lines...) Expand all
78 if (is_add && child == this) { 82 if (is_add && child == this) {
79 DCHECK(GetWidget()); 83 DCHECK(GetWidget());
80 DCHECK(contents_view_); // |contents_view_| must be valid now! 84 DCHECK(contents_view_); // |contents_view_| must be valid now!
81 // Insert |contents_view_| at index 0 so it is first in the focus chain. 85 // Insert |contents_view_| at index 0 so it is first in the focus chain.
82 // (the OK/Cancel buttons are inserted before contents_view_) 86 // (the OK/Cancel buttons are inserted before contents_view_)
83 AddChildViewAt(contents_view_, 0); 87 AddChildViewAt(contents_view_, 0);
84 } 88 }
85 } 89 }
86 90
87 } // namespace views 91 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/window/client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698