| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| 6 #define VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 6 #define VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/gfx/native_widget_types.h" | 10 #include "app/gfx/native_widget_types.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 virtual void Paint(gfx::Canvas* canvas); | 74 virtual void Paint(gfx::Canvas* canvas); |
| 75 virtual void VisibilityChanged(View* starting_from, bool is_visible); | 75 virtual void VisibilityChanged(View* starting_from, bool is_visible); |
| 76 virtual void Focus(); | 76 virtual void Focus(); |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 virtual void VisibleBoundsInRootChanged(); | 79 virtual void VisibleBoundsInRootChanged(); |
| 80 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 80 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
| 81 virtual std::string GetClassName() const; | 81 virtual std::string GetClassName() const; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 // Detach the native view. |destroyed| is true if the native view is |
| 85 // detached because it's being destroyed, or false otherwise. |
| 86 void Detach(bool destroyed); |
| 87 |
| 84 // The attached native view. | 88 // The attached native view. |
| 85 gfx::NativeView native_view_; | 89 gfx::NativeView native_view_; |
| 86 | 90 |
| 87 // A platform-specific wrapper that does the OS-level manipulation of the | 91 // A platform-specific wrapper that does the OS-level manipulation of the |
| 88 // attached gfx::NativeView. | 92 // attached gfx::NativeView. |
| 89 scoped_ptr<NativeViewHostWrapper> native_wrapper_; | 93 scoped_ptr<NativeViewHostWrapper> native_wrapper_; |
| 90 | 94 |
| 91 // The preferred size of this View | 95 // The preferred size of this View |
| 92 gfx::Size preferred_size_; | 96 gfx::Size preferred_size_; |
| 93 | 97 |
| 94 // True if the native view is being resized using the fast method described | 98 // True if the native view is being resized using the fast method described |
| 95 // in the setter/accessor above. | 99 // in the setter/accessor above. |
| 96 bool fast_resize_; | 100 bool fast_resize_; |
| 97 | 101 |
| 98 // The view that should be given focus when this NativeViewHost is focused. | 102 // The view that should be given focus when this NativeViewHost is focused. |
| 99 View* focus_view_; | 103 View* focus_view_; |
| 100 | 104 |
| 101 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 105 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 102 }; | 106 }; |
| 103 | 107 |
| 104 } // namespace views | 108 } // namespace views |
| 105 | 109 |
| 106 #endif // VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 110 #endif // VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |