| 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" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual void ViewHierarchyChanged(bool is_add, | 88 virtual void ViewHierarchyChanged(bool is_add, |
| 89 View* parent, | 89 View* parent, |
| 90 View* child) OVERRIDE; | 90 View* child) OVERRIDE; |
| 91 virtual std::string GetClassName() const OVERRIDE; | 91 virtual std::string GetClassName() const OVERRIDE; |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Detach the native view. |destroyed| is true if the native view is | 94 // Detach the native view. |destroyed| is true if the native view is |
| 95 // detached because it's being destroyed, or false otherwise. | 95 // detached because it's being destroyed, or false otherwise. |
| 96 void Detach(bool destroyed); | 96 void Detach(bool destroyed); |
| 97 | 97 |
| 98 // Invokes ViewRemoved() on the FocusManager for all the child Widgets of our |
| 99 // NativeView. This is used when detaching to ensure the FocusManager doesn't |
| 100 // have a reference to a View that is no longer reachable. |
| 101 void ClearFocus(); |
| 102 |
| 98 // The attached native view. There is exactly one native_view_ attached. | 103 // The attached native view. There is exactly one native_view_ attached. |
| 99 gfx::NativeView native_view_; | 104 gfx::NativeView native_view_; |
| 100 | 105 |
| 101 // A platform-specific wrapper that does the OS-level manipulation of the | 106 // A platform-specific wrapper that does the OS-level manipulation of the |
| 102 // attached gfx::NativeView. | 107 // attached gfx::NativeView. |
| 103 scoped_ptr<NativeViewHostWrapper> native_wrapper_; | 108 scoped_ptr<NativeViewHostWrapper> native_wrapper_; |
| 104 | 109 |
| 105 // The preferred size of this View | 110 // The preferred size of this View |
| 106 gfx::Size preferred_size_; | 111 gfx::Size preferred_size_; |
| 107 | 112 |
| 108 // True if the native view is being resized using the fast method described | 113 // True if the native view is being resized using the fast method described |
| 109 // in the setter/accessor above. | 114 // in the setter/accessor above. |
| 110 bool fast_resize_; | 115 bool fast_resize_; |
| 111 | 116 |
| 112 // Value of |fast_resize_| during the last call to Layout. | 117 // Value of |fast_resize_| during the last call to Layout. |
| 113 bool fast_resize_at_last_layout_; | 118 bool fast_resize_at_last_layout_; |
| 114 | 119 |
| 115 // The view that should be given focus when this NativeViewHost is focused. | 120 // The view that should be given focus when this NativeViewHost is focused. |
| 116 View* focus_view_; | 121 View* focus_view_; |
| 117 | 122 |
| 118 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 123 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 119 }; | 124 }; |
| 120 | 125 |
| 121 } // namespace views | 126 } // namespace views |
| 122 | 127 |
| 123 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 128 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |