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/native_widget_view.h" | 5 #include "views/widget/native_widget_view.h" |
6 | 6 |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 namespace internal { | 10 namespace internal { |
(...skipping 14 matching lines...) Expand all Loading... |
25 Widget* NativeWidgetView::GetAssociatedWidget() { | 25 Widget* NativeWidgetView::GetAssociatedWidget() { |
26 return native_widget_->delegate()->AsWidget(); | 26 return native_widget_->delegate()->AsWidget(); |
27 } | 27 } |
28 | 28 |
29 //////////////////////////////////////////////////////////////////////////////// | 29 //////////////////////////////////////////////////////////////////////////////// |
30 // NativeWidgetView, View overrides: | 30 // NativeWidgetView, View overrides: |
31 | 31 |
32 void NativeWidgetView::ViewHierarchyChanged(bool is_add, View* parent, | 32 void NativeWidgetView::ViewHierarchyChanged(bool is_add, View* parent, |
33 View* child) { | 33 View* child) { |
34 if (is_add && child == this) | 34 if (is_add && child == this) |
35 delegate()->OnNativeWidgetCreated(); | 35 delegate()->OnNativeWidgetCreated(gfx::Rect()); // TODO(beng): |
36 } | 36 } |
37 | 37 |
38 void NativeWidgetView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 38 void NativeWidgetView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
39 delegate()->OnNativeWidgetSizeChanged(size()); | 39 delegate()->OnNativeWidgetSizeChanged(size()); |
40 } | 40 } |
41 | 41 |
42 void NativeWidgetView::OnPaint(gfx::Canvas* canvas) { | 42 void NativeWidgetView::OnPaint(gfx::Canvas* canvas) { |
43 canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height()); | 43 canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height()); |
44 delegate()->OnNativeWidgetPaint(canvas); | 44 delegate()->OnNativeWidgetPaint(canvas); |
45 } | 45 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 std::string NativeWidgetView::GetClassName() const { | 113 std::string NativeWidgetView::GetClassName() const { |
114 return kViewClassName; | 114 return kViewClassName; |
115 } | 115 } |
116 | 116 |
117 | 117 |
118 } // namespace internal | 118 } // namespace internal |
119 } // namespace views | 119 } // namespace views |
120 | 120 |
OLD | NEW |