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

Side by Side Diff: services/ui/ws/modal_window_controller.cc

Issue 2710023007: Make WindowTree::SetModal() take the type. (Closed)
Patch Set: more code. Created 3 years, 10 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698