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