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

Side by Side Diff: athena/wm/bezel_controller.h

Issue 545393002: Adding split view divider widget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Getting rid of divider_window, addressing tdanderson's feedback. Created 6 years, 3 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ATHENA_WM_BEZEL_CONTROLLER_H_ 5 #ifndef ATHENA_WM_BEZEL_CONTROLLER_H_
6 #define ATHENA_WM_BEZEL_CONTROLLER_H_ 6 #define ATHENA_WM_BEZEL_CONTROLLER_H_
7 7
8 #include "ui/events/event_handler.h" 8 #include "ui/events/event_handler.h"
9 9
10 namespace aura { 10 namespace aura {
(...skipping 19 matching lines...) Expand all
30 // Responsible for handling scroll gestures initiated from the bezel. 30 // Responsible for handling scroll gestures initiated from the bezel.
31 // Two touch points are need to perform the bezel scroll gesture from 31 // Two touch points are need to perform the bezel scroll gesture from
32 // the left and right bezel. 32 // the left and right bezel.
33 class ScrollDelegate { 33 class ScrollDelegate {
34 public: 34 public:
35 virtual ~ScrollDelegate() {} 35 virtual ~ScrollDelegate() {}
36 36
37 // Beginning of a bezel scroll gesture started from the |bezel|. 37 // Beginning of a bezel scroll gesture started from the |bezel|.
38 // |delta| is the difference between the x-coordinate of the current scroll 38 // |delta| is the difference between the x-coordinate of the current scroll
39 // position and the bezel. It will be zero or negative for the right bezel. 39 // position and the bezel. It will be zero or negative for the right bezel.
40 virtual void ScrollBegin(Bezel bezel, float delta) = 0; 40 virtual void ScrollBegin(Bezel bezel, float delta) = 0;
pkotwicz 2014/09/16 20:02:47 For the sake of clarity, you use rename ScrollBegi
mfomitchev 2014/09/22 21:10:59 Done.
41 41
42 // End of the current bezel scroll 42 // End of the current bezel scroll
43 virtual void ScrollEnd() = 0; 43 virtual void ScrollEnd() = 0;
44 44
45 // Update of the scroll position for the currently active bezel scroll. 45 // Update of the scroll position for the currently active bezel scroll.
46 // |delta| has the same meaning as in ScrollBegin(). 46 // |delta| has the same meaning as in ScrollBegin().
47 virtual void ScrollUpdate(float delta) = 0; 47 virtual void ScrollUpdate(float delta) = 0;
48 48
49 // Should return false if the delegate isn't going to react to the scroll 49 // Should return false if the delegate isn't going to react to the scroll
50 // events. 50 // events.
(...skipping 17 matching lines...) Expand all
68 BEZEL_GESTURE_STARTED, 68 BEZEL_GESTURE_STARTED,
69 BEZEL_SCROLLING_ONE_FINGER, 69 BEZEL_SCROLLING_ONE_FINGER,
70 BEZEL_SCROLLING_TWO_FINGERS, 70 BEZEL_SCROLLING_TWO_FINGERS,
71 }; 71 };
72 72
73 void SetState(State state); 73 void SetState(State state);
74 // |scroll_delta| only needs to be passed when |state| is one of the 74 // |scroll_delta| only needs to be passed when |state| is one of the
75 // BEZEL_SROLLING states. 75 // BEZEL_SROLLING states.
76 void SetState(State state, float scroll_delta); 76 void SetState(State state, float scroll_delta);
77 77
78 // Returns the bezel corresponding to the |location| or BEZEL_NONE if the
79 // location is outside of the bezel area.
80 Bezel GetBezel(const gfx::PointF& location);
81
82 // ui::EventHandler overrides 78 // ui::EventHandler overrides
83 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 79 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
84 80
85 aura::Window* container_; 81 aura::Window* container_;
86 82
87 State state_; 83 State state_;
88 84
89 // The bezel where the currently active scroll was started. 85 // The bezel where the currently active scroll was started.
90 Bezel scroll_bezel_; 86 Bezel scroll_bezel_;
91 87
92 // The target of the bezel scroll gesture. Used to filter out other gestures 88 // The target of the bezel scroll gesture. Used to filter out other gestures
93 // when the bezel scroll is in progress. 89 // when the bezel scroll is in progress.
94 ui::EventTarget* scroll_target_; 90 ui::EventTarget* scroll_target_;
95 91
96 // Responsible for handling gestures started from the left and right bezels. 92 // Responsible for handling gestures started from the left and right bezels.
97 // Not owned. 93 // Not owned.
98 ScrollDelegate* left_right_delegate_; 94 ScrollDelegate* left_right_delegate_;
99 95
100 DISALLOW_COPY_AND_ASSIGN(BezelController); 96 DISALLOW_COPY_AND_ASSIGN(BezelController);
101 }; 97 };
102 98
103 } // namespace athena 99 } // namespace athena
104 100
105 #endif // ATHENA_WM_BEZEL_CONTROLLER_H_ 101 #endif // ATHENA_WM_BEZEL_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698