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

Side by Side Diff: components/mus/ws/display.cc

Issue 1759523002: mus: Server-side implementation of modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup Created 4 years, 9 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
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/connection_manager.h" 10 #include "components/mus/ws/connection_manager.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 ? nullptr 206 ? nullptr
207 : window_manager_state_map_.begin()->second.get(); 207 : window_manager_state_map_.begin()->second.get();
208 } 208 }
209 209
210 const WindowManagerState* Display::GetWindowManagerStateForUser( 210 const WindowManagerState* Display::GetWindowManagerStateForUser(
211 const UserId& user_id) const { 211 const UserId& user_id) const {
212 auto iter = window_manager_state_map_.find(user_id); 212 auto iter = window_manager_state_map_.find(user_id);
213 return iter == window_manager_state_map_.end() ? nullptr : iter->second.get(); 213 return iter == window_manager_state_map_.end() ? nullptr : iter->second.get();
214 } 214 }
215 215
216 void Display::SetCapture(ServerWindow* window, bool in_nonclient_area) { 216 bool Display::SetCapture(ServerWindow* window, bool in_nonclient_area) {
217 ServerWindow* capture_window = event_dispatcher_.capture_window(); 217 ServerWindow* capture_window = event_dispatcher_.capture_window();
218 if (capture_window == window) 218 if (capture_window == window)
219 return true;
220 return event_dispatcher_.SetCaptureWindow(window, in_nonclient_area);
221 }
222
223 void Display::ReleaseCaptureForModalWindow(ServerWindow* window) {
224 if (!window->is_modal() || !window->IsDrawn())
219 return; 225 return;
220 event_dispatcher_.SetCaptureWindow(window, in_nonclient_area); 226
227 ServerWindow* capture_window = GetCaptureWindow();
228 if (window->transient_parent() &&
229 !window->transient_parent()->Contains(capture_window)) {
230 return;
231 }
232
233 SetCapture(nullptr, false);
221 } 234 }
222 235
223 mojom::Rotation Display::GetRotation() const { 236 mojom::Rotation Display::GetRotation() const {
224 return platform_display_->GetRotation(); 237 return platform_display_->GetRotation();
225 } 238 }
226 239
227 void Display::SetFocusedWindow(ServerWindow* new_focused_window) { 240 void Display::SetFocusedWindow(ServerWindow* new_focused_window) {
228 ServerWindow* old_focused_window = focus_controller_->GetFocusedWindow(); 241 ServerWindow* old_focused_window = focus_controller_->GetFocusedWindow();
229 if (old_focused_window == new_focused_window) 242 if (old_focused_window == new_focused_window)
230 return; 243 return;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 DCHECK_EQ(0u, window_manager_state_map_.count(id)); 674 DCHECK_EQ(0u, window_manager_state_map_.count(id));
662 } 675 }
663 676
664 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) { 677 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) {
665 if (!binding_) 678 if (!binding_)
666 CreateWindowManagerStateFromService(service); 679 CreateWindowManagerStateFromService(service);
667 } 680 }
668 681
669 } // namespace ws 682 } // namespace ws
670 } // namespace mus 683 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698