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

Side by Side Diff: ash/wm/lock_action_handler_layout_manager.h

Issue 2876993002: Introduce window container to be used by lock screen app windows (Closed)
Patch Set: . Created 3 years, 7 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
(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/wm_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 WmShelf;
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 two window containers:
25 // * LockActionHandlerContainer - parents handler windows when the new note
26 // action is in active state, i.e. handler windows should be visible on
27 // top of lock screen.
28 // * LockActionHandlerContainer_Background - parents handler windows when the
29 // new note action is in background state, i.e. handler windows should be
30 // visible below the lock screen UI.
31 // The layout manager will observe new note action state changes and reparent
32 // the associated container's children as needed.
33 // The windows in this container will have be maximized, if possible. If they
34 // are not resible, 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 WmShelfObserver,
40 public TrayActionObserver {
41 public:
42 LockActionHandlerLayoutManager(aura::Window* window, WmShelf* wm_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 // WmShelfObserver:
51 void WillChangeVisibilityState(ShelfVisibilityState visibility) override;
52
53 // TrayActionObserver:
54 void OnLockScreenNoteStateChanged(mojom::TrayActionState state) override;
55
56 private:
57 aura::Window* GetActiveActionHandlerContainer(mojom::TrayActionState state);
58
59 ScopedObserver<WmShelf, WmShelfObserver> shelf_observer_;
60 ScopedObserver<TrayAction, TrayActionObserver> tray_action_observer_;
61
62 DISALLOW_COPY_AND_ASSIGN(LockActionHandlerLayoutManager);
63 };
64
65 } // namespace ash
66
67 #endif // ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698