OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/common/session/session_state_observer.h" | 11 #include "ash/common/session/session_state_observer.h" |
12 #include "ash/common/shelf/shelf_types.h" | 12 #include "ash/common/shelf/shelf_types.h" |
13 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
14 #include "ash/common/wm/background_animator.h" | 14 #include "ash/common/wm/background_animator.h" |
15 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" | 15 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" |
16 #include "ash/common/wm/lock_state_observer.h" | 16 #include "ash/common/wm/lock_state_observer.h" |
17 #include "ash/common/wm/window_state.h" | |
18 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" | 17 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" |
19 #include "ash/common/wm/workspace/workspace_types.h" | 18 #include "ash/common/wm/workspace/workspace_types.h" |
20 #include "ash/common/wm_activation_observer.h" | 19 #include "ash/common/wm_activation_observer.h" |
21 #include "ash/shelf/shelf_widget.h" | 20 #include "ash/shelf/shelf_widget.h" |
22 #include "base/macros.h" | 21 #include "base/macros.h" |
23 #include "base/observer_list.h" | 22 #include "base/observer_list.h" |
24 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
25 #include "ui/gfx/geometry/insets.h" | 24 #include "ui/gfx/geometry/insets.h" |
26 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
27 #include "ui/keyboard/keyboard_controller_observer.h" | 26 #include "ui/keyboard/keyboard_controller_observer.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 284 |
286 // Called when the LoginUI changes from visible to invisible. | 285 // Called when the LoginUI changes from visible to invisible. |
287 void UpdateShelfVisibilityAfterLoginUIChange(); | 286 void UpdateShelfVisibilityAfterLoginUIChange(); |
288 | 287 |
289 // Compute |target_bounds| opacity based on gesture and shelf visibility. | 288 // Compute |target_bounds| opacity based on gesture and shelf visibility. |
290 float ComputeTargetOpacity(const State& state); | 289 float ComputeTargetOpacity(const State& state); |
291 | 290 |
292 // Returns true if there is a fullscreen window open that causes the shelf | 291 // Returns true if there is a fullscreen window open that causes the shelf |
293 // to be hidden. | 292 // to be hidden. |
294 bool IsShelfHiddenForFullscreen() const; | 293 bool IsShelfHiddenForFullscreen() const; |
295 ash::wm::WindowState::FullscreenShelfMode GetShelfModeForFullscreen() const; | |
296 | 294 |
297 // Gesture related functions: | 295 // Gesture related functions: |
298 void StartGestureDrag(const ui::GestureEvent& gesture); | 296 void StartGestureDrag(const ui::GestureEvent& gesture); |
299 void UpdateGestureDrag(const ui::GestureEvent& gesture); | 297 void UpdateGestureDrag(const ui::GestureEvent& gesture); |
300 void CompleteGestureDrag(const ui::GestureEvent& gesture); | 298 void CompleteGestureDrag(const ui::GestureEvent& gesture); |
301 void CancelGestureDrag(); | 299 void CancelGestureDrag(); |
302 | 300 |
303 int GetShelfInsetsForAutoHide() const; | |
304 | |
305 // True when inside UpdateBoundsAndOpacity() method. Used to prevent calling | 301 // True when inside UpdateBoundsAndOpacity() method. Used to prevent calling |
306 // UpdateBoundsAndOpacity() again from SetChildBounds(). | 302 // UpdateBoundsAndOpacity() again from SetChildBounds(). |
307 bool updating_bounds_; | 303 bool updating_bounds_; |
308 | 304 |
309 bool in_shutdown_ = false; | 305 bool in_shutdown_ = false; |
310 | 306 |
311 // True if the last mouse event was a mouse drag. | 307 // True if the last mouse event was a mouse drag. |
312 bool in_mouse_drag_ = false; | 308 bool in_mouse_drag_ = false; |
313 | 309 |
314 // Current state. | 310 // Current state. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // keyboard. | 355 // keyboard. |
360 gfx::Rect user_work_area_bounds_; | 356 gfx::Rect user_work_area_bounds_; |
361 | 357 |
362 // The height of the ChromeVox panel at the top of the screen, which | 358 // The height of the ChromeVox panel at the top of the screen, which |
363 // needs to be removed from the available work area. | 359 // needs to be removed from the available work area. |
364 int chromevox_panel_height_; | 360 int chromevox_panel_height_; |
365 | 361 |
366 // The show hide animation duration override or 0 for default. | 362 // The show hide animation duration override or 0 for default. |
367 int duration_override_in_ms_; | 363 int duration_override_in_ms_; |
368 | 364 |
369 // The flag to enforce invisible shelf (as in MD-experiemntal). | |
370 // TODO(oshima): Remove this when MD immersive is launched. | |
371 bool invisible_auto_hide_shelf_ = false; | |
372 | |
373 std::unique_ptr<RootWindowControllerObserverImpl> | 365 std::unique_ptr<RootWindowControllerObserverImpl> |
374 root_window_controller_observer_; | 366 root_window_controller_observer_; |
375 | 367 |
376 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 368 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
377 }; | 369 }; |
378 | 370 |
379 } // namespace ash | 371 } // namespace ash |
380 | 372 |
381 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 373 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |