| 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 UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 5 #ifndef UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| 6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 namespace test { |
| 15 class NativeViewHostTestBase; |
| 16 } |
| 14 | 17 |
| 15 class NativeViewHostAuraTest; | |
| 16 class NativeViewHostWrapper; | 18 class NativeViewHostWrapper; |
| 17 | 19 |
| 18 // If a NativeViewHost's native view is a Widget, this native window | 20 // If a NativeViewHost's native view is a Widget, this native window |
| 19 // property is set on the widget, pointing to the owning NativeViewHost. | 21 // property is set on the widget, pointing to the owning NativeViewHost. |
| 20 extern const char kWidgetNativeViewHostKey[]; | 22 extern const char kWidgetNativeViewHostKey[]; |
| 21 | 23 |
| 22 // A View type that hosts a gfx::NativeView. The bounds of the native view are | 24 // A View type that hosts a gfx::NativeView. The bounds of the native view are |
| 23 // kept in sync with the bounds of this view as it is moved and sized. | 25 // kept in sync with the bounds of this view as it is moved and sized. |
| 24 // Under the hood, a platform-specific NativeViewHostWrapper implementation does | 26 // Under the hood, a platform-specific NativeViewHostWrapper implementation does |
| 25 // the platform-specific work of manipulating the underlying OS widget type. | 27 // the platform-specific work of manipulating the underlying OS widget type. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 92 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
| 91 | 93 |
| 92 protected: | 94 protected: |
| 93 virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE; | 95 virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE; |
| 94 virtual void OnVisibleBoundsChanged() OVERRIDE; | 96 virtual void OnVisibleBoundsChanged() OVERRIDE; |
| 95 virtual void ViewHierarchyChanged( | 97 virtual void ViewHierarchyChanged( |
| 96 const ViewHierarchyChangedDetails& details) OVERRIDE; | 98 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 97 virtual const char* GetClassName() const OVERRIDE; | 99 virtual const char* GetClassName() const OVERRIDE; |
| 98 | 100 |
| 99 private: | 101 private: |
| 100 friend class NativeViewHostAuraTest; | 102 friend class test::NativeViewHostTestBase; |
| 101 | 103 |
| 102 // Detach the native view. |destroyed| is true if the native view is | 104 // Detach the native view. |destroyed| is true if the native view is |
| 103 // detached because it's being destroyed, or false otherwise. | 105 // detached because it's being destroyed, or false otherwise. |
| 104 void Detach(bool destroyed); | 106 void Detach(bool destroyed); |
| 105 | 107 |
| 106 // Invokes ViewRemoved() on the FocusManager for all the child Widgets of our | 108 // Invokes ViewRemoved() on the FocusManager for all the child Widgets of our |
| 107 // NativeView. This is used when detaching to ensure the FocusManager doesn't | 109 // NativeView. This is used when detaching to ensure the FocusManager doesn't |
| 108 // have a reference to a View that is no longer reachable. | 110 // have a reference to a View that is no longer reachable. |
| 109 void ClearFocus(); | 111 void ClearFocus(); |
| 110 | 112 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 127 | 129 |
| 128 // The view that should be given focus when this NativeViewHost is focused. | 130 // The view that should be given focus when this NativeViewHost is focused. |
| 129 View* focus_view_; | 131 View* focus_view_; |
| 130 | 132 |
| 131 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 133 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 132 }; | 134 }; |
| 133 | 135 |
| 134 } // namespace views | 136 } // namespace views |
| 135 | 137 |
| 136 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 138 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |