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

Side by Side Diff: athena/home/home_card_gesture_manager.h

Issue 529813002: Simplify HomeCardGestureManager::UpdateScrollState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | athena/home/home_card_impl.cc » ('j') | athena/home/home_card_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_HOME_HOME_CARD_GESTURE_MANAGER_H_ 5 #ifndef ATHENA_HOME_HOME_CARD_GESTURE_MANAGER_H_
6 #define ATHENA_HOME_HOME_CARD_GESTURE_MANAGER_H_ 6 #define ATHENA_HOME_HOME_CARD_GESTURE_MANAGER_H_
7 7
8 #include "athena/home/public/home_card.h" 8 #include "athena/home/public/home_card.h"
9 #include "athena/athena_export.h" 9 #include "athena/athena_export.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
11 11
12 namespace ui { 12 namespace ui {
13 class GestureEvent; 13 class GestureEvent;
14 } 14 }
15 15
16 namespace athena { 16 namespace athena {
17 17
18 // Handles the touch gestures over the home card. 18 // Handles the touch gestures over the home card.
19 class ATHENA_EXPORT HomeCardGestureManager { 19 class ATHENA_EXPORT HomeCardGestureManager {
20 public: 20 public:
21 class Delegate { 21 class Delegate {
22 public: 22 public:
23 // Called when the gesture has ended. The state of the home card will 23 // Called when the gesture has ended. The state of the home card will
24 // end up with |final_state|. 24 // end up with |final_state|.
25 virtual void OnGestureEnded(HomeCard::State final_state) = 0; 25 virtual void OnGestureEnded(HomeCard::State final_state) = 0;
26 26
27 // Called when the gesture position is updated so that |delegate| should 27 // Called when the gesture position is updated so that |delegate| updates
28 // update the visual. The arguments represent the state of the current 28 // the visual. The arguments indicate that the gesture is switching from
29 // gesture position is switching from |from_state| to |to_state|, and 29 // |from_state| to |to_state|, and that the level of progress is at
30 // the level of the progress is at |progress|, which is 0 to 1. 30 // |progress|, which is 0 to 1.
31 // |from_state| and |to_state| could be same. For example, if the user moves 31 // |from_state| may be equal to |to_state| but only if
Jun Mukai 2014/09/02 03:51:42 I think from_state could be equal to to_state and
pkotwicz 2014/09/02 04:41:32 With the current implementation of UpdateScrollSta
32 // the finger down to the bottom of the screen, both states are MINIMIZED. 32 // |from_state| == VISIBLE_MINIMIZED. This occurs if the user moves their
33 // In that case |progress| is 0. 33 // finger to the bottom of the screen.
34 virtual void OnGestureProgressed( 34 virtual void OnGestureProgressed(
35 HomeCard::State from_state, 35 HomeCard::State from_state,
36 HomeCard::State to_state, 36 HomeCard::State to_state,
37 float progress) = 0; 37 float progress) = 0;
38 }; 38 };
39 39
40 HomeCardGestureManager(Delegate* delegate, 40 HomeCardGestureManager(Delegate* delegate,
41 const gfx::Rect& screen_bounds); 41 const gfx::Rect& screen_bounds);
42 ~HomeCardGestureManager(); 42 ~HomeCardGestureManager();
43 43
(...skipping 18 matching lines...) Expand all
62 62
63 // The bounds of the screen to compute the home card bounds. 63 // The bounds of the screen to compute the home card bounds.
64 gfx::Rect screen_bounds_; 64 gfx::Rect screen_bounds_;
65 65
66 DISALLOW_COPY_AND_ASSIGN(HomeCardGestureManager); 66 DISALLOW_COPY_AND_ASSIGN(HomeCardGestureManager);
67 }; 67 };
68 68
69 } // namespace athena 69 } // namespace athena
70 70
71 #endif // ATHENA_HOME_HOME_CARD_GESTURE_MANAGER_H_ 71 #endif // ATHENA_HOME_HOME_CARD_GESTURE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | athena/home/home_card_impl.cc » ('j') | athena/home/home_card_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698