blob: 861b25b90d82df241f3430cd519d46b18de90160 [file] [log] [blame]
[email protected]1b62b892012-01-17 17:08:151// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]4bb16502011-12-06 14:44:582// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]478c6c32013-03-09 02:50:585#ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
6#define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
[email protected]4bb16502011-12-06 14:44:587
[email protected]6c4ad7e2013-06-07 19:57:588#include <vector>
9
[email protected]27f6af62012-03-21 05:34:4010#include "ash/ash_export.h"
[email protected]478c6c32013-03-09 02:50:5811#include "ash/shelf/background_animator.h"
[email protected]864b58552013-12-19 04:19:3812#include "ash/shelf/shelf.h"
[email protected]478c6c32013-03-09 02:50:5813#include "ash/shelf/shelf_types.h"
[email protected]8e43cdf42012-05-11 17:03:3114#include "ash/shell_observer.h"
[email protected]478c6c32013-03-09 02:50:5815#include "ash/system/status_area_widget.h"
[email protected]7115bd32013-07-19 08:25:3916#include "ash/wm/dock/docked_window_layout_manager_observer.h"
[email protected]09550682013-09-10 16:23:2817#include "ash/wm/lock_state_observer.h"
[email protected]a3e412712013-07-11 09:32:5818#include "ash/wm/workspace/workspace_types.h"
[email protected]4bb16502011-12-06 14:44:5819#include "base/basictypes.h"
20#include "base/compiler_specific.h"
[email protected]1fcfb992012-12-05 01:47:2321#include "base/logging.h"
[email protected]cbc278f2012-07-10 03:40:2122#include "base/observer_list.h"
[email protected]1e84c632013-06-27 23:12:2123#include "base/timer/timer.h"
[email protected]1ae361652012-12-12 22:39:5124#include "ui/aura/client/activation_change_observer.h"
[email protected]4bb16502011-12-06 14:44:5825#include "ui/aura/layout_manager.h"
[email protected]4bb16502011-12-06 14:44:5826#include "ui/gfx/insets.h"
27#include "ui/gfx/rect.h"
[email protected]5416f282013-04-29 20:52:4828#include "ui/keyboard/keyboard_controller.h"
29#include "ui/keyboard/keyboard_controller_observer.h"
[email protected]4bb16502011-12-06 14:44:5830
[email protected]8676f0472012-03-29 20:30:1231namespace aura {
32class RootWindow;
33}
34
[email protected]3c6abbe2012-08-30 23:48:5735namespace ui {
36class GestureEvent;
[email protected]939464902013-08-14 23:48:1937class ImplicitAnimationObserver;
[email protected]3c6abbe2012-08-30 23:48:5738}
39
[email protected]55f593352011-12-24 05:42:4640namespace ash {
[email protected]8d625fb2012-07-18 16:40:0641class ScreenAsh;
[email protected]7841e1172013-05-07 03:53:3342class ShelfLayoutManagerObserver;
[email protected]478c6c32013-03-09 02:50:5843class ShelfWidget;
[email protected]d93c6c42013-08-14 05:04:2644FORWARD_DECLARE_TEST(WebNotificationTrayTest, PopupAndFullscreen);
45
[email protected]4bb16502011-12-06 14:44:5846namespace internal {
47
[email protected]89d3c9b02013-04-27 07:01:4248class PanelLayoutManagerTest;
[email protected]6c4ad7e2013-06-07 19:57:5849class ShelfBezelEventFilter;
[email protected]c758fbf2012-03-25 22:53:5950class ShelfLayoutManagerTest;
[email protected]88d71122012-10-18 07:11:0151class StatusAreaWidget;
[email protected]f4bb9fde2012-08-03 19:33:5052class WorkspaceController;
[email protected]c758fbf2012-03-25 22:53:5953
[email protected]864b58552013-12-19 04:19:3854// ShelfLayoutManager is the layout manager responsible for the shelf and
55// status widgets. The shelf is given the total available width and told the
56// width of the status area. This allows the shelf to draw the background and
[email protected]22f9d312011-12-15 17:38:5557// layout to the status area.
58// To respond to bounds changes in the status area StatusAreaLayoutManager works
59// closely with ShelfLayoutManager.
[email protected]e76310a92012-06-04 19:06:1160class ASH_EXPORT ShelfLayoutManager :
61 public aura::LayoutManager,
62 public ash::ShellObserver,
[email protected]5416f282013-04-29 20:52:4863 public aura::client::ActivationChangeObserver,
[email protected]7115bd32013-07-19 08:25:3964 public DockedWindowLayoutManagerObserver,
[email protected]09550682013-09-10 16:23:2865 public keyboard::KeyboardControllerObserver,
66 public LockStateObserver {
[email protected]4bb16502011-12-06 14:44:5867 public:
[email protected]7ed98952013-04-02 23:04:5068
[email protected]d3643b52013-05-01 16:00:4869 // We reserve a small area on the edge of the workspace area to ensure that
70 // the resize handle at the edge of the window can be hit.
71 static const int kWorkspaceAreaVisibleInset;
72
73 // When autohidden we extend the touch hit target onto the screen so that the
74 // user can drag the shelf out.
75 static const int kWorkspaceAreaAutoHideInset;
[email protected]bbb59f82012-03-14 04:04:3576
[email protected]55444502012-05-10 15:43:5377 // Size of the shelf when auto-hidden.
78 static const int kAutoHideSize;
[email protected]b1c37fc2012-03-22 03:36:1379
[email protected]fda64c9e2014-03-12 21:45:3280 // The size of the shelf when shown (currently only used in alternate
81 // settings see ash::switches::UseAlternateShelfLayout).
82 static const int kShelfSize;
83
[email protected]98f8f4a2013-09-19 01:21:2684 // Inset between the inner edge of the shelf (towards centre of screen), and
[email protected]864b58552013-12-19 04:19:3885 // the shelf items, notifications, status area etc.
[email protected]98f8f4a2013-09-19 01:21:2686 static const int kShelfItemInset;
87
[email protected]fda64c9e2014-03-12 21:45:3288 // Returns the preferred size for the shelf (either kShelfPreferredSize or
89 // kShelfSize).
90 static int GetPreferredShelfSize();
91
[email protected]478c6c32013-03-09 02:50:5892 explicit ShelfLayoutManager(ShelfWidget* shelf);
[email protected]4bb16502011-12-06 14:44:5893 virtual ~ShelfLayoutManager();
94
[email protected]09f3fc82012-03-26 23:26:5695 // Sets the ShelfAutoHideBehavior. See enum description for details.
96 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
97 ShelfAutoHideBehavior auto_hide_behavior() const {
98 return auto_hide_behavior_;
99 }
[email protected]c758fbf2012-03-25 22:53:59100
[email protected]c2d58b42012-05-30 08:11:29101 // Sets the alignment. Returns true if the alignment is changed. Otherwise,
102 // returns false.
103 bool SetAlignment(ShelfAlignment alignment);
[email protected]09550682013-09-10 16:23:28104 // Returns the desired alignment for the current state, either the user's
105 // set alignment (alignment_) or SHELF_ALIGNMENT_BOTTOM when the screen
106 // is locked.
107 ShelfAlignment GetAlignment() const;
[email protected]55444502012-05-10 15:43:53108
[email protected]f4bb9fde2012-08-03 19:33:50109 void set_workspace_controller(WorkspaceController* controller) {
110 workspace_controller_ = controller;
[email protected]c758fbf2012-03-25 22:53:59111 }
112
[email protected]939464902013-08-14 23:48:19113 bool updating_bounds() const { return updating_bounds_; }
[email protected]d9456cb2012-03-21 16:41:04114
[email protected]a3e412712013-07-11 09:32:58115 // Clears internal data for shutdown process.
116 void PrepareForShutdown();
117
[email protected]864b58552013-12-19 04:19:38118 // Returns whether the shelf and its contents (shelf, status) are visible
[email protected]40429f02012-03-28 20:38:50119 // on the screen.
120 bool IsVisible() const;
121
[email protected]55444502012-05-10 15:43:53122 // Returns the ideal bounds of the shelf assuming it is visible.
123 gfx::Rect GetIdealBounds();
124
[email protected]494b1ef2013-12-07 01:00:07125 // Returns the docked area bounds.
126 const gfx::Rect& dock_bounds() const { return dock_bounds_; }
127
[email protected]864b58552013-12-19 04:19:38128 // Stops any animations and sets the bounds of the shelf and status
[email protected]4bb16502011-12-06 14:44:58129 // widgets.
130 void LayoutShelf();
131
[email protected]8e837ec2013-01-31 01:48:33132 // Returns shelf visibility state based on current value of auto hide
133 // behavior setting.
134 ShelfVisibilityState CalculateShelfVisibility();
135
[email protected]c758fbf2012-03-25 22:53:59136 // Updates the visibility state.
137 void UpdateVisibilityState();
[email protected]203fe8582012-03-24 06:17:14138
[email protected]864b58552013-12-19 04:19:38139 // Invoked by the shelf when the auto-hide state may have changed.
[email protected]b1c37fc2012-03-22 03:36:13140 void UpdateAutoHideState();
141
[email protected]ef80e4302012-12-04 19:37:31142 ShelfVisibilityState visibility_state() const {
143 return state_.visibility_state;
144 }
145 ShelfAutoHideState auto_hide_state() const { return state_.auto_hide_state; }
[email protected]c758fbf2012-03-25 22:53:59146
[email protected]478c6c32013-03-09 02:50:58147 ShelfWidget* shelf_widget() { return shelf_; }
148
[email protected]27f6af62012-03-21 05:34:40149 // Sets whether any windows overlap the shelf. If a window overlaps the shelf
150 // the shelf renders slightly differently.
151 void SetWindowOverlapsShelf(bool value);
[email protected]2feee2f2012-08-24 20:43:50152 bool window_overlaps_shelf() const { return window_overlaps_shelf_; }
[email protected]27f6af62012-03-21 05:34:40153
[email protected]7841e1172013-05-07 03:53:33154 void AddObserver(ShelfLayoutManagerObserver* observer);
155 void RemoveObserver(ShelfLayoutManagerObserver* observer);
[email protected]cbc278f2012-07-10 03:40:21156
[email protected]f734b2242014-02-12 17:29:45157 // Gesture related functions:
158 void OnGestureEdgeSwipe(const ui::GestureEvent& gesture);
[email protected]3c6abbe2012-08-30 23:48:57159 void StartGestureDrag(const ui::GestureEvent& gesture);
[email protected]c8e2e832012-09-12 21:48:28160 enum DragState {
161 DRAG_SHELF,
162 DRAG_TRAY
163 };
164 // Returns DRAG_SHELF if the gesture should continue to drag the entire shelf.
165 // Returns DRAG_TRAY if the gesture can start dragging the tray-bubble from
166 // this point on.
167 DragState UpdateGestureDrag(const ui::GestureEvent& gesture);
[email protected]4982ee12012-09-04 22:16:10168 void CompleteGestureDrag(const ui::GestureEvent& gesture);
[email protected]3c6abbe2012-08-30 23:48:57169 void CancelGestureDrag();
170
[email protected]5cc1b6592014-01-28 23:21:31171 // Set an animation duration override for the show / hide animation of the
172 // shelf. Specifying 0 leads to use the default.
173 void SetAnimationDurationOverride(int duration_override_in_ms);
174
[email protected]4bb16502011-12-06 14:44:58175 // Overridden from aura::LayoutManager:
176 virtual void OnWindowResized() OVERRIDE;
177 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE;
178 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE;
[email protected]fa893ab62012-04-20 01:26:51179 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE;
[email protected]4bb16502011-12-06 14:44:58180 virtual void OnChildWindowVisibilityChanged(aura::Window* child,
181 bool visible) OVERRIDE;
182 virtual void SetChildBounds(aura::Window* child,
183 const gfx::Rect& requested_bounds) OVERRIDE;
184
[email protected]8e43cdf42012-05-11 17:03:31185 // Overridden from ash::ShellObserver:
186 virtual void OnLockStateChanged(bool locked) OVERRIDE;
187
[email protected]e76310a92012-06-04 19:06:11188 // Overriden from aura::client::ActivationChangeObserver:
[email protected]1ae361652012-12-12 22:39:51189 virtual void OnWindowActivated(aura::Window* gained_active,
190 aura::Window* lost_active) OVERRIDE;
[email protected]8676f0472012-03-29 20:30:12191
[email protected]09550682013-09-10 16:23:28192 // Overridden from ash::LockStateObserver:
193 virtual void OnLockStateEvent(LockStateObserver::EventType event) OVERRIDE;
194
[email protected]1fcfb992012-12-05 01:47:23195 // TODO(harrym|oshima): These templates will be moved to
196 // new Shelf class.
197 // A helper function that provides a shortcut for choosing
198 // values specific to a shelf alignment.
199 template<typename T>
[email protected]8572c4872013-01-12 17:16:07200 T SelectValueForShelfAlignment(T bottom, T left, T right, T top) const {
[email protected]09550682013-09-10 16:23:28201 switch (GetAlignment()) {
[email protected]1fcfb992012-12-05 01:47:23202 case SHELF_ALIGNMENT_BOTTOM:
203 return bottom;
204 case SHELF_ALIGNMENT_LEFT:
205 return left;
206 case SHELF_ALIGNMENT_RIGHT:
207 return right;
[email protected]8572c4872013-01-12 17:16:07208 case SHELF_ALIGNMENT_TOP:
209 return top;
[email protected]1fcfb992012-12-05 01:47:23210 }
211 NOTREACHED();
212 return right;
213 }
214
215 template<typename T>
216 T PrimaryAxisValue(T horizontal, T vertical) const {
217 return IsHorizontalAlignment() ? horizontal : vertical;
218 }
219
220 // Is the shelf's alignment horizontal?
221 bool IsHorizontalAlignment() const;
222
[email protected]864b58552013-12-19 04:19:38223 // Returns a ShelfLayoutManager on the display which has a shelf for
224 // given |window|. See RootWindowController::ForShelf for more info.
225 static ShelfLayoutManager* ForShelf(aura::Window* window);
[email protected]1fcfb992012-12-05 01:47:23226
[email protected]4bb16502011-12-06 14:44:58227 private:
[email protected]b1c37fc2012-03-22 03:36:13228 class AutoHideEventFilter;
[email protected]e4d9fe92012-09-10 14:04:49229 class UpdateShelfObserver;
[email protected]8d625fb2012-07-18 16:40:06230 friend class ash::ScreenAsh;
[email protected]89d3c9b02013-04-27 07:01:42231 friend class PanelLayoutManagerTest;
[email protected]c758fbf2012-03-25 22:53:59232 friend class ShelfLayoutManagerTest;
[email protected]d93c6c42013-08-14 05:04:26233 FRIEND_TEST_ALL_PREFIXES(ash::WebNotificationTrayTest, PopupAndFullscreen);
[email protected]b1c37fc2012-03-22 03:36:13234
[email protected]4bb16502011-12-06 14:44:58235 struct TargetBounds {
[email protected]9e52129b92012-08-09 16:14:30236 TargetBounds();
[email protected]478c6c32013-03-09 02:50:58237 ~TargetBounds();
[email protected]27f6af62012-03-21 05:34:40238
239 float opacity;
[email protected]e4af7c62013-06-20 08:31:55240 float status_opacity;
[email protected]478c6c32013-03-09 02:50:58241 gfx::Rect shelf_bounds_in_root;
[email protected]864b58552013-12-19 04:19:38242 gfx::Rect shelf_bounds_in_shelf;
[email protected]478c6c32013-03-09 02:50:58243 gfx::Rect status_bounds_in_shelf;
[email protected]4bb16502011-12-06 14:44:58244 gfx::Insets work_area_insets;
245 };
246
[email protected]27f6af62012-03-21 05:34:40247 struct State {
[email protected]ef80e4302012-12-04 19:37:31248 State() : visibility_state(SHELF_VISIBLE),
249 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN),
[email protected]a3e412712013-07-11 09:32:58250 window_state(WORKSPACE_WINDOW_STATE_DEFAULT),
[email protected]751444a2012-04-03 04:57:14251 is_screen_locked(false) {}
[email protected]27f6af62012-03-21 05:34:40252
253 // Returns true if the two states are considered equal. As
[email protected]ef80e4302012-12-04 19:37:31254 // |auto_hide_state| only matters if |visibility_state| is
255 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as
256 // appropriate.
[email protected]27f6af62012-03-21 05:34:40257 bool Equals(const State& other) const {
258 return other.visibility_state == visibility_state &&
[email protected]ef80e4302012-12-04 19:37:31259 (visibility_state != SHELF_AUTO_HIDE ||
[email protected]751444a2012-04-03 04:57:14260 other.auto_hide_state == auto_hide_state) &&
[email protected]a3e412712013-07-11 09:32:58261 other.window_state == window_state &&
[email protected]751444a2012-04-03 04:57:14262 other.is_screen_locked == is_screen_locked;
[email protected]27f6af62012-03-21 05:34:40263 }
264
[email protected]ef80e4302012-12-04 19:37:31265 ShelfVisibilityState visibility_state;
266 ShelfAutoHideState auto_hide_state;
[email protected]a3e412712013-07-11 09:32:58267 WorkspaceWindowState window_state;
[email protected]751444a2012-04-03 04:57:14268 bool is_screen_locked;
[email protected]27f6af62012-03-21 05:34:40269 };
270
[email protected]c758fbf2012-03-25 22:53:59271 // Sets the visibility of the shelf to |state|.
[email protected]ef80e4302012-12-04 19:37:31272 void SetState(ShelfVisibilityState visibility_state);
[email protected]c758fbf2012-03-25 22:53:59273
[email protected]864b58552013-12-19 04:19:38274 // Updates the bounds and opacity of the shelf and status widgets.
[email protected]939464902013-08-14 23:48:19275 // If |observer| is specified, it will be called back when the animations, if
276 // any, are complete.
277 void UpdateBoundsAndOpacity(const TargetBounds& target_bounds,
278 bool animate,
279 ui::ImplicitAnimationObserver* observer);
280
[email protected]f20cde92013-07-02 08:19:33281 // Stops any animations and progresses them to the end.
[email protected]4bb16502011-12-06 14:44:58282 void StopAnimating();
283
[email protected]55444502012-05-10 15:43:53284 // Returns the width (if aligned to the side) or height (if aligned to the
285 // bottom).
286 void GetShelfSize(int* width, int* height);
287
288 // Insets |bounds| by |inset| on the edge the shelf is aligned to.
289 void AdjustBoundsBasedOnAlignment(int inset, gfx::Rect* bounds) const;
290
[email protected]35304ce2011-12-14 23:21:01291 // Calculates the target bounds assuming visibility of |visible|.
[email protected]55444502012-05-10 15:43:53292 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds);
[email protected]4bb16502011-12-06 14:44:58293
[email protected]3c6abbe2012-08-30 23:48:57294 // Updates the target bounds if a gesture-drag is in progress. This is only
295 // used by |CalculateTargetBounds()|.
296 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const;
297
[email protected]a160baec2012-03-21 20:52:15298 // Updates the background of the shelf.
[email protected]494b1ef2013-12-07 01:00:07299 void UpdateShelfBackground(BackgroundAnimatorChangeType type);
[email protected]a160baec2012-03-21 20:52:15300
[email protected]a3e412712013-07-11 09:32:58301 // Returns how the shelf background is painted.
302 ShelfBackgroundType GetShelfBackgroundType() const;
[email protected]4bb16502011-12-06 14:44:58303
[email protected]b1c37fc2012-03-22 03:36:13304 // Updates the auto hide state immediately.
305 void UpdateAutoHideStateNow();
306
[email protected]dc088422013-08-07 22:57:29307 // Stops the auto hide timer and clears
308 // |mouse_over_shelf_when_auto_hide_timer_started_|.
309 void StopAutoHideTimer();
310
311 // Returns the bounds of an additional region which can trigger showing the
312 // shelf. This region exists to make it easier to trigger showing the shelf
313 // when the shelf is auto hidden and the shelf is on the boundary between
314 // two displays.
315 gfx::Rect GetAutoHideShowShelfRegionInScreen() const;
316
[email protected]864b58552013-12-19 04:19:38317 // Returns the AutoHideState. This value is determined from the shelf and
[email protected]b1c37fc2012-03-22 03:36:13318 // tray.
[email protected]ef80e4302012-12-04 19:37:31319 ShelfAutoHideState CalculateAutoHideState(
320 ShelfVisibilityState visibility_state) const;
[email protected]b1c37fc2012-03-22 03:36:13321
[email protected]5f1d99dc2012-04-12 21:42:37322 // Returns true if |window| is a descendant of the shelf.
323 bool IsShelfWindow(aura::Window* window);
324
[email protected]55444502012-05-10 15:43:53325 int GetWorkAreaSize(const State& state, int size) const;
326
[email protected]5416f282013-04-29 20:52:48327 // Return the bounds available in the parent, taking into account the bounds
328 // of the keyboard if necessary.
329 gfx::Rect GetAvailableBounds() const;
330
331 // Overridden from keyboard::KeyboardControllerObserver:
332 virtual void OnKeyboardBoundsChanging(
333 const gfx::Rect& keyboard_bounds) OVERRIDE;
334
[email protected]494b1ef2013-12-07 01:00:07335 // Overridden from DockedWindowLayoutManagerObserver:
[email protected]4d22e602013-10-16 03:48:47336 virtual void OnDockBoundsChanging(
337 const gfx::Rect& dock_bounds,
338 DockedWindowLayoutManagerObserver::Reason reason) OVERRIDE;
[email protected]7115bd32013-07-19 08:25:39339
[email protected]8676f0472012-03-29 20:30:12340 // The RootWindow is cached so that we don't invoke Shell::GetInstance() from
341 // our destructor. We avoid that as at the time we're deleted Shell is being
342 // deleted too.
[email protected]bf9cdb362013-10-25 19:22:45343 aura::Window* root_window_;
[email protected]8676f0472012-03-29 20:30:12344
[email protected]939464902013-08-14 23:48:19345 // True when inside UpdateBoundsAndOpacity() method. Used to prevent calling
346 // UpdateBoundsAndOpacity() again from SetChildBounds().
347 bool updating_bounds_;
[email protected]4bb16502011-12-06 14:44:58348
[email protected]c758fbf2012-03-25 22:53:59349 // See description above setter.
[email protected]09f3fc82012-03-26 23:26:56350 ShelfAutoHideBehavior auto_hide_behavior_;
[email protected]c758fbf2012-03-25 22:53:59351
[email protected]09550682013-09-10 16:23:28352 // See description above getter.
[email protected]55444502012-05-10 15:43:53353 ShelfAlignment alignment_;
354
[email protected]27f6af62012-03-21 05:34:40355 // Current state.
356 State state_;
[email protected]4bb16502011-12-06 14:44:58357
[email protected]478c6c32013-03-09 02:50:58358 ShelfWidget* shelf_;
[email protected]4bb16502011-12-06 14:44:58359
[email protected]f4bb9fde2012-08-03 19:33:50360 WorkspaceController* workspace_controller_;
[email protected]c758fbf2012-03-25 22:53:59361
[email protected]27f6af62012-03-21 05:34:40362 // Do any windows overlap the shelf? This is maintained by WorkspaceManager.
363 bool window_overlaps_shelf_;
364
[email protected]b1c37fc2012-03-22 03:36:13365 base::OneShotTimer<ShelfLayoutManager> auto_hide_timer_;
366
[email protected]dc088422013-08-07 22:57:29367 // Whether the mouse was over the shelf when the auto hide timer started.
368 // False when neither the auto hide timer nor the timer task are running.
369 bool mouse_over_shelf_when_auto_hide_timer_started_;
370
[email protected]864b58552013-12-19 04:19:38371 // EventFilter used to detect when user moves the mouse over the shelf to
372 // trigger showing the shelf.
[email protected]6c4ad7e2013-06-07 19:57:58373 scoped_ptr<AutoHideEventFilter> auto_hide_event_filter_;
374
375 // EventFilter used to detect when user issues a gesture on a bezel sensor.
376 scoped_ptr<ShelfBezelEventFilter> bezel_event_filter_;
[email protected]5b0ca082012-03-14 06:20:22377
[email protected]7841e1172013-05-07 03:53:33378 ObserverList<ShelfLayoutManagerObserver> observers_;
[email protected]cbc278f2012-07-10 03:40:21379
[email protected]3c6abbe2012-08-30 23:48:57380 // The shelf reacts to gesture-drags, and can be set to auto-hide for certain
381 // gestures. Some shelf behaviour (e.g. visibility state, background color
382 // etc.) are affected by various stages of the drag. The enum keeps track of
383 // the present status of the gesture drag.
384 enum GestureDragStatus {
385 GESTURE_DRAG_NONE,
386 GESTURE_DRAG_IN_PROGRESS,
[email protected]939464902013-08-14 23:48:19387 GESTURE_DRAG_CANCEL_IN_PROGRESS,
[email protected]4982ee12012-09-04 22:16:10388 GESTURE_DRAG_COMPLETE_IN_PROGRESS
[email protected]3c6abbe2012-08-30 23:48:57389 };
390 GestureDragStatus gesture_drag_status_;
391
392 // Tracks the amount of the drag. The value is only valid when
393 // |gesture_drag_status_| is set to GESTURE_DRAG_IN_PROGRESS.
394 float gesture_drag_amount_;
395
[email protected]4982ee12012-09-04 22:16:10396 // Manage the auto-hide state during the gesture.
[email protected]ef80e4302012-12-04 19:37:31397 ShelfAutoHideState gesture_drag_auto_hide_state_;
[email protected]4982ee12012-09-04 22:16:10398
[email protected]e4d9fe92012-09-10 14:04:49399 // Used to delay updating shelf background.
400 UpdateShelfObserver* update_shelf_observer_;
401
[email protected]5416f282013-04-29 20:52:48402 // The bounds of the keyboard.
403 gfx::Rect keyboard_bounds_;
404
[email protected]7115bd32013-07-19 08:25:39405 // The bounds of the dock.
406 gfx::Rect dock_bounds_;
407
[email protected]5cc1b6592014-01-28 23:21:31408 // The show hide animation duration override or 0 for default.
409 int duration_override_in_ms_;
410
[email protected]4bb16502011-12-06 14:44:58411 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
412};
413
414} // namespace internal
[email protected]55f593352011-12-24 05:42:46415} // namespace ash
[email protected]4bb16502011-12-06 14:44:58416
[email protected]478c6c32013-03-09 02:50:58417#endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_