Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: content/browser/web_contents/aura/overscroll_navigation_overlay.h

Issue 895543005: Refactor GestureNavigation to eliminate code redundancy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/aura/overscroll_navigation_overlay.h
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.h b/content/browser/web_contents/aura/overscroll_navigation_overlay.h
index db9871c024981ff908b20bfd9b2ed1baddcc6eaa..5ff57afc7daacaeb462674dacc1d2a88d2d892f0 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay.h
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.h
@@ -8,8 +8,10 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "content/browser/web_contents/aura/window_slider.h"
+#include "content/browser/web_contents/web_contents_view_aura.h"
#include "content/common/content_export.h"
#include "content/public/browser/web_contents_observer.h"
+#include "ui/gfx/image/image.h"
struct ViewHostMsg_UpdateRect_Params;
@@ -31,7 +33,11 @@ class CONTENT_EXPORT OverscrollNavigationOverlay
: public WebContentsObserver,
public WindowSlider::Delegate {
public:
- explicit OverscrollNavigationOverlay(WebContentsImpl* web_contents);
+ // TODO move this somewhere else.
+ enum Direction { FORWARD, BACKWARD, NONE };
+
+ explicit OverscrollNavigationOverlay(WebContentsImpl* web_contents,
+ WebContentsViewAura* wcva);
~OverscrollNavigationOverlay() override;
bool has_window() const { return !!window_.get(); }
@@ -51,6 +57,14 @@ class CONTENT_EXPORT OverscrollNavigationOverlay
void SetOverlayWindow(scoped_ptr<aura::Window> window,
aura_extra::ImageWindowDelegate* delegate);
+ const gfx::Image GetImageForDirection(Direction direction);
+
+ // Creates a layer with a screenshot for a given direction.
+ scoped_ptr<ui::Layer> CreateLayerForDirection(Direction direction);
+
+ Direction GetNavigationDirection(const NavigationController& controller,
+ OverscrollMode mode);
+
private:
friend class OverscrollNavigationOverlayTest;
FRIEND_TEST_ALL_PREFIXES(OverscrollNavigationOverlayTest,
@@ -123,6 +137,9 @@ class CONTENT_EXPORT OverscrollNavigationOverlay
// The LayerDelegate used for the back/front layers during a slide.
scoped_ptr<ImageLayerDelegate> layer_delegate_;
+ // TODO use a delegate.
+ WebContentsViewAura* wcva_;
+
DISALLOW_COPY_AND_ASSIGN(OverscrollNavigationOverlay);
};

Powered by Google App Engine
This is Rietveld 408576698