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

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

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linux build breakage Created 4 years, 6 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 2016 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_PINNED_CONTROLLER_H_
6 #define ASH_WM_PINNED_CONTROLLER_H_
7
8 #include <vector>
9
10 #include "ash/common/shell_observer.h"
11 #include "ash/common/wm_window_observer.h"
12 #include "ash/display/window_tree_host_manager.h"
13 #include "base/macros.h"
14
15 namespace ash {
16
17 class WmWindow;
18
19 namespace wm {
oshima 2016/06/17 10:26:54 Let's keep it just ash. I know it's not consistent
hidehiko 2016/06/17 17:19:22 Done.
20
21 // Handles pinned state.
22 class PinnedController : public ShellObserver,
oshima 2016/06/17 10:26:54 ScreenPinningController would be better because it
hidehiko 2016/06/17 17:19:22 Done.
23 public WmWindowObserver,
24 public WindowTreeHostManager::Observer {
25 public:
26 PinnedController();
27 ~PinnedController() override;
28
29 // Returns true if in pinned mode, otherwise false.
30 bool IsPinned() const;
31
32 private:
33 // Pinned window should be on top in the parent window.
34 WmWindow* pinned_window_ = nullptr;
oshima 2016/06/17 10:26:54 new line. same for below.
hidehiko 2016/06/17 17:19:22 Done.
35 // Dim background window just behind of the pinned window.
36 // Not owned. The parent has its ownership.
37 WmWindow* background_window_ = nullptr;
38 // In pinned mode, all displays other than the one where pinned_window_ is.
39 // Similar to background_window_, not owned.
40 std::vector<WmWindow*> dim_windows_;
41 // Set true only when restacking done by this controller.
42 bool in_restacking_ = false;
43
44 // Keeps the pinned window on top of the siblings.
45 void KeepPinnedWindowOnTop();
46
47 // Keeps the dim window on top of the container.
48 void KeepDimWindowOnTop(WmWindow* container);
49
50 // ShellObserver override.
51 void OnPinnedStateChanged(WmWindow* pinned_window) override;
52
53 // WmWindowObserver override.
oshima 2016/06/17 10:26:54 nit: // WmWindowObserver:
hidehiko 2016/06/17 17:19:22 Acknowledged.
54 void OnWindowTreeChanging(WmWindow* window,
55 const TreeChangeParams& params) override;
56 void OnWindowTreeChanged(WmWindow* window,
57 const TreeChangeParams& params) override;
58 void OnWindowStackingChanged(WmWindow* window) override;
59 void OnWindowDestroying(WmWindow* window) override;
60
61 // WindowTreeHostManager::Observer override.
oshima 2016/06/17 10:26:54 // WindowTreeHostManager::Observer:
hidehiko 2016/06/17 17:19:22 Done.
62 void OnDisplayConfigurationChanged() override;
63
64 DISALLOW_COPY_AND_ASSIGN(PinnedController);
65 };
66
67 } // namespace wm
68 } // namespace ash
69
70 #endif // ASH_WM_PINNED_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698