| 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 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // Fast resizing will move the native view and clip its visible region, this | 62 // Fast resizing will move the native view and clip its visible region, this |
| 63 // will result in white areas and will not resize the content (so scrollbars | 63 // will result in white areas and will not resize the content (so scrollbars |
| 64 // will be all wrong and content will flow offscreen). Only use this | 64 // will be all wrong and content will flow offscreen). Only use this |
| 65 // when you're doing extremely quick, high-framerate vertical resizes | 65 // when you're doing extremely quick, high-framerate vertical resizes |
| 66 // and don't care about accuracy. Make sure you do a real resize at the | 66 // and don't care about accuracy. Make sure you do a real resize at the |
| 67 // end. USE WITH CAUTION. | 67 // end. USE WITH CAUTION. |
| 68 void set_fast_resize(bool fast_resize) { fast_resize_ = fast_resize; } | 68 void set_fast_resize(bool fast_resize) { fast_resize_ = fast_resize; } |
| 69 bool fast_resize() const { return fast_resize_; } | 69 bool fast_resize() const { return fast_resize_; } |
| 70 | 70 |
| 71 // Value of fast_resize() the last time Layout() was invoked. |
| 72 bool fast_resize_at_last_layout() const { |
| 73 return fast_resize_at_last_layout_; |
| 74 } |
| 75 |
| 71 // Accessor for |native_view_|. | 76 // Accessor for |native_view_|. |
| 72 gfx::NativeView native_view() const { return native_view_; } | 77 gfx::NativeView native_view() const { return native_view_; } |
| 73 | 78 |
| 74 // Accessor for |views_view_|. | 79 // Accessor for |views_view_|. |
| 75 View* views_view() const { return views_view_; } | 80 View* views_view() const { return views_view_; } |
| 76 | 81 |
| 77 void NativeViewDestroyed(); | 82 void NativeViewDestroyed(); |
| 78 | 83 |
| 79 // Overridden from View: | 84 // Overridden from View: |
| 80 virtual gfx::Size GetPreferredSize(); | 85 virtual gfx::Size GetPreferredSize(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 108 // attached gfx::NativeView. | 113 // attached gfx::NativeView. |
| 109 scoped_ptr<NativeViewHostWrapper> native_wrapper_; | 114 scoped_ptr<NativeViewHostWrapper> native_wrapper_; |
| 110 | 115 |
| 111 // The preferred size of this View | 116 // The preferred size of this View |
| 112 gfx::Size preferred_size_; | 117 gfx::Size preferred_size_; |
| 113 | 118 |
| 114 // True if the native view is being resized using the fast method described | 119 // True if the native view is being resized using the fast method described |
| 115 // in the setter/accessor above. | 120 // in the setter/accessor above. |
| 116 bool fast_resize_; | 121 bool fast_resize_; |
| 117 | 122 |
| 123 // Value of |fast_resize_| during the last call to Layout. |
| 124 bool fast_resize_at_last_layout_; |
| 125 |
| 118 // 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. |
| 119 View* focus_view_; | 127 View* focus_view_; |
| 120 | 128 |
| 121 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); | 129 DISALLOW_COPY_AND_ASSIGN(NativeViewHost); |
| 122 }; | 130 }; |
| 123 | 131 |
| 124 } // namespace views | 132 } // namespace views |
| 125 | 133 |
| 126 #endif // VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ | 134 #endif // VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_H_ |
| OLD | NEW |