| 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 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 13 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "ui/aura/client/activation_delegate.h" | 15 #include "ui/aura/client/activation_delegate.h" |
| 16 #include "ui/aura/window_delegate.h" | 16 #include "ui/aura/window_delegate.h" |
| 17 #include "ui/base/ime/text_input_client.h" | 17 #include "ui/base/ime/text_input_client.h" |
| 18 #include "ui/gfx/compositor/compositor_observer.h" | 18 #include "ui/gfx/compositor/compositor_observer.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "webkit/glue/webcursor.h" | 20 #include "webkit/glue/webcursor.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 class RenderWidgetHostImpl; |
| 23 class RenderWidgetHostView; | 24 class RenderWidgetHostView; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace gfx { | 27 namespace gfx { |
| 27 class Canvas; | 28 class Canvas; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace ui { | 31 namespace ui { |
| 31 class InputMethod; | 32 class InputMethod; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace WebKit { | 35 namespace WebKit { |
| 35 class WebTouchEvent; | 36 class WebTouchEvent; |
| 36 } | 37 } |
| 37 | 38 |
| 38 class RenderWidgetHostImpl; | |
| 39 class ImageTransportClient; | 39 class ImageTransportClient; |
| 40 | 40 |
| 41 class RenderWidgetHostViewAura | 41 class RenderWidgetHostViewAura |
| 42 : public content::RenderWidgetHostViewBase, | 42 : public content::RenderWidgetHostViewBase, |
| 43 public ui::CompositorObserver, | 43 public ui::CompositorObserver, |
| 44 public ui::TextInputClient, | 44 public ui::TextInputClient, |
| 45 public aura::WindowDelegate, | 45 public aura::WindowDelegate, |
| 46 public aura::client::ActivationDelegate { | 46 public aura::client::ActivationDelegate { |
| 47 public: | 47 public: |
| 48 virtual ~RenderWidgetHostViewAura(); | 48 virtual ~RenderWidgetHostViewAura(); |
| 49 | 49 |
| 50 // RenderWidgetHostView implementation. | 50 // RenderWidgetHostView implementation. |
| 51 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 51 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| 52 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; | 52 virtual content::RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
| 53 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 53 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 54 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; | 54 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; |
| 55 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 55 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| 56 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 56 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
| 57 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 57 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
| 58 virtual bool HasFocus() const OVERRIDE; | 58 virtual bool HasFocus() const OVERRIDE; |
| 59 virtual void Show() OVERRIDE; | 59 virtual void Show() OVERRIDE; |
| 60 virtual void Hide() OVERRIDE; | 60 virtual void Hide() OVERRIDE; |
| 61 virtual bool IsShowing() OVERRIDE; | 61 virtual bool IsShowing() OVERRIDE; |
| 62 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 62 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // Overridden from aura::client::ActivationDelegate: | 160 // Overridden from aura::client::ActivationDelegate: |
| 161 virtual bool ShouldActivate(aura::Event* event) OVERRIDE; | 161 virtual bool ShouldActivate(aura::Event* event) OVERRIDE; |
| 162 virtual void OnActivated() OVERRIDE; | 162 virtual void OnActivated() OVERRIDE; |
| 163 virtual void OnLostActive() OVERRIDE; | 163 virtual void OnLostActive() OVERRIDE; |
| 164 | 164 |
| 165 protected: | 165 protected: |
| 166 friend class content::RenderWidgetHostView; | 166 friend class content::RenderWidgetHostView; |
| 167 | 167 |
| 168 // Should construct only via RenderWidgetHostView::CreateViewForWidget. | 168 // Should construct only via RenderWidgetHostView::CreateViewForWidget. |
| 169 explicit RenderWidgetHostViewAura(RenderWidgetHost* host); | 169 explicit RenderWidgetHostViewAura(content::RenderWidgetHost* host); |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 class WindowObserver; | 172 class WindowObserver; |
| 173 friend class WindowObserver; | 173 friend class WindowObserver; |
| 174 | 174 |
| 175 // Overridden from ui::CompositorObserver: | 175 // Overridden from ui::CompositorObserver: |
| 176 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; | 176 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; |
| 177 | 177 |
| 178 void UpdateCursorIfOverSelf(); | 178 void UpdateCursorIfOverSelf(); |
| 179 void UpdateExternalTexture(); | 179 void UpdateExternalTexture(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 194 // SchedulePaint() is invoked for |rect|. | 194 // SchedulePaint() is invoked for |rect|. |
| 195 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); | 195 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); |
| 196 | 196 |
| 197 // Helper method to determine if, in mouse locked mode, the cursor should be | 197 // Helper method to determine if, in mouse locked mode, the cursor should be |
| 198 // moved to center. | 198 // moved to center. |
| 199 bool ShouldMoveToCenter(); | 199 bool ShouldMoveToCenter(); |
| 200 | 200 |
| 201 ui::Compositor* GetCompositor(); | 201 ui::Compositor* GetCompositor(); |
| 202 | 202 |
| 203 // The model object. | 203 // The model object. |
| 204 RenderWidgetHostImpl* host_; | 204 content::RenderWidgetHostImpl* host_; |
| 205 | 205 |
| 206 aura::Window* window_; | 206 aura::Window* window_; |
| 207 | 207 |
| 208 scoped_ptr<WindowObserver> window_observer_; | 208 scoped_ptr<WindowObserver> window_observer_; |
| 209 | 209 |
| 210 // Is this a fullscreen view? | 210 // Is this a fullscreen view? |
| 211 bool is_fullscreen_; | 211 bool is_fullscreen_; |
| 212 | 212 |
| 213 // Our parent host view, if this is a popup. NULL otherwise. | 213 // Our parent host view, if this is a popup. NULL otherwise. |
| 214 RenderWidgetHostViewAura* popup_parent_host_view_; | 214 RenderWidgetHostViewAura* popup_parent_host_view_; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // In mouse locked mode, we syntheticaly move the mouse cursor to the center | 265 // In mouse locked mode, we syntheticaly move the mouse cursor to the center |
| 266 // of the window when it reaches the window borders to avoid it going outside. | 266 // of the window when it reaches the window borders to avoid it going outside. |
| 267 // This flag is used to differentiate between these synthetic mouse move | 267 // This flag is used to differentiate between these synthetic mouse move |
| 268 // events vs. normal mouse move events. | 268 // events vs. normal mouse move events. |
| 269 bool synthetic_move_sent_; | 269 bool synthetic_move_sent_; |
| 270 | 270 |
| 271 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 271 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 274 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |