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

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

Issue 2243513004: mash: Partially migrate WorkspaceController to ash common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 4 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 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 17 matching lines...) Expand all
28 namespace ui { 28 namespace ui {
29 class ImplicitAnimationObserver; 29 class ImplicitAnimationObserver;
30 } 30 }
31 31
32 namespace ash { 32 namespace ash {
33 33
34 class PanelLayoutManagerTest; 34 class PanelLayoutManagerTest;
35 class ShelfLayoutManagerObserver; 35 class ShelfLayoutManagerObserver;
36 class ShelfLayoutManagerTest; 36 class ShelfLayoutManagerTest;
37 class ShelfWidget; 37 class ShelfWidget;
38 class WorkspaceController;
39 38
40 // ShelfLayoutManager is the layout manager responsible for the shelf and 39 // ShelfLayoutManager is the layout manager responsible for the shelf and
41 // status widgets. The shelf is given the total available width and told the 40 // status widgets. The shelf is given the total available width and told the
42 // width of the status area. This allows the shelf to draw the background and 41 // width of the status area. This allows the shelf to draw the background and
43 // layout to the status area. 42 // layout to the status area.
44 // To respond to bounds changes in the status area StatusAreaLayoutManager works 43 // To respond to bounds changes in the status area StatusAreaLayoutManager works
45 // closely with ShelfLayoutManager. 44 // closely with ShelfLayoutManager.
46 // On mus, widget bounds management is handled by the window manager. 45 // On mus, widget bounds management is handled by the window manager.
47 class ASH_EXPORT ShelfLayoutManager 46 class ASH_EXPORT ShelfLayoutManager
48 : public ShellObserver, 47 : public ShellObserver,
49 public WmActivationObserver, 48 public WmActivationObserver,
50 public DockedWindowLayoutManagerObserver, 49 public DockedWindowLayoutManagerObserver,
51 public keyboard::KeyboardControllerObserver, 50 public keyboard::KeyboardControllerObserver,
52 public LockStateObserver, 51 public LockStateObserver,
53 public wm::WmSnapToPixelLayoutManager, 52 public wm::WmSnapToPixelLayoutManager,
54 public SessionStateObserver { 53 public SessionStateObserver {
55 public: 54 public:
56 explicit ShelfLayoutManager(ShelfWidget* shelf_widget); 55 explicit ShelfLayoutManager(ShelfWidget* shelf_widget);
57 ~ShelfLayoutManager() override; 56 ~ShelfLayoutManager() override;
58 57
59 void set_workspace_controller(WorkspaceController* controller) {
60 workspace_controller_ = controller;
61 }
62
63 bool updating_bounds() const { return updating_bounds_; } 58 bool updating_bounds() const { return updating_bounds_; }
64 59
65 // Clears internal data for shutdown process. 60 // Clears internal data for shutdown process.
66 void PrepareForShutdown(); 61 void PrepareForShutdown();
67 62
68 // Returns whether the shelf and its contents (shelf, status) are visible 63 // Returns whether the shelf and its contents (shelf, status) are visible
69 // on the screen. 64 // on the screen.
70 bool IsVisible() const; 65 bool IsVisible() const;
71 66
72 // Returns the ideal bounds of the shelf assuming it is visible. 67 // Returns the ideal bounds of the shelf assuming it is visible.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool in_shutdown_ = false; 299 bool in_shutdown_ = false;
305 300
306 // True if the last mouse event was a mouse drag. 301 // True if the last mouse event was a mouse drag.
307 bool in_mouse_drag_ = false; 302 bool in_mouse_drag_ = false;
308 303
309 // Current state. 304 // Current state.
310 State state_; 305 State state_;
311 306
312 ShelfWidget* shelf_widget_; 307 ShelfWidget* shelf_widget_;
313 308
314 WorkspaceController* workspace_controller_;
315
316 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. 309 // Do any windows overlap the shelf? This is maintained by WorkspaceManager.
317 bool window_overlaps_shelf_; 310 bool window_overlaps_shelf_;
318 311
319 base::OneShotTimer auto_hide_timer_; 312 base::OneShotTimer auto_hide_timer_;
320 313
321 // Whether the mouse was over the shelf when the auto hide timer started. 314 // Whether the mouse was over the shelf when the auto hide timer started.
322 // False when neither the auto hide timer nor the timer task are running. 315 // False when neither the auto hide timer nor the timer task are running.
323 bool mouse_over_shelf_when_auto_hide_timer_started_; 316 bool mouse_over_shelf_when_auto_hide_timer_started_;
324 317
325 base::ObserverList<ShelfLayoutManagerObserver> observers_; 318 base::ObserverList<ShelfLayoutManagerObserver> observers_;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 358
366 std::unique_ptr<RootWindowControllerObserverImpl> 359 std::unique_ptr<RootWindowControllerObserverImpl>
367 root_window_controller_observer_; 360 root_window_controller_observer_;
368 361
369 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); 362 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
370 }; 363 };
371 364
372 } // namespace ash 365 } // namespace ash
373 366
374 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ 367 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698