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

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2235363003: Wires up WmShellMus::Add/RemovePointerWatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pointer_watcher_capture
Patch Set: merge to tot again Created 4 years, 4 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 | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/window_manager.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 "ash/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/display/display_info.h" 10 #include "ash/common/display/display_info.h"
(...skipping 17 matching lines...) Expand all
28 #include "ash/mus/container_ids.h" 28 #include "ash/mus/container_ids.h"
29 #include "ash/mus/drag_window_resizer.h" 29 #include "ash/mus/drag_window_resizer.h"
30 #include "ash/mus/root_window_controller.h" 30 #include "ash/mus/root_window_controller.h"
31 #include "ash/mus/window_manager.h" 31 #include "ash/mus/window_manager.h"
32 #include "base/memory/ptr_util.h" 32 #include "base/memory/ptr_util.h"
33 #include "components/user_manager/user_info_impl.h" 33 #include "components/user_manager/user_info_impl.h"
34 #include "services/ui/common/util.h" 34 #include "services/ui/common/util.h"
35 #include "services/ui/public/cpp/window.h" 35 #include "services/ui/public/cpp/window.h"
36 #include "services/ui/public/cpp/window_tree_client.h" 36 #include "services/ui/public/cpp/window_tree_client.h"
37 #include "ui/display/screen.h" 37 #include "ui/display/screen.h"
38 #include "ui/views/mus/pointer_watcher_event_router.h"
38 39
39 namespace ash { 40 namespace ash {
40 namespace mus { 41 namespace mus {
41 42
42 namespace { 43 namespace {
43 44
44 // TODO(jamescook): After ShellDelegate is ported to ash/common use 45 // TODO(jamescook): After ShellDelegate is ported to ash/common use
45 // ShellDelegate::CreateSessionStateDelegate() to construct the mus version 46 // ShellDelegate::CreateSessionStateDelegate() to construct the mus version
46 // of SessionStateDelegate. 47 // of SessionStateDelegate.
47 class SessionStateDelegateStub : public SessionStateDelegate { 48 class SessionStateDelegateStub : public SessionStateDelegate {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 bool screen_locked_; 96 bool screen_locked_;
96 97
97 // A pseudo user info. 98 // A pseudo user info.
98 std::unique_ptr<user_manager::UserInfo> user_info_; 99 std::unique_ptr<user_manager::UserInfo> user_info_;
99 100
100 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); 101 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub);
101 }; 102 };
102 103
103 } // namespace 104 } // namespace
104 105
105 WmShellMus::WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, 106 WmShellMus::WmShellMus(
106 WindowManager* window_manager) 107 std::unique_ptr<ShellDelegate> shell_delegate,
108 WindowManager* window_manager,
109 views::PointerWatcherEventRouter* pointer_watcher_event_router)
107 : WmShell(std::move(shell_delegate)), 110 : WmShell(std::move(shell_delegate)),
108 window_manager_(window_manager), 111 window_manager_(window_manager),
112 pointer_watcher_event_router_(pointer_watcher_event_router),
109 session_state_delegate_(new SessionStateDelegateStub) { 113 session_state_delegate_(new SessionStateDelegateStub) {
110 window_tree_client()->AddObserver(this); 114 window_tree_client()->AddObserver(this);
111 WmShell::Set(this); 115 WmShell::Set(this);
112 116
113 uint16_t accelerator_namespace_id = 0u; 117 uint16_t accelerator_namespace_id = 0u;
114 const bool add_result = 118 const bool add_result =
115 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id); 119 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
116 // WmShellMus is created early on, so that this should always succeed. 120 // WmShellMus is created early on, so that this should always succeed.
117 DCHECK(add_result); 121 DCHECK(add_result);
118 accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateMus); 122 accelerator_controller_delegate_.reset(new AcceleratorControllerDelegateMus);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 354 }
351 355
352 void WmShellMus::AddDisplayObserver(WmDisplayObserver* observer) { 356 void WmShellMus::AddDisplayObserver(WmDisplayObserver* observer) {
353 NOTIMPLEMENTED(); 357 NOTIMPLEMENTED();
354 } 358 }
355 359
356 void WmShellMus::RemoveDisplayObserver(WmDisplayObserver* observer) { 360 void WmShellMus::RemoveDisplayObserver(WmDisplayObserver* observer) {
357 NOTIMPLEMENTED(); 361 NOTIMPLEMENTED();
358 } 362 }
359 363
360 void WmShellMus::AddPointerWatcher(views::PointerWatcher* watcher) { 364 void WmShellMus::AddPointerWatcher(views::PointerWatcher* watcher,
361 // TODO(jamescook): Move PointerWatcherDelegateMus to //ash/mus and use here. 365 bool wants_moves) {
362 NOTIMPLEMENTED(); 366 pointer_watcher_event_router_->AddPointerWatcher(watcher, wants_moves);
363 } 367 }
364 368
365 void WmShellMus::RemovePointerWatcher(views::PointerWatcher* watcher) { 369 void WmShellMus::RemovePointerWatcher(views::PointerWatcher* watcher) {
366 NOTIMPLEMENTED(); 370 pointer_watcher_event_router_->RemovePointerWatcher(watcher);
367 } 371 }
368 372
369 bool WmShellMus::IsTouchDown() { 373 bool WmShellMus::IsTouchDown() {
370 // TODO: implement me, http://crbug.com/634967. 374 // TODO: implement me, http://crbug.com/634967.
371 // NOTIMPLEMENTED is too spammy here. 375 // NOTIMPLEMENTED is too spammy here.
372 return false; 376 return false;
373 } 377 }
374 378
375 #if defined(OS_CHROMEOS) 379 #if defined(OS_CHROMEOS)
376 void WmShellMus::ToggleIgnoreExternalKeyboard() { 380 void WmShellMus::ToggleIgnoreExternalKeyboard() {
(...skipping 26 matching lines...) Expand all
403 OnWindowActivated(gained_active, lost_active)); 407 OnWindowActivated(gained_active, lost_active));
404 } 408 }
405 409
406 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { 410 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) {
407 DCHECK_EQ(window_tree_client(), client); 411 DCHECK_EQ(window_tree_client(), client);
408 client->RemoveObserver(this); 412 client->RemoveObserver(this);
409 } 413 }
410 414
411 } // namespace mus 415 } // namespace mus
412 } // namespace ash 416 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698