| 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 #include "components/mus/ws/display.h" | 5 #include "components/mus/ws/display.h" |
| 6 | 6 |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/mus/common/types.h" | 9 #include "components/mus/common/types.h" |
| 10 #include "components/mus/ws/display_binding.h" | 10 #include "components/mus/ws/display_binding.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 mojom::Rotation Display::GetRotation() const { | 151 mojom::Rotation Display::GetRotation() const { |
| 152 return platform_display_->GetRotation(); | 152 return platform_display_->GetRotation(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 const WindowManagerState* Display::GetActiveWindowManagerState() const { | 155 const WindowManagerState* Display::GetActiveWindowManagerState() const { |
| 156 return GetWindowManagerStateForUser( | 156 return GetWindowManagerStateForUser( |
| 157 window_server_->user_id_tracker()->active_id()); | 157 window_server_->user_id_tracker()->active_id()); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void Display::SetFocusedWindow(ServerWindow* new_focused_window) { | 160 bool Display::SetFocusedWindow(ServerWindow* new_focused_window) { |
| 161 ServerWindow* old_focused_window = focus_controller_->GetFocusedWindow(); | 161 ServerWindow* old_focused_window = focus_controller_->GetFocusedWindow(); |
| 162 if (old_focused_window == new_focused_window) | 162 if (old_focused_window == new_focused_window) |
| 163 return; | 163 return true; |
| 164 DCHECK(!new_focused_window || root_window()->Contains(new_focused_window)); | 164 DCHECK(!new_focused_window || root_window()->Contains(new_focused_window)); |
| 165 focus_controller_->SetFocusedWindow(new_focused_window); | 165 return focus_controller_->SetFocusedWindow(new_focused_window); |
| 166 } | 166 } |
| 167 | 167 |
| 168 ServerWindow* Display::GetFocusedWindow() { | 168 ServerWindow* Display::GetFocusedWindow() { |
| 169 return focus_controller_->GetFocusedWindow(); | 169 return focus_controller_->GetFocusedWindow(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void Display::ActivateNextWindow() { | 172 void Display::ActivateNextWindow() { |
| 173 // TODO(sky): this is wrong, needs to figure out the next window to activate | 173 // TODO(sky): this is wrong, needs to figure out the next window to activate |
| 174 // and then route setting through WindowServer. | 174 // and then route setting through WindowServer. |
| 175 focus_controller_->ActivateNextWindow(); | 175 focus_controller_->ActivateNextWindow(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 DCHECK_EQ(0u, window_manager_state_map_.count(id)); | 481 DCHECK_EQ(0u, window_manager_state_map_.count(id)); |
| 482 } | 482 } |
| 483 | 483 |
| 484 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) { | 484 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) { |
| 485 if (!binding_) | 485 if (!binding_) |
| 486 CreateWindowManagerStateFromService(service); | 486 CreateWindowManagerStateFromService(service); |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace ws | 489 } // namespace ws |
| 490 } // namespace mus | 490 } // namespace mus |
| OLD | NEW |