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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/event_client_impl.cc ('k') | ash/wm/lock_action_handler_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_action_handler_layout_manager.h
diff --git a/ash/wm/lock_action_handler_layout_manager.h b/ash/wm/lock_action_handler_layout_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ab1388f33e645d909485450ece8a38e818213d0
--- /dev/null
+++ b/ash/wm/lock_action_handler_layout_manager.h
@@ -0,0 +1,65 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_
+#define ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_
+
+#include "ash/ash_export.h"
+#include "ash/public/cpp/shelf_types.h"
+#include "ash/shelf/shelf_observer.h"
+#include "ash/tray_action/tray_action_observer.h"
+#include "ash/wm/lock_layout_manager.h"
+#include "base/macros.h"
+#include "base/scoped_observer.h"
+
+namespace ash {
+
+class TrayAction;
+class Shelf;
+
+// Window layout manager for windows intended to handle lock tray actions.
+// Since "new note" is currently the only supported action, the layout
+// manager uses new note tray action state to determine it state.
+// The layout is intended to be used for LockActionHandlerContainer. The
+// container state depends on the lock screen "new_note" action state:
+// * for active action state - the windows should be visible above the lock
+// screen
+// * for background action state - the windows should be visible in
+// background, below lock screen.
+// * for rest of the states - the windows should not be visible.
+// The layout manager will observe new note action state changes and update
+// the container's children state as needed.
+// The windows in this container will have be maximized, if possible. If they
+// are not resizable, they will be centered on the screen - similar to windows
+// in lock screen container.
+// Unlike lock layout manager, when maximizing windows, this layout manager will
+// ensure that the windows do not obscure the system shelf.
+class ASH_EXPORT LockActionHandlerLayoutManager : public LockLayoutManager,
+ public ShelfObserver,
+ public TrayActionObserver {
+ public:
+ LockActionHandlerLayoutManager(aura::Window* window, Shelf* shelf);
+ ~LockActionHandlerLayoutManager() override;
+
+ // WmSnapToPixelLayoutManager:
+ void OnWindowAddedToLayout(aura::Window* child) override;
+ void OnChildWindowVisibilityChanged(aura::Window* child,
+ bool visibile) override;
+
+ // ShelfObserver:
+ void WillChangeVisibilityState(ShelfVisibilityState visibility) override;
+
+ // TrayActionObserver:
+ void OnLockScreenNoteStateChanged(mojom::TrayActionState state) override;
+
+ private:
+ ScopedObserver<Shelf, ShelfObserver> shelf_observer_;
+ ScopedObserver<TrayAction, TrayActionObserver> tray_action_observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(LockActionHandlerLayoutManager);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_LOCK_ACTION_HANDLER_LAYOUT_MANAGER_H_
« no previous file with comments | « ash/wm/event_client_impl.cc ('k') | ash/wm/lock_action_handler_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698