OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
| 6 #define VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "views/view.h" |
| 10 #include "views/widget/native_widget_delegate.h" |
| 11 #include "views/widget/native_widget_views.h" |
| 12 |
| 13 namespace views { |
| 14 class NativeWidgetViews; |
| 15 |
| 16 namespace internal { |
| 17 |
| 18 //////////////////////////////////////////////////////////////////////////////// |
| 19 // NativeWidgetView |
| 20 // |
| 21 // This class represents the View that is the "native view" for a |
| 22 // NativeWidgetViews. It is the View that is a member of the parent Widget's |
| 23 // View hierarchy. It is responsible for receiving relevant events from that |
| 24 // hierarchy and forwarding them to its NativeWidgetViews' delegate's hierarchy. |
| 25 // |
| 26 class NativeWidgetView : public View { |
| 27 public: |
| 28 explicit NativeWidgetView(NativeWidgetViews* native_widget); |
| 29 virtual ~NativeWidgetView(); |
| 30 |
| 31 private: |
| 32 // Overridden from View: |
| 33 virtual void ViewHierarchyChanged(bool is_add, |
| 34 View* parent, |
| 35 View* child) OVERRIDE; |
| 36 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 37 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 38 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
| 39 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
| 40 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; |
| 41 virtual void OnMouseCaptureLost() OVERRIDE; |
| 42 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
| 43 virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE; |
| 44 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
| 45 #if defined(TOUCH_UI) |
| 46 virtual TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; |
| 47 #endif |
| 48 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; |
| 49 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; |
| 50 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; |
| 51 virtual void OnFocus() OVERRIDE; |
| 52 virtual void OnBlur() OVERRIDE; |
| 53 |
| 54 internal::NativeWidgetDelegate* delegate() { |
| 55 return native_widget_->delegate(); |
| 56 } |
| 57 |
| 58 NativeWidgetViews* native_widget_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(NativeWidgetView); |
| 61 }; |
| 62 |
| 63 } // namespace internal |
| 64 } // namespace views |
| 65 |
| 66 #endif // VIEWS_WIDGET_NATIVE_WIDGET_VIEW_H_ |
OLD | NEW |