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

Side by Side Diff: content/browser/web_contents/aura/slidable_wrapper.h

Issue 895543005: Refactor GestureNavigation to eliminate code redundancy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed some bugs related to back and forth 2nd case navigation Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_SLIDABLE_WRAPPER_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_SLIDABLE_WRAPPER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/aura/window.h"
10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/transform.h"
12
13 namespace ui {
14 class Layer;
15 class LayerAnimator;
16 }
17
18 namespace content {
19
20 // Wraps a window or a layer, exposing some of their common API to allow
21 // overscroll animations for both cases. For a window, it can either assume its
22 // ownership or not.
23 class SlidableWrapper {
24 public:
25 // Assumes ownership of the |window|.
26 explicit SlidableWrapper(scoped_ptr<aura::Window> window);
27
28 // Assumes ownership of the |layer|.
29 explicit SlidableWrapper(scoped_ptr<ui::Layer> layer);
30
31 ~SlidableWrapper();
32
33 // Returns a pointer to the underlying layer.
34 ui::Layer* GetLayer();
35
36 // Transfers ownership of the wrapped and owned |layer_|.
37 scoped_ptr<ui::Layer> AcquireLayer();
38
39 // Transfers ownership of the wrapped and owned |owned_window_|.
40 scoped_ptr<aura::Window> AcquireWindow();
41
42 // Returns the wrapped target bounds.
43 gfx::Rect GetBounds();
44
45 // Sets the wrapped target bounds.
46 void SetBounds(const gfx::Rect& bounds);
47
48 private:
49 // The wrapped layer.
50 scoped_ptr<ui::Layer> layer_;
51
52 // The wrapped and window.
53 scoped_ptr<aura::Window> window_;
54
55 DISALLOW_COPY_AND_ASSIGN(SlidableWrapper);
56 };
57
58 } // namespace content
59
60 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_SLIDABLE_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698