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

Side by Side Diff: ash/mus/window_manager.cc

Issue 2837893002: Wires up InputDeviceClient for mash/mushrome (Closed)
Patch Set: comment Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/window_manager.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "ash/shell_init_params.h" 32 #include "ash/shell_init_params.h"
33 #include "ash/wm/ash_focus_rules.h" 33 #include "ash/wm/ash_focus_rules.h"
34 #include "ash/wm/container_finder.h" 34 #include "ash/wm/container_finder.h"
35 #include "ash/wm/window_state.h" 35 #include "ash/wm/window_state.h"
36 #include "ash/wm_window.h" 36 #include "ash/wm_window.h"
37 #include "base/memory/ptr_util.h" 37 #include "base/memory/ptr_util.h"
38 #include "base/threading/sequenced_worker_pool.h" 38 #include "base/threading/sequenced_worker_pool.h"
39 #include "services/service_manager/public/cpp/connector.h" 39 #include "services/service_manager/public/cpp/connector.h"
40 #include "services/ui/common/accelerator_util.h" 40 #include "services/ui/common/accelerator_util.h"
41 #include "services/ui/common/types.h" 41 #include "services/ui/common/types.h"
42 #include "services/ui/public/cpp/input_devices/input_device_client.h"
42 #include "services/ui/public/cpp/property_type_converters.h" 43 #include "services/ui/public/cpp/property_type_converters.h"
43 #include "services/ui/public/interfaces/constants.mojom.h" 44 #include "services/ui/public/interfaces/constants.mojom.h"
44 #include "services/ui/public/interfaces/window_manager.mojom.h" 45 #include "services/ui/public/interfaces/window_manager.mojom.h"
45 #include "ui/aura/client/aura_constants.h" 46 #include "ui/aura/client/aura_constants.h"
46 #include "ui/aura/client/window_parenting_client.h" 47 #include "ui/aura/client/window_parenting_client.h"
47 #include "ui/aura/env.h" 48 #include "ui/aura/env.h"
48 #include "ui/aura/mus/capture_synchronizer.h" 49 #include "ui/aura/mus/capture_synchronizer.h"
49 #include "ui/aura/mus/property_converter.h" 50 #include "ui/aura/mus/property_converter.h"
50 #include "ui/aura/mus/window_tree_client.h" 51 #include "ui/aura/mus/window_tree_client.h"
51 #include "ui/aura/mus/window_tree_host_mus.h" 52 #include "ui/aura/mus/window_tree_host_mus.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 WindowManager::~WindowManager() { 103 WindowManager::~WindowManager() {
103 Shutdown(); 104 Shutdown();
104 ash::Shell::set_window_tree_client(nullptr); 105 ash::Shell::set_window_tree_client(nullptr);
105 ash::Shell::set_window_manager_client(nullptr); 106 ash::Shell::set_window_manager_client(nullptr);
106 } 107 }
107 108
108 void WindowManager::Init( 109 void WindowManager::Init(
109 std::unique_ptr<aura::WindowTreeClient> window_tree_client, 110 std::unique_ptr<aura::WindowTreeClient> window_tree_client,
110 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool, 111 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool,
111 std::unique_ptr<ShellDelegate> shell_delegate) { 112 std::unique_ptr<ShellDelegate> shell_delegate) {
113 // Only create InputDeviceClient in MASH mode. For MUS mode WindowManager is
114 // created by chrome, which creates InputDeviceClient.
115 if (config_ == Config::MASH)
116 input_device_client_ = base::MakeUnique<ui::InputDeviceClient>();
117
112 blocking_pool_ = blocking_pool; 118 blocking_pool_ = blocking_pool;
113 DCHECK(window_manager_client_); 119 DCHECK(window_manager_client_);
114 DCHECK(!window_tree_client_); 120 DCHECK(!window_tree_client_);
115 window_tree_client_ = std::move(window_tree_client); 121 window_tree_client_ = std::move(window_tree_client);
116 122
117 DCHECK_EQ(nullptr, ash::Shell::window_tree_client()); 123 DCHECK_EQ(nullptr, ash::Shell::window_tree_client());
118 ash::Shell::set_window_tree_client(window_tree_client_.get()); 124 ash::Shell::set_window_tree_client(window_tree_client_.get());
119 125
120 // |connector_| will be null in some tests. 126 // |connector_| will be null in some tests.
121 if (connector_) 127 if (connector_)
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 bool WindowManager::IsWindowActive(aura::Window* window) { 568 bool WindowManager::IsWindowActive(aura::Window* window) {
563 return Shell::Get()->activation_client()->GetActiveWindow() == window; 569 return Shell::Get()->activation_client()->GetActiveWindow() == window;
564 } 570 }
565 571
566 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { 572 void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
567 Shell::Get()->activation_client()->DeactivateWindow(window); 573 Shell::Get()->activation_client()->DeactivateWindow(window);
568 } 574 }
569 575
570 } // namespace mus 576 } // namespace mus
571 } // namespace ash 577 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698