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 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
6 #define VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/view.h" | 9 #include "views/view.h" |
10 #include "views/widget/native_widget_delegate.h" | 10 #include "views/widget/native_widget_delegate.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 void set_delete_native_widget(bool delete_native_widget) { | 37 void set_delete_native_widget(bool delete_native_widget) { |
38 delete_native_widget_ = delete_native_widget; | 38 delete_native_widget_ = delete_native_widget; |
39 } | 39 } |
40 | 40 |
41 void set_cursor(gfx::NativeCursor cursor) { cursor_ = cursor; } | 41 void set_cursor(gfx::NativeCursor cursor) { cursor_ = cursor; } |
42 | 42 |
43 // Overridden from View: | 43 // Overridden from View: |
44 virtual void SchedulePaintInternal(const gfx::Rect& r) OVERRIDE; | 44 virtual void SchedulePaintInternal(const gfx::Rect& r) OVERRIDE; |
45 virtual void MarkLayerDirty() OVERRIDE; | 45 virtual void MarkLayerDirty() OVERRIDE; |
46 virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, | 46 virtual void CalculateOffsetToAncestorWithLayer( |
47 View** ancestor) OVERRIDE; | 47 gfx::Point* offset, |
| 48 ui::Layer** layer_parent) OVERRIDE; |
48 | 49 |
49 private: | 50 private: |
50 // Overridden from View: | 51 // Overridden from View: |
51 virtual void ViewHierarchyChanged(bool is_add, | 52 virtual void ViewHierarchyChanged(bool is_add, |
52 View* parent, | 53 View* parent, |
53 View* child) OVERRIDE; | 54 View* child) OVERRIDE; |
54 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 55 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
55 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 56 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
56 virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE; | 57 virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE; |
57 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; | 58 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
58 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; | 59 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
59 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; | 60 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; |
60 virtual void OnMouseCaptureLost() OVERRIDE; | 61 virtual void OnMouseCaptureLost() OVERRIDE; |
61 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; | 62 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
62 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; | 63 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; |
63 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; | 64 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
64 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; | 65 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; |
65 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; | 66 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; |
66 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; | 67 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; |
67 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; | 68 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; |
68 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; | 69 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; |
69 virtual void OnFocus() OVERRIDE; | 70 virtual void OnFocus() OVERRIDE; |
70 virtual void OnBlur() OVERRIDE; | 71 virtual void OnBlur() OVERRIDE; |
71 virtual std::string GetClassName() const OVERRIDE; | 72 virtual std::string GetClassName() const OVERRIDE; |
72 virtual void MoveLayerToParent(ui::Layer* parent_layer, | 73 virtual void MoveLayerToParent(ui::Layer* parent_layer, |
73 const gfx::Point& point) OVERRIDE; | 74 const gfx::Point& point) OVERRIDE; |
74 virtual void DestroyLayerRecurse() OVERRIDE; | 75 virtual void DestroyLayerRecurse() OVERRIDE; |
75 virtual void UpdateLayerBounds(const gfx::Point& offset) OVERRIDE; | 76 virtual void UpdateLayerBounds(const gfx::Point& offset) OVERRIDE; |
76 virtual void PaintToLayer(const gfx::Rect& dirty_rect) OVERRIDE; | |
77 virtual void PaintComposite() OVERRIDE; | |
78 | 77 |
79 internal::NativeWidgetDelegate* delegate() { | 78 internal::NativeWidgetDelegate* delegate() { |
80 return native_widget_->delegate(); | 79 return native_widget_->delegate(); |
81 } | 80 } |
82 | 81 |
83 NativeWidgetViews* native_widget_; | 82 NativeWidgetViews* native_widget_; |
84 | 83 |
85 // Have we sent OnNativeWidgetCreated? | 84 // Have we sent OnNativeWidgetCreated? |
86 bool sent_create_; | 85 bool sent_create_; |
87 | 86 |
88 bool delete_native_widget_; | 87 bool delete_native_widget_; |
89 | 88 |
90 // The cursor set for the associated widget. | 89 // The cursor set for the associated widget. |
91 gfx::NativeCursor cursor_; | 90 gfx::NativeCursor cursor_; |
92 | 91 |
93 DISALLOW_COPY_AND_ASSIGN(NativeWidgetView); | 92 DISALLOW_COPY_AND_ASSIGN(NativeWidgetView); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace internal | 95 } // namespace internal |
97 } // namespace views | 96 } // namespace views |
98 | 97 |
99 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ | 98 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
OLD | NEW |