| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 explicit NativeWidgetView(NativeWidgetViews* native_widget); | 34 explicit NativeWidgetView(NativeWidgetViews* native_widget); |
| 35 virtual ~NativeWidgetView(); | 35 virtual ~NativeWidgetView(); |
| 36 | 36 |
| 37 Widget* GetAssociatedWidget(); | 37 Widget* GetAssociatedWidget(); |
| 38 | 38 |
| 39 void set_delete_native_widget(bool delete_native_widget) { | 39 void set_delete_native_widget(bool delete_native_widget) { |
| 40 delete_native_widget_ = delete_native_widget; | 40 delete_native_widget_ = delete_native_widget; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void set_cursor(gfx::NativeCursor cursor) { cursor_ = cursor; } |
| 44 |
| 43 // Overridden from View: | 45 // Overridden from View: |
| 44 virtual void SchedulePaintInternal(const gfx::Rect& r) OVERRIDE; | 46 virtual void SchedulePaintInternal(const gfx::Rect& r) OVERRIDE; |
| 45 virtual void MarkLayerDirty() OVERRIDE; | 47 virtual void MarkLayerDirty() OVERRIDE; |
| 46 virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, | 48 virtual void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, |
| 47 View** ancestor) OVERRIDE; | 49 View** ancestor) OVERRIDE; |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 // Overridden from View: | 52 // Overridden from View: |
| 51 virtual void ViewHierarchyChanged(bool is_add, | 53 virtual void ViewHierarchyChanged(bool is_add, |
| 52 View* parent, | 54 View* parent, |
| 53 View* child) OVERRIDE; | 55 View* child) OVERRIDE; |
| 54 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 56 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 55 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 57 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 58 virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE; |
| 56 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; | 59 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
| 57 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; | 60 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
| 58 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; | 61 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; |
| 59 virtual void OnMouseCaptureLost() OVERRIDE; | 62 virtual void OnMouseCaptureLost() OVERRIDE; |
| 60 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; | 63 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
| 61 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; | 64 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; |
| 62 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; | 65 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
| 63 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; | 66 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; |
| 64 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; | 67 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; |
| 65 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; | 68 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 return native_widget_->delegate(); | 82 return native_widget_->delegate(); |
| 80 } | 83 } |
| 81 | 84 |
| 82 NativeWidgetViews* native_widget_; | 85 NativeWidgetViews* native_widget_; |
| 83 | 86 |
| 84 // Have we sent OnNativeWidgetCreated? | 87 // Have we sent OnNativeWidgetCreated? |
| 85 bool sent_create_; | 88 bool sent_create_; |
| 86 | 89 |
| 87 bool delete_native_widget_; | 90 bool delete_native_widget_; |
| 88 | 91 |
| 92 // The cursor set for the associated widget. |
| 93 gfx::NativeCursor cursor_; |
| 94 |
| 89 DISALLOW_COPY_AND_ASSIGN(NativeWidgetView); | 95 DISALLOW_COPY_AND_ASSIGN(NativeWidgetView); |
| 90 }; | 96 }; |
| 91 | 97 |
| 92 } // namespace internal | 98 } // namespace internal |
| 93 } // namespace views | 99 } // namespace views |
| 94 | 100 |
| 95 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ | 101 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
| OLD | NEW |