15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/ref_counted.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/browser/renderer_host/overscroll_controller_delegate.h"
13010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include "content/browser/renderer_host/render_view_host_delegate_view.h"
14010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include "content/browser/web_contents/web_contents_view.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_export.h"
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/aura/window_delegate.h"
17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "ui/aura/window_observer.h"
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ui/compositor/layer_animation_observer.h"
19effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch#include "ui/wm/public/drag_drop_delegate.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura {
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Window;
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ui {
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DropTargetEvent;
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace content {
30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class GestureNavSimple;
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class OverscrollNavigationOverlay;
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class RenderWidgetHostImpl;
3346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)class RenderWidgetHostViewAura;
34c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class ShadowLayerDelegate;
35c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class TouchEditableImplAura;
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebContentsViewDelegate;
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebContentsImpl;
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebDragDestDelegate;
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
40010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)class WebContentsViewAura
41010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)    : public WebContentsView,
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      public RenderViewHostDelegateView,
43010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      public OverscrollControllerDelegate,
442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      public ui::ImplicitAnimationObserver,
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      public aura::WindowDelegate,
46cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)      public aura::client::DragDropDelegate,
47cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)      public aura::WindowObserver {
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  WebContentsViewAura(WebContentsImpl* web_contents,
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                      WebContentsViewDelegate* delegate);
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
52010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  CONTENT_EXPORT void SetTouchEditableForTest(
53010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      TouchEditableImplAura* touch_editable);
54c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  class WindowObserver;
572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~WebContentsViewAura();
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SizeChangedCommon(const gfx::Size& size);
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
62f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  void EndDrag(blink::WebDragOperationsMask ops);
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)  void InstallOverscrollControllerDelegate(RenderWidgetHostViewAura* view);
65a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Creates and sets up the overlay window that will be displayed during the
672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // overscroll gesture.
682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void PrepareOverscrollWindow();
692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Sets up the content window in preparation for starting an overscroll
712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // gesture.
722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void PrepareContentWindowForOverscroll();
732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Resets any in-progress animation for the overscroll gesture. Note that this
752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // doesn't immediately reset the internal states; that happens after an
762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // animation.
772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void ResetOverscrollTransform();
782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Completes the navigation in response to a completed overscroll gesture.
802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The navigation happens after an animation (either the overlay window
812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // animates in, or the content window animates out).
822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void CompleteOverscrollNavigation(OverscrollMode mode);
832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Returns the window that should be animated for the overscroll gesture.
852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // (note that during the overscroll gesture, either the overlay window or the
862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // content window can be animated).
872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  aura::Window* GetWindowToAnimateForOverscroll();
882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Returns the amount the animating window should be translated in response to
902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // the overscroll gesture.
912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  gfx::Vector2d GetTranslationForOverscroll(int delta_x, int delta_y);
922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // A window showing the screenshot is overlayed during a navigation triggered
942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // by overscroll. This function sets this up.
952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void PrepareOverscrollNavigationOverlay();
962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Changes the brightness of the layer depending on the amount of horizontal
982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // overscroll (|delta_x|, in pixels).
992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void UpdateOverscrollWindowBrightness(float delta_x);
1002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
101c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  void AttachTouchEditableToRenderView();
102c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
103bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch  void OverscrollUpdateForWebContentsDelegate(int delta_y);
104bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3Ben Murdoch
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from WebContentsView:
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeView GetNativeView() const OVERRIDE;
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeView GetContentNativeView() const OVERRIDE;
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE;
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE;
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SizeContents(const gfx::Size& size) OVERRIDE;
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Focus() OVERRIDE;
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetInitialFocus() OVERRIDE;
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void StoreFocus() OVERRIDE;
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void RestoreFocus() OVERRIDE;
115eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  virtual DropData* GetDropData() const OVERRIDE;
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Rect GetViewBounds() const OVERRIDE;
1172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void CreateView(
1182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const gfx::Size& initial_size, gfx::NativeView context) OVERRIDE;
119010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  virtual RenderWidgetHostViewBase* CreateViewForWidget(
1202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      RenderWidgetHost* render_widget_host) OVERRIDE;
121010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
1222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      RenderWidgetHost* render_widget_host) OVERRIDE;
123a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual void SetPageTitle(const base::string16& title) OVERRIDE;
1242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE;
1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE;
1262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE;
1272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from RenderViewHostDelegateView:
1295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void ShowContextMenu(RenderFrameHost* render_frame_host,
1305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                               const ContextMenuParams& params) OVERRIDE;
131eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  virtual void StartDragging(const DropData& drop_data,
132f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                             blink::WebDragOperationsMask operations,
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             const gfx::ImageSkia& image,
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             const gfx::Vector2d& image_offset,
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             const DragEventSourceInfo& event_info) OVERRIDE;
136f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual void UpdateDragCursor(blink::WebDragOperation operation) OVERRIDE;
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void GotFocus() OVERRIDE;
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void TakeFocus(bool reverse) OVERRIDE;
1391320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  virtual void ShowDisambiguationPopup(
1401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      const gfx::Rect& target_rect,
1411320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      const SkBitmap& zoomed_bitmap,
1421320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      const base::Callback<void(ui::GestureEvent*)>& gesture_cb,
1431320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      const base::Callback<void(ui::MouseEvent*)>& mouse_cb) OVERRIDE;
1441320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  virtual void HideDisambiguationPopup() OVERRIDE;
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Overridden from OverscrollControllerDelegate:
1471e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual gfx::Rect GetVisibleBounds() const OVERRIDE;
14803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)  virtual bool OnOverscrollUpdate(float delta_x, float delta_y) OVERRIDE;
1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) OVERRIDE;
1502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnOverscrollModeChange(OverscrollMode old_mode,
1512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                      OverscrollMode new_mode) OVERRIDE;
1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Overridden from ui::ImplicitAnimationObserver:
1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnImplicitAnimationsCompleted() OVERRIDE;
1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from aura::WindowDelegate:
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Size GetMinimumSize() const OVERRIDE;
1582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Size GetMaximumSize() const OVERRIDE;
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                               const gfx::Rect& new_bounds) OVERRIDE;
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE;
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE;
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool ShouldDescendIntoChildForEventHandling(
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      aura::Window* child,
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const gfx::Point& location) OVERRIDE;
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool CanFocus() OVERRIDE;
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnCaptureLost() OVERRIDE;
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
170a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
171a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE;
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool HasHitTestMask() const OVERRIDE;
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE;
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from ui::EventHandler:
1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from aura::client::DragDropDelegate:
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDragExited() OVERRIDE;
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
186cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // Overridden from aura::WindowObserver:
187cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  virtual void OnWindowVisibilityChanged(aura::Window* window,
188cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)                                         bool visible) OVERRIDE;
189cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
190116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  // Update the web contents visiblity.
191116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  void UpdateWebContentsVisibility(bool visible);
192116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<aura::Window> window_;
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The window that shows the screenshot of the history page during an
1962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // overscroll navigation gesture.
1972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<aura::Window> overscroll_window_;
1982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<WindowObserver> window_observer_;
2002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The WebContentsImpl whose contents we display.
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  WebContentsImpl* web_contents_;
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<WebContentsViewDelegate> delegate_;
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
206f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  blink::WebDragOperationsMask current_drag_op_;
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
208eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  scoped_ptr<DropData> current_drop_data_;
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  WebDragDestDelegate* drag_dest_delegate_;
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // We keep track of the render view host we're dragging over.  If it changes
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // during a drag, we need to re-send the DragEnter message.  WARNING:
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // this pointer should never be dereferenced.  We only use it for comparing
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // pointers.
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void* current_rvh_for_drag_;
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  bool overscroll_change_brightness_;
2192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The overscroll gesture currently in progress.
2212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  OverscrollMode current_overscroll_gesture_;
2222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // This is the completed overscroll gesture. This is used for the animation
2242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // callback that happens in response to a completed overscroll gesture.
2252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  OverscrollMode completed_overscroll_gesture_;
2262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // This manages the overlay window that shows the screenshot during a history
2282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // navigation triggered by the overscroll gesture.
2292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_;
2302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
231c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  scoped_ptr<ShadowLayerDelegate> overscroll_shadow_;
232c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
233c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  scoped_ptr<TouchEditableImplAura> touch_editable_;
234a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  scoped_ptr<GestureNavSimple> gesture_nav_simple_;
235c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
236116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  // On Windows we can run into problems if resources get released within the
237116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  // initialization phase while the content (and its dimensions) are not known.
238116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  bool is_or_was_visible_;
239116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura);
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace content
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
246