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

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

Issue 2266603002: mus: Implement interwindow drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comments Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/window_manager_state.h ('k') | services/ui/ws/window_server.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/window_manager_state.h" 5 #include "services/ui/ws/window_manager_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "services/shell/public/interfaces/connector.mojom.h" 10 #include "services/shell/public/interfaces/connector.mojom.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 void WindowManagerState::ReleaseCaptureBlockedByModalWindow( 149 void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
150 const ServerWindow* modal_window) { 150 const ServerWindow* modal_window) {
151 event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window); 151 event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window);
152 } 152 }
153 153
154 void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() { 154 void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
155 event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow(); 155 event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow();
156 } 156 }
157 157
158 void WindowManagerState::SetDragDropSourceWindow(
159 DragSource* drag_source,
160 ServerWindow* window,
161 DragTargetConnection* source_connection,
162 int32_t drag_pointer,
163 mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data,
164 uint32_t drag_operation) {
165 event_dispatcher_.SetDragDropSourceWindow(
166 drag_source, window, source_connection, drag_pointer,
167 std::move(drag_data), drag_operation);
168 }
169
170 void WindowManagerState::EndDragDrop() {
171 event_dispatcher_.EndDragDrop();
172 }
173
158 void WindowManagerState::AddSystemModalWindow(ServerWindow* window) { 174 void WindowManagerState::AddSystemModalWindow(ServerWindow* window) {
159 DCHECK(!window->transient_parent()); 175 DCHECK(!window->transient_parent());
160 event_dispatcher_.AddSystemModalWindow(window); 176 event_dispatcher_.AddSystemModalWindow(window);
161 } 177 }
162 178
163 const UserId& WindowManagerState::user_id() const { 179 const UserId& WindowManagerState::user_id() const {
164 return window_tree_->user_id(); 180 return window_tree_->user_id();
165 } 181 }
166 182
167 void WindowManagerState::OnWillDestroyTree(WindowTree* tree) { 183 void WindowManagerState::OnWillDestroyTree(WindowTree* tree) {
184 event_dispatcher_.OnWillDestroyDragTargetConnection(tree);
185
168 if (tree_awaiting_input_ack_ != tree) 186 if (tree_awaiting_input_ack_ != tree)
169 return; 187 return;
170 188
171 // The WindowTree is dying. So it's not going to ack the event. 189 // The WindowTree is dying. So it's not going to ack the event.
172 // If the dying tree matches the root |tree_| marked as handled so we don't 190 // If the dying tree matches the root |tree_| marked as handled so we don't
173 // notify it of accelerators. 191 // notify it of accelerators.
174 OnEventAck(tree_awaiting_input_ack_, tree == window_tree_ 192 OnEventAck(tree_awaiting_input_ack_, tree == window_tree_
175 ? mojom::EventResult::HANDLED 193 ? mojom::EventResult::HANDLED
176 : mojom::EventResult::UNHANDLED); 194 : mojom::EventResult::UNHANDLED);
177 } 195 }
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 return display_root->root(); 580 return display_root->root();
563 } 581 }
564 582
565 void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) { 583 void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) {
566 window_server()->SendToPointerWatchers(event, user_id(), nullptr, /* window */ 584 window_server()->SendToPointerWatchers(event, user_id(), nullptr, /* window */
567 nullptr /* ignore_tree */); 585 nullptr /* ignore_tree */);
568 } 586 }
569 587
570 } // namespace ws 588 } // namespace ws
571 } // namespace ui 589 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_manager_state.h ('k') | services/ui/ws/window_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698