| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 88 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
| 87 | 89 |
| 88 protected: | 90 protected: |
| 89 virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE; | 91 virtual bool GetNeedsNotificationWhenVisibleBoundsChange() const OVERRIDE; |
| 90 virtual void OnVisibleBoundsChanged() OVERRIDE; | 92 virtual void OnVisibleBoundsChanged() OVERRIDE; |
| 91 virtual void ViewHierarchyChanged( | 93 virtual void ViewHierarchyChanged( |
| 92 const ViewHierarchyChangedDetails& details) OVERRIDE; | 94 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 93 virtual const char* GetClassName() const OVERRIDE; | 95 virtual const char* GetClassName() const OVERRIDE; |
| 94 | 96 |
| 95 private: | 97 private: |
| 96 friend class NativeViewHostAuraTest; | 98 friend class test::NativeViewHostTestBase; |
| 97 | 99 |
| 98 // Detach the native view. |destroyed| is true if the native view is | 100 // Detach the native view. |destroyed| is true if the native view is |
| 99 // detached because it's being destroyed, or false otherwise. | 101 // detached because it's being destroyed, or false otherwise. |
| 100 void Detach(bool destroyed); | 102 void Detach(bool destroyed); |
| 101 | 103 |
| 102 // Invokes ViewRemoved() on the FocusManager for all the child Widgets of our | 104 // Invokes ViewRemoved() on the FocusManager for all the child Widgets of our |
| 103 // NativeView. This is used when detaching to ensure the FocusManager doesn't | 105 // NativeView. This is used when detaching to ensure the FocusManager doesn't |
| 104 // have a reference to a View that is no longer reachable. | 106 // have a reference to a View that is no longer reachable. |
| 105 void ClearFocus(); | 107 void ClearFocus(); |
| 106 | 108 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 123 | 125 |
| 124 // The view that should be given focus when this NativeViewHost is focused. | 126 // The view that should be given focus when this NativeViewHost is focused. |
| 125 View* focus_view_; | 127 View* focus_view_; |
| 126 | 128 |
| 127 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 129 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace views | 132 } // namespace views |
| 131 | 133 |
| 132 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 134 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |