OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/root_view.h" | 5 #include "views/widget/root_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 AddChildView(contents_view); | 65 AddChildView(contents_view); |
66 | 66 |
67 // Force a layout now, since the attached hierarchy won't be ready for the | 67 // Force a layout now, since the attached hierarchy won't be ready for the |
68 // containing window's bounds. Note that we call Layout directly rather than | 68 // containing window's bounds. Note that we call Layout directly rather than |
69 // calling the widget's size changed handler, since the RootView's bounds may | 69 // calling the widget's size changed handler, since the RootView's bounds may |
70 // not have changed, which will cause the Layout not to be done otherwise. | 70 // not have changed, which will cause the Layout not to be done otherwise. |
71 Layout(); | 71 Layout(); |
72 } | 72 } |
73 | 73 |
74 View* RootView::GetContentsView() { | 74 View* RootView::GetContentsView() { |
75 return child_count() > 0 ? GetChildViewAt(0) : NULL; | 75 return child_count() > 0 ? child_at(0) : NULL; |
76 } | 76 } |
77 | 77 |
78 void RootView::NotifyNativeViewHierarchyChanged(bool attached, | 78 void RootView::NotifyNativeViewHierarchyChanged(bool attached, |
79 gfx::NativeView native_view) { | 79 gfx::NativeView native_view) { |
80 PropagateNativeViewHierarchyChanged(attached, native_view, this); | 80 PropagateNativeViewHierarchyChanged(attached, native_view, this); |
81 } | 81 } |
82 | 82 |
83 // Input ----------------------------------------------------------------------- | 83 // Input ----------------------------------------------------------------------- |
84 | 84 |
85 bool RootView::OnKeyEvent(const KeyEvent& event) { | 85 bool RootView::OnKeyEvent(const KeyEvent& event) { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 495 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
496 last_mouse_event_flags_ = event.flags(); | 496 last_mouse_event_flags_ = event.flags(); |
497 last_mouse_event_x_ = event.x(); | 497 last_mouse_event_x_ = event.x(); |
498 last_mouse_event_y_ = event.y(); | 498 last_mouse_event_y_ = event.y(); |
499 } | 499 } |
500 | 500 |
501 } // namespace internal | 501 } // namespace internal |
502 } // namespace views | 502 } // namespace views |
503 | 503 |
OLD | NEW |