| 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_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Window; | 21 class Window; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 class DropTargetEvent; | 25 class DropTargetEvent; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class OverscrollNavigationOverlay; | 29 class OverscrollNavigationOverlay; |
| 30 class ShadowWindow; | 30 class ShadowWindow; |
| 31 class TouchEditableImplAura; |
| 31 class WebContentsViewDelegate; | 32 class WebContentsViewDelegate; |
| 32 class WebContentsImpl; | 33 class WebContentsImpl; |
| 33 class WebDragDestDelegate; | 34 class WebDragDestDelegate; |
| 34 | 35 |
| 35 class CONTENT_EXPORT WebContentsViewAura | 36 class CONTENT_EXPORT WebContentsViewAura |
| 36 : public WebContentsViewPort, | 37 : public WebContentsViewPort, |
| 37 public RenderViewHostDelegateView, | 38 public RenderViewHostDelegateView, |
| 38 NON_EXPORTED_BASE(public OverscrollControllerDelegate), | 39 NON_EXPORTED_BASE(public OverscrollControllerDelegate), |
| 39 public ui::ImplicitAnimationObserver, | 40 public ui::ImplicitAnimationObserver, |
| 40 public aura::WindowDelegate, | 41 public aura::WindowDelegate, |
| 41 public aura::client::DragDropDelegate { | 42 public aura::client::DragDropDelegate { |
| 42 public: | 43 public: |
| 43 WebContentsViewAura(WebContentsImpl* web_contents, | 44 WebContentsViewAura(WebContentsImpl* web_contents, |
| 44 WebContentsViewDelegate* delegate); | 45 WebContentsViewDelegate* delegate); |
| 45 | 46 |
| 46 void SetupOverlayWindowForTesting(); | 47 void SetupOverlayWindowForTesting(); |
| 47 | 48 |
| 49 void SetTouchEditableForTest(TouchEditableImplAura* touch_editable); |
| 50 |
| 48 private: | 51 private: |
| 49 class WindowObserver; | 52 class WindowObserver; |
| 50 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 51 class ChildWindowObserver; | 54 class ChildWindowObserver; |
| 52 #endif | 55 #endif |
| 53 | 56 |
| 54 virtual ~WebContentsViewAura(); | 57 virtual ~WebContentsViewAura(); |
| 55 | 58 |
| 56 void SizeChangedCommon(const gfx::Size& size); | 59 void SizeChangedCommon(const gfx::Size& size); |
| 57 | 60 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 gfx::Vector2d GetTranslationForOverscroll(int delta_x, int delta_y); | 88 gfx::Vector2d GetTranslationForOverscroll(int delta_x, int delta_y); |
| 86 | 89 |
| 87 // A window showing the screenshot is overlayed during a navigation triggered | 90 // A window showing the screenshot is overlayed during a navigation triggered |
| 88 // by overscroll. This function sets this up. | 91 // by overscroll. This function sets this up. |
| 89 void PrepareOverscrollNavigationOverlay(); | 92 void PrepareOverscrollNavigationOverlay(); |
| 90 | 93 |
| 91 // Changes the brightness of the layer depending on the amount of horizontal | 94 // Changes the brightness of the layer depending on the amount of horizontal |
| 92 // overscroll (|delta_x|, in pixels). | 95 // overscroll (|delta_x|, in pixels). |
| 93 void UpdateOverscrollWindowBrightness(float delta_x); | 96 void UpdateOverscrollWindowBrightness(float delta_x); |
| 94 | 97 |
| 98 void AttachTouchEditableToRenderView(); |
| 99 |
| 95 // Overridden from WebContentsView: | 100 // Overridden from WebContentsView: |
| 96 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 101 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| 97 virtual gfx::NativeView GetContentNativeView() const OVERRIDE; | 102 virtual gfx::NativeView GetContentNativeView() const OVERRIDE; |
| 98 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; | 103 virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; |
| 99 virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE; | 104 virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE; |
| 100 virtual void OnTabCrashed(base::TerminationStatus status, | 105 virtual void OnTabCrashed(base::TerminationStatus status, |
| 101 int error_code) OVERRIDE; | 106 int error_code) OVERRIDE; |
| 102 virtual void SizeContents(const gfx::Size& size) OVERRIDE; | 107 virtual void SizeContents(const gfx::Size& size) OVERRIDE; |
| 103 virtual void Focus() OVERRIDE; | 108 virtual void Focus() OVERRIDE; |
| 104 virtual void SetInitialFocus() OVERRIDE; | 109 virtual void SetInitialFocus() OVERRIDE; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 OverscrollMode current_overscroll_gesture_; | 222 OverscrollMode current_overscroll_gesture_; |
| 218 | 223 |
| 219 // This is the completed overscroll gesture. This is used for the animation | 224 // This is the completed overscroll gesture. This is used for the animation |
| 220 // callback that happens in response to a completed overscroll gesture. | 225 // callback that happens in response to a completed overscroll gesture. |
| 221 OverscrollMode completed_overscroll_gesture_; | 226 OverscrollMode completed_overscroll_gesture_; |
| 222 | 227 |
| 223 // This manages the overlay window that shows the screenshot during a history | 228 // This manages the overlay window that shows the screenshot during a history |
| 224 // navigation triggered by the overscroll gesture. | 229 // navigation triggered by the overscroll gesture. |
| 225 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; | 230 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; |
| 226 | 231 |
| 232 scoped_ptr<TouchEditableImplAura> touch_editable_; |
| 233 |
| 227 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 234 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
| 228 }; | 235 }; |
| 229 | 236 |
| 230 } // namespace content | 237 } // namespace content |
| 231 | 238 |
| 232 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 239 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
| OLD | NEW |