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

Side by Side Diff: ash/shelf/shelf_layout_manager.h

Issue 1901773002: Removes most of aura dependencies from DefaultState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wm_window_positioner
Patch Set: comment Created 4 years, 8 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 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 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/session/session_state_observer.h" 12 #include "ash/session/session_state_observer.h"
13 #include "ash/shelf/background_animator.h" 13 #include "ash/shelf/background_animator.h"
14 #include "ash/shelf/shelf.h" 14 #include "ash/shelf/shelf.h"
15 #include "ash/shelf/shelf_types.h" 15 #include "ash/shelf/shelf_types.h"
16 #include "ash/shell_observer.h" 16 #include "ash/shell_observer.h"
17 #include "ash/snap_to_pixel_layout_manager.h" 17 #include "ash/snap_to_pixel_layout_manager.h"
18 #include "ash/system/status_area_widget.h" 18 #include "ash/system/status_area_widget.h"
19 #include "ash/wm/common/workspace/workspace_types.h"
19 #include "ash/wm/dock/docked_window_layout_manager_observer.h" 20 #include "ash/wm/dock/docked_window_layout_manager_observer.h"
20 #include "ash/wm/lock_state_observer.h" 21 #include "ash/wm/lock_state_observer.h"
21 #include "ash/wm/workspace/workspace_types.h"
22 #include "base/compiler_specific.h" 22 #include "base/compiler_specific.h"
23 #include "base/gtest_prod_util.h" 23 #include "base/gtest_prod_util.h"
24 #include "base/logging.h" 24 #include "base/logging.h"
25 #include "base/macros.h" 25 #include "base/macros.h"
26 #include "base/observer_list.h" 26 #include "base/observer_list.h"
27 #include "base/timer/timer.h" 27 #include "base/timer/timer.h"
28 #include "ui/gfx/geometry/insets.h" 28 #include "ui/gfx/geometry/insets.h"
29 #include "ui/gfx/geometry/rect.h" 29 #include "ui/gfx/geometry/rect.h"
30 #include "ui/keyboard/keyboard_controller.h" 30 #include "ui/keyboard/keyboard_controller.h"
31 #include "ui/keyboard/keyboard_controller_observer.h" 31 #include "ui/keyboard/keyboard_controller_observer.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 float opacity; 236 float opacity;
237 float status_opacity; 237 float status_opacity;
238 gfx::Rect shelf_bounds_in_root; 238 gfx::Rect shelf_bounds_in_root;
239 gfx::Rect shelf_bounds_in_shelf; 239 gfx::Rect shelf_bounds_in_shelf;
240 gfx::Rect status_bounds_in_shelf; 240 gfx::Rect status_bounds_in_shelf;
241 gfx::Insets work_area_insets; 241 gfx::Insets work_area_insets;
242 }; 242 };
243 243
244 struct State { 244 struct State {
245 State() : visibility_state(SHELF_VISIBLE), 245 State()
246 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), 246 : visibility_state(SHELF_VISIBLE),
247 window_state(WORKSPACE_WINDOW_STATE_DEFAULT), 247 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN),
248 is_screen_locked(false), 248 window_state(wm::WORKSPACE_WINDOW_STATE_DEFAULT),
249 is_adding_user_screen(false) {} 249 is_screen_locked(false),
250 is_adding_user_screen(false) {}
250 251
251 // Returns true if the two states are considered equal. As 252 // Returns true if the two states are considered equal. As
252 // |auto_hide_state| only matters if |visibility_state| is 253 // |auto_hide_state| only matters if |visibility_state| is
253 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as 254 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as
254 // appropriate. 255 // appropriate.
255 bool Equals(const State& other) const { 256 bool Equals(const State& other) const {
256 return other.visibility_state == visibility_state && 257 return other.visibility_state == visibility_state &&
257 (visibility_state != SHELF_AUTO_HIDE || 258 (visibility_state != SHELF_AUTO_HIDE ||
258 other.auto_hide_state == auto_hide_state) && 259 other.auto_hide_state == auto_hide_state) &&
259 other.window_state == window_state && 260 other.window_state == window_state &&
260 other.is_screen_locked == is_screen_locked && 261 other.is_screen_locked == is_screen_locked &&
261 other.is_adding_user_screen == is_adding_user_screen; 262 other.is_adding_user_screen == is_adding_user_screen;
262 } 263 }
263 264
264 ShelfVisibilityState visibility_state; 265 ShelfVisibilityState visibility_state;
265 ShelfAutoHideState auto_hide_state; 266 ShelfAutoHideState auto_hide_state;
266 WorkspaceWindowState window_state; 267 wm::WorkspaceWindowState window_state;
267 bool is_screen_locked; 268 bool is_screen_locked;
268 bool is_adding_user_screen; 269 bool is_adding_user_screen;
269 }; 270 };
270 271
271 // Sets the visibility of the shelf to |state|. 272 // Sets the visibility of the shelf to |state|.
272 void SetState(ShelfVisibilityState visibility_state); 273 void SetState(ShelfVisibilityState visibility_state);
273 274
274 // Updates the bounds and opacity of the shelf and status widgets. 275 // Updates the bounds and opacity of the shelf and status widgets.
275 // If |observer| is specified, it will be called back when the animations, if 276 // If |observer| is specified, it will be called back when the animations, if
276 // any, are complete. 277 // any, are complete.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 401
401 // The show hide animation duration override or 0 for default. 402 // The show hide animation duration override or 0 for default.
402 int duration_override_in_ms_; 403 int duration_override_in_ms_;
403 404
404 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); 405 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
405 }; 406 };
406 407
407 } // namespace ash 408 } // namespace ash
408 409
409 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ 410 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698