| 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_VIEW_AURA_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 // Should construct only via RenderWidgetHostView::CreateViewForWidget. | 178 // Should construct only via RenderWidgetHostView::CreateViewForWidget. |
| 179 explicit RenderWidgetHostViewAura(content::RenderWidgetHost* host); | 179 explicit RenderWidgetHostViewAura(content::RenderWidgetHost* host); |
| 180 | 180 |
| 181 private: | 181 private: |
| 182 class WindowObserver; | 182 class WindowObserver; |
| 183 friend class WindowObserver; | 183 friend class WindowObserver; |
| 184 | 184 |
| 185 // Overridden from ui::CompositorObserver: | 185 // Overridden from ui::CompositorObserver: |
| 186 virtual void OnCompositingStarted(ui::Compositor* compositor) OVERRIDE; | 186 virtual void OnCompositingStarted(ui::Compositor* compositor) OVERRIDE; |
| 187 virtual void OnCompositingWillEnd(ui::Compositor* compositor) OVERRIDE; |
| 187 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; | 188 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; |
| 188 | 189 |
| 189 // Overridden from ImageTransportFactoryObserver: | 190 // Overridden from ImageTransportFactoryObserver: |
| 190 virtual void OnLostResources(ui::Compositor* compositor) OVERRIDE; | 191 virtual void OnLostResources(ui::Compositor* compositor) OVERRIDE; |
| 191 | 192 |
| 192 void UpdateCursorIfOverSelf(); | 193 void UpdateCursorIfOverSelf(); |
| 193 void UpdateExternalTexture(); | 194 void UpdateExternalTexture(); |
| 194 ui::InputMethod* GetInputMethod() const; | 195 ui::InputMethod* GetInputMethod() const; |
| 195 | 196 |
| 196 // Returns whether the widget needs an input grab to work properly. | 197 // Returns whether the widget needs an input grab to work properly. |
| 197 bool NeedsInputGrab(); | 198 bool NeedsInputGrab(); |
| 198 | 199 |
| 199 // Confirm existing composition text in the webpage and ask the input method | 200 // Confirm existing composition text in the webpage and ask the input method |
| 200 // to cancel its ongoing composition session. | 201 // to cancel its ongoing composition session. |
| 201 void FinishImeCompositionSession(); | 202 void FinishImeCompositionSession(); |
| 202 | 203 |
| 203 // This method computes movementX/Y and keeps track of mouse location for | 204 // This method computes movementX/Y and keeps track of mouse location for |
| 204 // mouse lock on all mouse move events. | 205 // mouse lock on all mouse move events. |
| 205 void ModifyEventMovementAndCoords(WebKit::WebMouseEvent* event); | 206 void ModifyEventMovementAndCoords(WebKit::WebMouseEvent* event); |
| 206 | 207 |
| 207 // If |clip| is non-empty and and doesn't contain |rect| or |clip| is empty | 208 // If |clip| is non-empty and and doesn't contain |rect| or |clip| is empty |
| 208 // SchedulePaint() is invoked for |rect|. | 209 // SchedulePaint() is invoked for |rect|. |
| 209 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); | 210 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); |
| 210 | 211 |
| 211 // Helper method to determine if, in mouse locked mode, the cursor should be | 212 // Helper method to determine if, in mouse locked mode, the cursor should be |
| 212 // moved to center. | 213 // moved to center. |
| 213 bool ShouldMoveToCenter(); | 214 bool ShouldMoveToCenter(); |
| 214 | 215 |
| 215 // Run the compositing callbacks. | 216 // If compositor == NULL, run all the compositing callbacks. Otherwise, |
| 216 void RunCompositingCallbacks(); | 217 // only run the callbacks that were waiting for |
| 218 // compositor->last_will_end_id(). |
| 219 void RunCompositingCallbacks(ui::Compositor* compositor); |
| 217 | 220 |
| 218 // Called when window_ is removed from the window tree. | 221 // Called when window_ is removed from the window tree. |
| 219 void RemovingFromRootWindow(); | 222 void RemovingFromRootWindow(); |
| 220 | 223 |
| 221 ui::Compositor* GetCompositor(); | 224 ui::Compositor* GetCompositor(); |
| 222 | 225 |
| 223 // The model object. | 226 // The model object. |
| 224 content::RenderWidgetHostImpl* host_; | 227 content::RenderWidgetHostImpl* host_; |
| 225 | 228 |
| 226 aura::Window* window_; | 229 aura::Window* window_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Rectangles before and after the selection. | 262 // Rectangles before and after the selection. |
| 260 gfx::Rect selection_start_rect_; | 263 gfx::Rect selection_start_rect_; |
| 261 gfx::Rect selection_end_rect_; | 264 gfx::Rect selection_end_rect_; |
| 262 | 265 |
| 263 // Indicates if there is onging composition text. | 266 // Indicates if there is onging composition text. |
| 264 bool has_composition_text_; | 267 bool has_composition_text_; |
| 265 | 268 |
| 266 // Current tooltip text. | 269 // Current tooltip text. |
| 267 string16 tooltip_; | 270 string16 tooltip_; |
| 268 | 271 |
| 269 std::vector< base::Callback<void(void)> > on_compositing_ended_callbacks_; | 272 // Callback and the number of the will end composite that it should run on. |
| 273 typedef std::pair<base::Callback<void(void)>, int> |
| 274 CallbackAndCompositeNumber; |
| 275 std::vector<CallbackAndCompositeNumber> on_compositing_will_end_callbacks_; |
| 270 | 276 |
| 271 std::map<uint64, scoped_refptr<ImageTransportClient> > | 277 std::map<uint64, scoped_refptr<ImageTransportClient> > |
| 272 image_transport_clients_; | 278 image_transport_clients_; |
| 273 | 279 |
| 274 uint64 current_surface_; | 280 uint64 current_surface_; |
| 275 | 281 |
| 276 gfx::GLSurfaceHandle shared_surface_handle_; | 282 gfx::GLSurfaceHandle shared_surface_handle_; |
| 277 | 283 |
| 278 // If non-NULL we're in OnPaint() and this is the supplied canvas. | 284 // If non-NULL we're in OnPaint() and this is the supplied canvas. |
| 279 gfx::Canvas* paint_canvas_; | 285 gfx::Canvas* paint_canvas_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 302 // These locks are the ones waiting for a texture of the right size to come | 308 // These locks are the ones waiting for a texture of the right size to come |
| 303 // back from the renderer/GPU process. | 309 // back from the renderer/GPU process. |
| 304 std::vector<linked_ptr<ResizeLock> > resize_locks_; | 310 std::vector<linked_ptr<ResizeLock> > resize_locks_; |
| 305 // These locks are the ones waiting for a frame to be drawn. | 311 // These locks are the ones waiting for a frame to be drawn. |
| 306 std::vector<linked_ptr<ResizeLock> > locks_pending_draw_; | 312 std::vector<linked_ptr<ResizeLock> > locks_pending_draw_; |
| 307 | 313 |
| 308 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 314 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 309 }; | 315 }; |
| 310 | 316 |
| 311 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 317 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |