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

Side by Side Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc

Issue 2058853002: Enable InputDeviceServer/InputDeviceClient in mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_device
Patch Set: Rebase. Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
6 6
7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" 7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
8 #include "chrome/browser/ui/views/chrome_views_delegate.h" 8 #include "chrome/browser/ui/views/chrome_views_delegate.h"
9 #include "components/constrained_window/constrained_window_views.h" 9 #include "components/constrained_window/constrained_window_views.h"
10 10
11 #if defined(USE_AURA) 11 #if defined(USE_AURA)
12 #include "ui/display/screen.h" 12 #include "ui/display/screen.h"
13 #include "ui/views/widget/desktop_aura/desktop_screen.h" 13 #include "ui/views/widget/desktop_aura/desktop_screen.h"
14 #include "ui/wm/core/wm_state.h" 14 #include "ui/wm/core/wm_state.h"
15 #endif 15 #endif
16 16
17 #if defined(USE_AURA) && defined(MOJO_SHELL_CLIENT) 17 #if defined(USE_AURA) && defined(MOJO_SHELL_CLIENT)
18 #include "components/mus/public/cpp/input_devices/input_device_client.h"
19 #include "components/mus/public/interfaces/input_devices/input_device_server.moj om.h"
18 #include "content/public/common/mojo_shell_connection.h" 20 #include "content/public/common/mojo_shell_connection.h"
21 #include "services/shell/public/cpp/connector.h"
19 #include "ui/views/mus/window_manager_connection.h" 22 #include "ui/views/mus/window_manager_connection.h"
20 #endif 23 #endif
21 24
22 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() { 25 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() {
23 } 26 }
24 27
25 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { 28 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() {
26 constrained_window::SetConstrainedWindowViewsClient(nullptr); 29 constrained_window::SetConstrainedWindowViewsClient(nullptr);
27 } 30 }
28 31
(...skipping 14 matching lines...) Expand all
43 #if defined(USE_AURA) && !defined(OS_CHROMEOS) 46 #if defined(USE_AURA) && !defined(OS_CHROMEOS)
44 display::Screen::SetScreenInstance(views::CreateDesktopScreen()); 47 display::Screen::SetScreenInstance(views::CreateDesktopScreen());
45 #endif 48 #endif
46 } 49 }
47 50
48 void ChromeBrowserMainExtraPartsViews::PreProfileInit() { 51 void ChromeBrowserMainExtraPartsViews::PreProfileInit() {
49 #if defined(USE_AURA) && defined(MOJO_SHELL_CLIENT) 52 #if defined(USE_AURA) && defined(MOJO_SHELL_CLIENT)
50 content::MojoShellConnection* mojo_shell_connection = 53 content::MojoShellConnection* mojo_shell_connection =
51 content::MojoShellConnection::Get(); 54 content::MojoShellConnection::Get();
52 if (mojo_shell_connection && mojo_shell_connection->UsingExternalShell()) { 55 if (mojo_shell_connection && mojo_shell_connection->UsingExternalShell()) {
56 input_device_client_.reset(new input_device::InputDeviceClient());
57 input_device::mojom::InputDeviceServerPtr server;
58 mojo_shell_connection->GetConnector()->ConnectToInterface("mojo:mus",
59 &server);
60 input_device_client_->Connect(std::move(server));
61
53 window_manager_connection_ = views::WindowManagerConnection::Create( 62 window_manager_connection_ = views::WindowManagerConnection::Create(
54 mojo_shell_connection->GetConnector(), 63 mojo_shell_connection->GetConnector(),
55 mojo_shell_connection->GetIdentity()); 64 mojo_shell_connection->GetIdentity());
56 } 65 }
57 #endif // defined(USE_AURA) && defined(MOJO_SHELL_CLIENT) 66 #endif // defined(USE_AURA) && defined(MOJO_SHELL_CLIENT)
58 ChromeBrowserMainExtraParts::PreProfileInit(); 67 ChromeBrowserMainExtraParts::PreProfileInit();
59 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698