| 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_VIEW_HOST_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_VIEW_HOST_H_ |
| 6 #define VIEWS_CONTROLS_NATIVE_VIEW_HOST_H_ | 6 #define VIEWS_CONTROLS_NATIVE_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "views/view.h" | 10 #include "views/view.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Accessor for |native_view_|. | 64 // Accessor for |native_view_|. |
| 65 gfx::NativeView native_view() const { return native_view_; } | 65 gfx::NativeView native_view() const { return native_view_; } |
| 66 | 66 |
| 67 void NativeViewDestroyed(); | 67 void NativeViewDestroyed(); |
| 68 | 68 |
| 69 // Overridden from View: | 69 // Overridden from View: |
| 70 virtual gfx::Size GetPreferredSize(); | 70 virtual gfx::Size GetPreferredSize(); |
| 71 virtual void Layout(); | 71 virtual void Layout(); |
| 72 virtual void Paint(gfx::Canvas* canvas); | 72 virtual void Paint(gfx::Canvas* canvas); |
| 73 virtual void VisibilityChanged(View* starting_from, bool is_visible); | 73 virtual void VisibilityChanged(View* starting_from, bool is_visible); |
| 74 virtual void Focus(); |
| 74 | 75 |
| 75 protected: | 76 protected: |
| 76 virtual void VisibleBoundsInRootChanged(); | 77 virtual void VisibleBoundsInRootChanged(); |
| 77 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 78 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
| 78 virtual std::string GetClassName() const; | 79 virtual std::string GetClassName() const; |
| 79 virtual void Focus(); | |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // The attached native view. | 82 // The attached native view. |
| 83 gfx::NativeView native_view_; | 83 gfx::NativeView native_view_; |
| 84 | 84 |
| 85 // A platform-specific wrapper that does the OS-level manipulation of the | 85 // A platform-specific wrapper that does the OS-level manipulation of the |
| 86 // attached gfx::NativeView. | 86 // attached gfx::NativeView. |
| 87 scoped_ptr<NativeViewHostWrapper> native_wrapper_; | 87 scoped_ptr<NativeViewHostWrapper> native_wrapper_; |
| 88 | 88 |
| 89 // The preferred size of this View | 89 // The preferred size of this View |
| 90 gfx::Size preferred_size_; | 90 gfx::Size preferred_size_; |
| 91 | 91 |
| 92 // True if the native view is being resized using the fast method described | 92 // True if the native view is being resized using the fast method described |
| 93 // in the setter/accessor above. | 93 // in the setter/accessor above. |
| 94 bool fast_resize_; | 94 bool fast_resize_; |
| 95 | 95 |
| 96 // The view that should be given focus when this NativeViewHost is focused. | 96 // The view that should be given focus when this NativeViewHost is focused. |
| 97 View* focus_view_; | 97 View* focus_view_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 99 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace views | 102 } // namespace views |
| 103 | 103 |
| 104 #endif // VIEWS_CONTROLS_NATIVE_VIEW_HOST_H_ | 104 #endif // VIEWS_CONTROLS_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |