Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 ASH_WM_WORKSPACE_WORKSPACE_CYCLER_CONFIGURATION_H_ | |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_CYCLER_CONFIGURATION_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 | |
| 10 namespace base { | |
| 11 class ListValue; | |
| 12 } | |
| 13 | |
| 14 namespace ash { | |
| 15 | |
| 16 // Sets and retrieves properties related to cycling workspaces. | |
| 17 class ASH_EXPORT WorkspaceCyclerConfiguration { | |
| 18 public: | |
| 19 enum Property { | |
| 20 // The y offsets for the workspaces which are shallower than the selected | |
| 21 // workspace with respect to the top of the screen workarea. The offset at | |
| 22 // index 0 is for the workspace closest to the selected workspace. The size | |
| 23 // of the ListValue limits the amount of visible workspaces shallower than | |
| 24 // the selected workspace. | |
| 25 SHALLOWER_THAN_SELECTED_Y_OFFSETS, | |
| 26 | |
| 27 // The y offsets for the workspaces which are deeper than the selected | |
| 28 // workspace with respect to the bottom of the screen workarea. The offset | |
| 29 // at index 0 is for the workspace closest to the selected workspace. The | |
| 30 // size of the ListValue limits the amount of visible workspaces deeper | |
| 31 // than the selected workspace. | |
| 32 DEEPER_THAN_SELECTED_Y_OFFSETS, | |
| 33 | |
| 34 // The y offset of the selected workspace with respect to the top of the | |
| 35 // screen workarea. | |
| 36 SELECTED_Y_OFFSET, | |
| 37 | |
| 38 SELECTED_SCALE, | |
| 39 MIN_SCALE, | |
| 40 MAX_SCALE, | |
| 41 MIN_BRIGHTNESS, | |
| 42 | |
| 43 // The background opacity while the user is cycling through workspaces. | |
| 44 BACKGROUND_OPACITY, | |
| 45 | |
| 46 // The vertical scroll distance in pixels to initiate workspace cycling. | |
| 47 DISTANCE_TO_INITIATE_CYCLING, | |
| 48 | |
| 49 // The vertical scroll distance in pixels to cycle to the next / previous | |
| 50 // workspace. | |
| 51 SCROLL_DISTANCE_TO_CYCLE_TO_NEXT_WORKSPACE, | |
| 52 | |
| 53 // The ratio of the duration of the animation in milliseconds to the amount | |
| 54 // that the user has scrolled vertically in pixels. | |
| 55 // The duration of the animation is computed by: distance_scrolled * ratio | |
| 56 CYCLER_STEP_ANIMATION_DURATION_RATIO, | |
| 57 | |
| 58 // The duration in milliseconds of the animations when animating starting | |
| 59 // the cycler. | |
| 60 START_CYCLER_ANIMATION_DURATION, | |
| 61 | |
| 62 // The duration in milliseconds of the animations when animating stopping | |
| 63 // the cycler. | |
| 64 STOP_CYCLER_ANIMATION_DURATION, | |
| 65 }; | |
| 66 | |
| 67 // Returns true if the cycler is enabled. | |
|
sky
2013/02/12 18:30:56
Classes like this are a pain for testing. Primaril
| |
| 68 static bool IsCyclerEnabled(); | |
| 69 | |
| 70 // Returns true if |property| is of type base::ListValue. | |
| 71 static bool IsListProperty(Property property); | |
| 72 | |
| 73 // Sets |property| to |list_value|. | |
| 74 static void SetListValue(Property property, | |
| 75 const base::ListValue& list_value); | |
| 76 | |
| 77 // Sets |property| to |value|. | |
| 78 static void SetDouble(Property property, double value); | |
| 79 | |
| 80 // Gets the ListValue associated with |property|. | |
| 81 static const base::ListValue& GetListValue(Property property); | |
| 82 | |
| 83 // Gets the double associated with |property|. | |
| 84 static double GetDouble(Property property); | |
| 85 }; | |
|
sky
2013/02/12 18:30:56
private: DISALLOW_IMPLICIT_CONSTRUCTORS(...)
| |
| 86 | |
| 87 } // namespace ash | |
| 88 | |
| 89 #endif // ASH_WM_WORKSPACE_WORKSPACE_CYCLER_ANIMATOR_CONFIGURATION_H_ | |
| OLD | NEW |