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

Side by Side Diff: services/ui/ws/test_utils.h

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/server_window.cc ('k') | services/ui/ws/test_utils.cc » ('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 #ifndef SERVICES_UI_WS_TEST_UTILS_H_ 5 #ifndef SERVICES_UI_WS_TEST_UTILS_H_
6 #define SERVICES_UI_WS_TEST_UTILS_H_ 6 #define SERVICES_UI_WS_TEST_UTILS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "services/ui/public/interfaces/display.mojom.h" 14 #include "services/ui/public/interfaces/display.mojom.h"
15 #include "services/ui/public/interfaces/window_tree.mojom.h" 15 #include "services/ui/public/interfaces/window_tree.mojom.h"
16 #include "services/ui/ws/display.h" 16 #include "services/ui/ws/display.h"
17 #include "services/ui/ws/display_binding.h" 17 #include "services/ui/ws/display_binding.h"
18 #include "services/ui/ws/drag_controller.h"
18 #include "services/ui/ws/event_dispatcher.h" 19 #include "services/ui/ws/event_dispatcher.h"
19 #include "services/ui/ws/platform_display.h" 20 #include "services/ui/ws/platform_display.h"
20 #include "services/ui/ws/platform_display_factory.h" 21 #include "services/ui/ws/platform_display_factory.h"
21 #include "services/ui/ws/test_change_tracker.h" 22 #include "services/ui/ws/test_change_tracker.h"
22 #include "services/ui/ws/user_activity_monitor.h" 23 #include "services/ui/ws/user_activity_monitor.h"
23 #include "services/ui/ws/user_display_manager.h" 24 #include "services/ui/ws/user_display_manager.h"
24 #include "services/ui/ws/user_id.h" 25 #include "services/ui/ws/user_id.h"
25 #include "services/ui/ws/window_manager_state.h" 26 #include "services/ui/ws/window_manager_state.h"
26 #include "services/ui/ws/window_manager_window_tree_factory_set.h" 27 #include "services/ui/ws/window_manager_window_tree_factory_set.h"
27 #include "services/ui/ws/window_server_delegate.h" 28 #include "services/ui/ws/window_server_delegate.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 211 }
211 212
212 private: 213 private:
213 WindowManagerState* wms_; 214 WindowManagerState* wms_;
214 215
215 DISALLOW_COPY_AND_ASSIGN(WindowManagerStateTestApi); 216 DISALLOW_COPY_AND_ASSIGN(WindowManagerStateTestApi);
216 }; 217 };
217 218
218 // ----------------------------------------------------------------------------- 219 // -----------------------------------------------------------------------------
219 220
221 class DragControllerTestApi {
222 public:
223 explicit DragControllerTestApi(DragController* op) : op_(op) {}
224 ~DragControllerTestApi() {}
225
226 size_t GetSizeOfQueueForWindow(ServerWindow* window) {
227 return op_->GetSizeOfQueueForWindow(window);
228 }
229
230 ServerWindow* GetCurrentTarget() { return op_->current_target_window_; }
231
232 private:
233 DragController* op_;
234
235 DISALLOW_COPY_AND_ASSIGN(DragControllerTestApi);
236 };
237
238 // -----------------------------------------------------------------------------
239
220 // Factory that always embeds the new WindowTree as the root user id. 240 // Factory that always embeds the new WindowTree as the root user id.
221 class TestDisplayBinding : public DisplayBinding { 241 class TestDisplayBinding : public DisplayBinding {
222 public: 242 public:
223 explicit TestDisplayBinding(WindowServer* window_server) 243 explicit TestDisplayBinding(WindowServer* window_server)
224 : window_server_(window_server) {} 244 : window_server_(window_server) {}
225 ~TestDisplayBinding() override {} 245 ~TestDisplayBinding() override {}
226 246
227 private: 247 private:
228 // DisplayBinding: 248 // DisplayBinding:
229 WindowTree* CreateWindowTree(ServerWindow* root) override; 249 WindowTree* CreateWindowTree(ServerWindow* root) override;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 mojo::Array<uint8_t> new_data) override; 424 mojo::Array<uint8_t> new_data) override;
405 void OnWindowInputEvent(uint32_t event_id, 425 void OnWindowInputEvent(uint32_t event_id,
406 uint32_t window, 426 uint32_t window,
407 std::unique_ptr<ui::Event> event, 427 std::unique_ptr<ui::Event> event,
408 bool matches_pointer_watcher) override; 428 bool matches_pointer_watcher) override;
409 void OnPointerEventObserved(std::unique_ptr<ui::Event> event, 429 void OnPointerEventObserved(std::unique_ptr<ui::Event> event,
410 uint32_t window_id) override; 430 uint32_t window_id) override;
411 void OnWindowFocused(uint32_t focused_window_id) override; 431 void OnWindowFocused(uint32_t focused_window_id) override;
412 void OnWindowPredefinedCursorChanged(uint32_t window_id, 432 void OnWindowPredefinedCursorChanged(uint32_t window_id,
413 mojom::Cursor cursor_id) override; 433 mojom::Cursor cursor_id) override;
434 void OnDragDropStart(
435 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data) override;
436 void OnDragEnter(uint32_t window,
437 uint32_t key_state,
438 const gfx::Point& position,
439 uint32_t effect_bitmask,
440 const OnDragEnterCallback& callback) override;
441 void OnDragOver(uint32_t window,
442 uint32_t key_state,
443 const gfx::Point& position,
444 uint32_t effect_bitmask,
445 const OnDragOverCallback& callback) override;
446 void OnDragLeave(uint32_t window) override;
447 void OnCompleteDrop(uint32_t window,
448 uint32_t key_state,
449 const gfx::Point& position,
450 uint32_t effect_bitmask,
451 const OnCompleteDropCallback& callback) override;
452 void OnDragDropDone() override;
414 void OnChangeCompleted(uint32_t change_id, bool success) override; 453 void OnChangeCompleted(uint32_t change_id, bool success) override;
415 void RequestClose(uint32_t window_id) override; 454 void RequestClose(uint32_t window_id) override;
416 void GetWindowManager( 455 void GetWindowManager(
417 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override; 456 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override;
418 457
419 TestChangeTracker tracker_; 458 TestChangeTracker tracker_;
420 mojo::Binding<mojom::WindowTreeClient> binding_; 459 mojo::Binding<mojom::WindowTreeClient> binding_;
421 bool record_on_change_completed_ = false; 460 bool record_on_change_completed_ = false;
422 461
423 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClient); 462 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClient);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); 638 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id);
600 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 639 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
601 ServerWindow* parent, 640 ServerWindow* parent,
602 ClientWindowId* client_id); 641 ClientWindowId* client_id);
603 642
604 } // namespace test 643 } // namespace test
605 } // namespace ws 644 } // namespace ws
606 } // namespace ui 645 } // namespace ui
607 646
608 #endif // SERVICES_UI_WS_TEST_UTILS_H_ 647 #endif // SERVICES_UI_WS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « services/ui/ws/server_window.cc ('k') | services/ui/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698