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

Side by Side Diff: ui/aura/mus/drag_drop_controller_mus.cc

Issue 2511883006: Mojo C++ bindings: switch services/ui/public/interfaces mojom target to use STL types. (Closed)
Patch Set: . Created 4 years, 1 month 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_tree_unittest.cc ('k') | ui/aura/mus/window_tree_client.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 "ui/aura/mus/drag_drop_controller_mus.h" 5 #include "ui/aura/mus/drag_drop_controller_mus.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const uint32_t change_id = 139 const uint32_t change_id =
140 drag_drop_controller_host_->CreateChangeIdForDrag(source_window_mus); 140 drag_drop_controller_host_->CreateChangeIdForDrag(source_window_mus);
141 CurrentDragState current_drag_state = {source_window_mus->server_id(), 141 CurrentDragState current_drag_state = {source_window_mus->server_id(),
142 change_id, ui::mojom::kDropEffectNone, 142 change_id, ui::mojom::kDropEffectNone,
143 data, run_loop.QuitClosure()}; 143 data, run_loop.QuitClosure()};
144 base::AutoReset<CurrentDragState*> resetter(&current_drag_state_, 144 base::AutoReset<CurrentDragState*> resetter(&current_drag_state_,
145 &current_drag_state); 145 &current_drag_state);
146 std::map<std::string, std::vector<uint8_t>> drag_data = 146 std::map<std::string, std::vector<uint8_t>> drag_data =
147 static_cast<const aura::OSExchangeDataProviderMus&>(data.provider()) 147 static_cast<const aura::OSExchangeDataProviderMus&>(data.provider())
148 .GetData(); 148 .GetData();
149 window_tree_->PerformDragDrop( 149 window_tree_->PerformDragDrop(change_id, source_window_mus->server_id(),
150 change_id, source_window_mus->server_id(), 150 mojo::MapToUnorderedMap(drag_data),
151 mojo::Map<mojo::String, mojo::Array<uint8_t>>::From(drag_data), 151 drag_operations);
152 drag_operations);
153 152
154 base::MessageLoop* loop = base::MessageLoop::current(); 153 base::MessageLoop* loop = base::MessageLoop::current();
155 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); 154 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
156 run_loop.Run(); 155 run_loop.Run();
157 156
158 return current_drag_state.completed_action; 157 return current_drag_state.completed_action;
159 } 158 }
160 159
161 void DragDropControllerMus::DragCancel() { 160 void DragDropControllerMus::DragCancel() {
162 DCHECK(current_drag_state_); 161 DCHECK(current_drag_state_);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 std::unique_ptr<ui::DropTargetEvent> event = 204 std::unique_ptr<ui::DropTargetEvent> event =
206 base::MakeUnique<ui::DropTargetEvent>( 205 base::MakeUnique<ui::DropTargetEvent>(
207 current_drag_state_ ? current_drag_state_->drag_data 206 current_drag_state_ ? current_drag_state_->drag_data
208 : *(os_exchange_data_.get()), 207 : *(os_exchange_data_.get()),
209 location, root_location, effect_bitmask); 208 location, root_location, effect_bitmask);
210 event->set_flags(event_flags); 209 event->set_flags(event_flags);
211 return event; 210 return event;
212 } 211 }
213 212
214 } // namespace aura 213 } // namespace aura
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree_unittest.cc ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698