| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 496 |
| 497 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 497 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
| 498 last_mouse_event_flags_ = event.flags(); | 498 last_mouse_event_flags_ = event.flags(); |
| 499 last_mouse_event_x_ = event.x(); | 499 last_mouse_event_x_ = event.x(); |
| 500 last_mouse_event_y_ = event.y(); | 500 last_mouse_event_y_ = event.y(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace internal | 503 } // namespace internal |
| 504 } // namespace views | 504 } // namespace views |
| 505 | 505 |
| OLD | NEW |