Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_WM_SHELL_H_ | 5 #ifndef ASH_COMMON_WM_SHELL_H_ |
| 6 #define ASH_COMMON_WM_SHELL_H_ | 6 #define ASH_COMMON_WM_SHELL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
| 14 #include "ash/common/metrics/user_metrics_action.h" | 14 #include "ash/common/metrics/user_metrics_action.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Rect; | 17 class Rect; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class PointerWatcher; | 21 class PointerWatcher; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 class AccessibilityDelegate; | 26 class AccessibilityDelegate; |
| 27 class DisplayInfo; | |
| 27 class FocusCycler; | 28 class FocusCycler; |
| 28 class MruWindowTracker; | 29 class MruWindowTracker; |
| 29 class SessionStateDelegate; | 30 class SessionStateDelegate; |
| 30 class ShellObserver; | 31 class ShellObserver; |
| 31 class SystemTrayDelegate; | 32 class SystemTrayDelegate; |
| 32 class WindowResizer; | 33 class WindowResizer; |
| 33 class WmActivationObserver; | 34 class WmActivationObserver; |
| 34 class WmDisplayObserver; | 35 class WmDisplayObserver; |
| 35 class WmSystemTrayNotifier; | 36 class WmSystemTrayNotifier; |
| 36 class WmWindow; | 37 class WmWindow; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 virtual WmWindow* GetPrimaryRootWindow() = 0; | 71 virtual WmWindow* GetPrimaryRootWindow() = 0; |
| 71 | 72 |
| 72 // Returns the root window for the specified display. | 73 // Returns the root window for the specified display. |
| 73 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; | 74 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; |
| 74 | 75 |
| 75 // Returns the root window that newly created windows should be added to. | 76 // Returns the root window that newly created windows should be added to. |
| 76 // NOTE: this returns the root, newly created window should be added to the | 77 // NOTE: this returns the root, newly created window should be added to the |
| 77 // appropriate container in the returned window. | 78 // appropriate container in the returned window. |
| 78 virtual WmWindow* GetRootWindowForNewWindows() = 0; | 79 virtual WmWindow* GetRootWindowForNewWindows() = 0; |
| 79 | 80 |
| 81 // Retuns the display info associated with |display_id|. | |
| 82 // TODO(msw): Remove this when DisplayManager has been moved. | |
|
James Cook
2016/06/22 21:27:24
maybe cite the bug here?
msw
2016/06/22 22:16:11
Done.
| |
| 83 virtual const DisplayInfo& GetDisplayInfo(int64_t display_id) const = 0; | |
| 84 | |
| 80 // Returns true if the first window shown on first run should be | 85 // Returns true if the first window shown on first run should be |
| 81 // unconditionally maximized, overriding the heuristic that normally chooses | 86 // unconditionally maximized, overriding the heuristic that normally chooses |
| 82 // the window size. | 87 // the window size. |
| 83 virtual bool IsForceMaximizeOnFirstRun() = 0; | 88 virtual bool IsForceMaximizeOnFirstRun() = 0; |
| 84 | 89 |
| 85 // Returns true if a system-modal dialog window is currently open. | 90 // Returns true if a system-modal dialog window is currently open. |
| 86 bool IsSystemModalWindowOpen(); | 91 bool IsSystemModalWindowOpen(); |
| 87 | 92 |
| 88 // For testing only: set simulation that a modal window is open | 93 // For testing only: set simulation that a modal window is open |
| 89 void SimulateModalWindowOpenForTesting(bool modal_window_open) { | 94 void SimulateModalWindowOpenForTesting(bool modal_window_open) { |
| 90 simulate_modal_window_open_for_testing_ = modal_window_open; | 95 simulate_modal_window_open_for_testing_ = modal_window_open; |
| 91 } | 96 } |
| 92 | 97 |
| 93 // Returns true if a window is currently pinned. | 98 // Returns true if a window is currently pinned. |
| 94 virtual bool IsPinned() = 0; | 99 virtual bool IsPinned() = 0; |
| 95 | 100 |
| 96 // Sets/Unsets the |window| to as a pinned window. If this is called with a | 101 // Sets/Unsets the |window| to as a pinned window. If this is called with a |
| 97 // window with WINDOW_STATE_TYPE_PINNED state, then this sets the |window| | 102 // window with WINDOW_STATE_TYPE_PINNED state, then this sets the |window| |
| 98 // as a pinned window. Otherwise, this unsets it. | 103 // as a pinned window. Otherwise, this unsets it. |
| 99 // For setting, a caller needs to guarantee that no windows are set | 104 // For setting, a caller needs to guarantee that no windows are set |
| 100 // as pinned window. For unsetting, a caller needs to guarantee that the | 105 // as pinned window. For unsetting, a caller needs to guarantee that the |
| 101 // |window| is the one which is currently set as a pinned window via previous | 106 // |window| is the one which is currently set as a pinned window via previous |
| 102 // this function invocation. | 107 // this function invocation. |
| 103 virtual void SetPinnedWindow(WmWindow* window) = 0; | 108 virtual void SetPinnedWindow(WmWindow* window) = 0; |
| 104 | 109 |
| 105 // Returns true if |window| can be shown for the current user. This is | 110 // Returns true if |window| can be shown for the current user. This is |
| 106 // intended to check if the current user matches the user associated with | 111 // intended to check if the current user matches the user associated with |
| 107 // |window|. | 112 // |window|. |
| 108 // TODO(jamescook): Remove this when ShellDelegate is accessible via this | 113 // TODO(jamescook): Remove this when ShellDelegate has been moved. |
| 109 // interface. | |
| 110 virtual bool CanShowWindowForUser(WmWindow* window) = 0; | 114 virtual bool CanShowWindowForUser(WmWindow* window) = 0; |
| 111 | 115 |
| 112 // See aura::client::CursorClient for details on these. | 116 // See aura::client::CursorClient for details on these. |
| 113 virtual void LockCursor() = 0; | 117 virtual void LockCursor() = 0; |
| 114 virtual void UnlockCursor() = 0; | 118 virtual void UnlockCursor() = 0; |
| 115 | 119 |
| 116 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; | 120 virtual std::vector<WmWindow*> GetAllRootWindows() = 0; |
| 117 | 121 |
| 118 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0; | 122 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0; |
| 119 | 123 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 std::unique_ptr<FocusCycler> focus_cycler_; | 177 std::unique_ptr<FocusCycler> focus_cycler_; |
| 174 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; | 178 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; |
| 175 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 179 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 176 | 180 |
| 177 bool simulate_modal_window_open_for_testing_ = false; | 181 bool simulate_modal_window_open_for_testing_ = false; |
| 178 }; | 182 }; |
| 179 | 183 |
| 180 } // namespace ash | 184 } // namespace ash |
| 181 | 185 |
| 182 #endif // ASH_COMMON_WM_SHELL_H_ | 186 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |