| 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 #include "services/ui/ws/modal_window_controller.h" | 5 #include "services/ui/ws/modal_window_controller.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "services/ui/ws/event_dispatcher.h" | 9 #include "services/ui/ws/event_dispatcher.h" |
| 10 #include "services/ui/ws/server_window.h" | 10 #include "services/ui/ws/server_window.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 for (auto it = system_modal_windows_.begin(); | 41 for (auto it = system_modal_windows_.begin(); |
| 42 it != system_modal_windows_.end(); it++) { | 42 it != system_modal_windows_.end(); it++) { |
| 43 (*it)->RemoveObserver(this); | 43 (*it)->RemoveObserver(this); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 void ModalWindowController::AddSystemModalWindow(ServerWindow* window) { | 47 void ModalWindowController::AddSystemModalWindow(ServerWindow* window) { |
| 48 DCHECK(window); | 48 DCHECK(window); |
| 49 DCHECK(!base::ContainsValue(system_modal_windows_, window)); | 49 DCHECK(!base::ContainsValue(system_modal_windows_, window)); |
| 50 | 50 |
| 51 window->SetModal(); | 51 window->SetModal(true); |
| 52 system_modal_windows_.push_back(window); | 52 system_modal_windows_.push_back(window); |
| 53 window_drawn_trackers_.insert(make_pair( | 53 window_drawn_trackers_.insert(make_pair( |
| 54 window, base::MakeUnique<ServerWindowDrawnTracker>(window, this))); | 54 window, base::MakeUnique<ServerWindowDrawnTracker>(window, this))); |
| 55 window->AddObserver(this); | 55 window->AddObserver(this); |
| 56 | 56 |
| 57 event_dispatcher_->ReleaseCaptureBlockedByModalWindow(window); | 57 event_dispatcher_->ReleaseCaptureBlockedByModalWindow(window); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool ModalWindowController::IsWindowBlockedBy( | 60 bool ModalWindowController::IsWindowBlockedBy( |
| 61 const ServerWindow* window, | 61 const ServerWindow* window, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Move the most recently shown window to the end of the list. | 114 // Move the most recently shown window to the end of the list. |
| 115 auto it = std::find(system_modal_windows_.begin(), | 115 auto it = std::find(system_modal_windows_.begin(), |
| 116 system_modal_windows_.end(), window); | 116 system_modal_windows_.end(), window); |
| 117 DCHECK(it != system_modal_windows_.end()); | 117 DCHECK(it != system_modal_windows_.end()); |
| 118 system_modal_windows_.splice(system_modal_windows_.end(), | 118 system_modal_windows_.splice(system_modal_windows_.end(), |
| 119 system_modal_windows_, it); | 119 system_modal_windows_, it); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace ws | 122 } // namespace ws |
| 123 } // namespace ui | 123 } // namespace ui |
| OLD | NEW |