OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 #include "ash/public/cpp/shelf_types.h" |
| 10 #include "ash/shelf/shelf_observer.h" |
| 11 #include "ash/tray_action/tray_action_observer.h" |
| 12 #include "ash/wm/lock_layout_manager.h" |
| 13 #include "base/macros.h" |
| 14 #include "base/scoped_observer.h" |
| 15 |
| 16 namespace ash { |
| 17 |
| 18 class TrayAction; |
| 19 class Shelf; |
| 20 |
| 21 // Window layout manager for windows intended to handle lock tray actions. |
| 22 // Since "new note" is currently the only supported action, the layout |
| 23 // manager uses new note tray action state to determine it state. |
| 24 // The layout is intended to be used for LockActionHandlerContainer. The |
| 25 // container state depends on the lock screen "new_note" action state: |
| 26 // * for active action state - the windows should be visible above the lock |
| 27 // screen |
| 28 // * for background action state - the windows should be visible in |
| 29 // background, below lock screen. |
| 30 // * for rest of the states - the windows should not be visible. |
| 31 // The layout manager will observe new note action state changes and update |
| 32 // the container's children state as needed. |
| 33 // The windows in this container will have be maximized, if possible. If they |
| 34 // are not resizable, they will be centered on the screen - similar to windows |
| 35 // in lock screen container. |
| 36 // Unlike lock layout manager, when maximizing windows, this layout manager will |
| 37 // ensure that the windows do not obscure the system shelf. |
| 38 class ASH_EXPORT LockActionHandlerLayoutManager : public LockLayoutManager, |
| 39 public ShelfObserver, |
| 40 public TrayActionObserver { |
| 41 public: |
| 42 LockActionHandlerLayoutManager(aura::Window* window, Shelf* shelf); |
| 43 ~LockActionHandlerLayoutManager() override; |
| 44 |
| 45 // WmSnapToPixelLayoutManager: |
| 46 void OnWindowAddedToLayout(aura::Window* child) override; |
| 47 void OnChildWindowVisibilityChanged(aura::Window* child, |
| 48 bool visibile) override; |
| 49 |
| 50 // ShelfObserver: |
| 51 void WillChangeVisibilityState(ShelfVisibilityState visibility) override; |
| 52 |
| 53 // TrayActionObserver: |
| 54 void OnLockScreenNoteStateChanged(mojom::TrayActionState state) override; |
| 55 |
| 56 private: |
| 57 ScopedObserver<Shelf, ShelfObserver> shelf_observer_; |
| 58 ScopedObserver<TrayAction, TrayActionObserver> tray_action_observer_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(LockActionHandlerLayoutManager); |
| 61 }; |
| 62 |
| 63 } // namespace ash |
| 64 |
| 65 #endif // ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_ |
OLD | NEW |