OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Forces redraw in the renderer and when the update reaches the browser | 168 // Forces redraw in the renderer and when the update reaches the browser |
169 // grabs snapshot from the compositor. Returns PNG-encoded snapshot. | 169 // grabs snapshot from the compositor. Returns PNG-encoded snapshot. |
170 void GetSnapshotFromBrowser( | 170 void GetSnapshotFromBrowser( |
171 const base::Callback<void(const unsigned char*,size_t)> callback); | 171 const base::Callback<void(const unsigned char*,size_t)> callback); |
172 | 172 |
173 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; | 173 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; |
174 | 174 |
175 // Notification that the screen info has changed. | 175 // Notification that the screen info has changed. |
176 void NotifyScreenInfoChanged(); | 176 void NotifyScreenInfoChanged(); |
177 | 177 |
178 // Invalidates the cached screen info so that next resize request | |
179 // will carry the up to date screen info. Unlike | |
180 // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer. | |
181 void InvalidateScreenInfo(); | |
182 | |
183 // Sets the View of this RenderWidgetHost. | 178 // Sets the View of this RenderWidgetHost. |
184 void SetView(RenderWidgetHostViewBase* view); | 179 void SetView(RenderWidgetHostViewBase* view); |
185 | 180 |
186 int surface_id() const { return surface_id_; } | 181 int surface_id() const { return surface_id_; } |
187 | 182 |
188 bool empty() const { return current_size_.IsEmpty(); } | 183 bool empty() const { return current_size_.IsEmpty(); } |
189 | 184 |
190 // Called when a renderer object already been created for this host, and we | 185 // Called when a renderer object already been created for this host, and we |
191 // just need to be attached to it. Used for window.open, <select> dropdown | 186 // just need to be attached to it. Used for window.open, <select> dropdown |
192 // menus, and other times when the renderer initiates creating an object. | 187 // menus, and other times when the renderer initiates creating an object. |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 // Indicates whether a page is hidden or not. It has to stay in sync with the | 713 // Indicates whether a page is hidden or not. It has to stay in sync with the |
719 // most recent call to process_->WidgetRestored() / WidgetHidden(). | 714 // most recent call to process_->WidgetRestored() / WidgetHidden(). |
720 bool is_hidden_; | 715 bool is_hidden_; |
721 | 716 |
722 // Set if we are waiting for a repaint ack for the view. | 717 // Set if we are waiting for a repaint ack for the view. |
723 bool repaint_ack_pending_; | 718 bool repaint_ack_pending_; |
724 | 719 |
725 // True when waiting for RESIZE_ACK. | 720 // True when waiting for RESIZE_ACK. |
726 bool resize_ack_pending_; | 721 bool resize_ack_pending_; |
727 | 722 |
728 // Cached copy of the screen info so that it doesn't need to be updated every | |
729 // time the window is resized. | |
730 scoped_ptr<blink::WebScreenInfo> screen_info_; | |
731 | |
732 // Set if screen_info_ may have changed and should be recomputed and force a | |
733 // resize message. | |
734 bool screen_info_out_of_date_; | |
735 | |
736 // The current size of the RenderWidget. | 723 // The current size of the RenderWidget. |
737 gfx::Size current_size_; | 724 gfx::Size current_size_; |
738 | 725 |
739 // Resize information that was previously sent to the renderer. | 726 // Resize information that was previously sent to the renderer. |
740 scoped_ptr<ViewMsg_Resize_Params> old_resize_params_; | 727 scoped_ptr<ViewMsg_Resize_Params> old_resize_params_; |
741 | 728 |
742 // The next auto resize to send. | 729 // The next auto resize to send. |
743 gfx::Size new_auto_size_; | 730 gfx::Size new_auto_size_; |
744 | 731 |
745 // True if the render widget host should track the render widget's size as | 732 // True if the render widget host should track the render widget's size as |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 bool is_focused_; | 838 bool is_focused_; |
852 | 839 |
853 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 840 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
854 | 841 |
855 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 842 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
856 }; | 843 }; |
857 | 844 |
858 } // namespace content | 845 } // namespace content |
859 | 846 |
860 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 847 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |