| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_UI_WS_DISPLAY_H_ | 5 #ifndef SERVICES_UI_WS_DISPLAY_H_ |
| 6 #define SERVICES_UI_WS_DISPLAY_H_ | 6 #define SERVICES_UI_WS_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Returns a mojom::WsDisplay for the specified display. WindowManager | 75 // Returns a mojom::WsDisplay for the specified display. WindowManager |
| 76 // specific values are not set. | 76 // specific values are not set. |
| 77 mojom::WsDisplayPtr ToWsDisplay() const; | 77 mojom::WsDisplayPtr ToWsDisplay() const; |
| 78 | 78 |
| 79 // Returns a display::Display for the specficied display. | 79 // Returns a display::Display for the specficied display. |
| 80 display::Display ToDisplay() const; | 80 display::Display ToDisplay() const; |
| 81 | 81 |
| 82 // Schedules a paint for the specified region in the coordinates of |window|. | 82 // Schedules a paint for the specified region in the coordinates of |window|. |
| 83 void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds); | 83 void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds); |
| 84 | 84 |
| 85 display::Display::Rotation GetRotation() const; | |
| 86 gfx::Size GetSize() const; | 85 gfx::Size GetSize() const; |
| 87 | 86 |
| 88 WindowServer* window_server() { return window_server_; } | 87 WindowServer* window_server() { return window_server_; } |
| 89 | 88 |
| 90 // Returns the root of the Display. The root's children are the roots | 89 // Returns the root of the Display. The root's children are the roots |
| 91 // of the corresponding WindowManagers. | 90 // of the corresponding WindowManagers. |
| 92 ServerWindow* root_window() { return root_.get(); } | 91 ServerWindow* root_window() { return root_.get(); } |
| 93 const ServerWindow* root_window() const { return root_.get(); } | 92 const ServerWindow* root_window() const { return root_.get(); } |
| 94 | 93 |
| 95 // Returns the ServerWindow whose id is |id|. This does not do a search over | 94 // Returns the ServerWindow whose id is |id|. This does not do a search over |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 137 |
| 139 // Called just before |tree| is destroyed. | 138 // Called just before |tree| is destroyed. |
| 140 void OnWillDestroyTree(WindowTree* tree); | 139 void OnWillDestroyTree(WindowTree* tree); |
| 141 | 140 |
| 142 void UpdateNativeCursor(mojom::Cursor cursor_id); | 141 void UpdateNativeCursor(mojom::Cursor cursor_id); |
| 143 | 142 |
| 144 // mojom::WindowTreeHost: | 143 // mojom::WindowTreeHost: |
| 145 void SetSize(const gfx::Size& size) override; | 144 void SetSize(const gfx::Size& size) override; |
| 146 void SetTitle(const mojo::String& title) override; | 145 void SetTitle(const mojo::String& title) override; |
| 147 | 146 |
| 147 // Updates the root window, if necessary, for viewport metric changes. |
| 148 void OnViewportMetricsChanged(const display::ViewportMetrics& new_metrics); |
| 149 |
| 148 private: | 150 private: |
| 149 friend class test::DisplayTestApi; | 151 friend class test::DisplayTestApi; |
| 150 | 152 |
| 151 using WindowManagerDisplayRootMap = | 153 using WindowManagerDisplayRootMap = |
| 152 std::map<UserId, WindowManagerDisplayRoot*>; | 154 std::map<UserId, WindowManagerDisplayRoot*>; |
| 153 | 155 |
| 154 // Inits the necessary state once the display is ready. | 156 // Inits the necessary state once the display is ready. |
| 155 void InitWindowManagerDisplayRootsIfNecessary(); | 157 void InitWindowManagerDisplayRootsIfNecessary(); |
| 156 | 158 |
| 157 // Creates the set of WindowManagerDisplayRoots from the | 159 // Creates the set of WindowManagerDisplayRoots from the |
| 158 // WindowManagerWindowTreeFactorySet. | 160 // WindowManagerWindowTreeFactorySet. |
| 159 void CreateWindowManagerDisplayRootsFromFactories(); | 161 void CreateWindowManagerDisplayRootsFromFactories(); |
| 160 | 162 |
| 161 void CreateWindowManagerDisplayRootFromFactory( | 163 void CreateWindowManagerDisplayRootFromFactory( |
| 162 WindowManagerWindowTreeFactory* factory); | 164 WindowManagerWindowTreeFactory* factory); |
| 163 | 165 |
| 164 // PlatformDisplayDelegate: | 166 // PlatformDisplayDelegate: |
| 165 void CreateRootWindow(const gfx::Size& size) override; | 167 void CreateRootWindow(const gfx::Size& size) override; |
| 166 ServerWindow* GetRootWindow() override; | 168 ServerWindow* GetRootWindow() override; |
| 167 bool IsInHighContrastMode() override; | 169 bool IsInHighContrastMode() override; |
| 168 void OnEvent(const ui::Event& event) override; | 170 void OnEvent(const ui::Event& event) override; |
| 169 void OnNativeCaptureLost() override; | 171 void OnNativeCaptureLost() override; |
| 170 void OnViewportMetricsChanged(const ViewportMetrics& old_metrics, | |
| 171 const ViewportMetrics& new_metrics) override; | |
| 172 | 172 |
| 173 // FocusControllerDelegate: | 173 // FocusControllerDelegate: |
| 174 bool CanHaveActiveChildren(ServerWindow* window) const override; | 174 bool CanHaveActiveChildren(ServerWindow* window) const override; |
| 175 | 175 |
| 176 // FocusControllerObserver: | 176 // FocusControllerObserver: |
| 177 void OnActivationChanged(ServerWindow* old_active_window, | 177 void OnActivationChanged(ServerWindow* old_active_window, |
| 178 ServerWindow* new_active_window) override; | 178 ServerWindow* new_active_window) override; |
| 179 void OnFocusChanged(FocusControllerChangeSource change_source, | 179 void OnFocusChanged(FocusControllerChangeSource change_source, |
| 180 ServerWindow* old_focused_window, | 180 ServerWindow* old_focused_window, |
| 181 ServerWindow* new_focused_window) override; | 181 ServerWindow* new_focused_window) override; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 202 | 202 |
| 203 WindowManagerDisplayRootMap window_manager_display_root_map_; | 203 WindowManagerDisplayRootMap window_manager_display_root_map_; |
| 204 | 204 |
| 205 DISALLOW_COPY_AND_ASSIGN(Display); | 205 DISALLOW_COPY_AND_ASSIGN(Display); |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 } // namespace ws | 208 } // namespace ws |
| 209 } // namespace ui | 209 } // namespace ui |
| 210 | 210 |
| 211 #endif // SERVICES_UI_WS_DISPLAY_H_ | 211 #endif // SERVICES_UI_WS_DISPLAY_H_ |
| OLD | NEW |