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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc

Issue 12263050: Rework ash::CursorManager into a corewm object, to share code with desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: General patch cleanup. Created 7 years, 10 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 | Annotate | Revision Log
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 "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h" 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 10
11 #include "base/message_pump_aurax11.h" 11 #include "base/message_pump_aurax11.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "ui/aura/client/cursor_client.h"
15 #include "ui/aura/client/default_capture_client.h" 14 #include "ui/aura/client/default_capture_client.h"
16 #include "ui/aura/client/screen_position_client.h" 15 #include "ui/aura/client/screen_position_client.h"
17 #include "ui/aura/client/user_action_client.h" 16 #include "ui/aura/client/user_action_client.h"
18 #include "ui/aura/focus_manager.h" 17 #include "ui/aura/focus_manager.h"
19 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
20 #include "ui/aura/window_property.h" 19 #include "ui/aura/window_property.h"
21 #include "ui/base/events/event_utils.h" 20 #include "ui/base/events/event_utils.h"
22 #include "ui/base/touch/touch_factory.h" 21 #include "ui/base/touch/touch_factory.h"
23 #include "ui/base/x/x11_util.h" 22 #include "ui/base/x/x11_util.h"
24 #include "ui/native_theme/native_theme.h" 23 #include "ui/native_theme/native_theme.h"
25 #include "ui/views/corewm/compound_event_filter.h" 24 #include "ui/views/corewm/compound_event_filter.h"
26 #include "ui/views/corewm/corewm_switches.h" 25 #include "ui/views/corewm/corewm_switches.h"
26 #include "ui/views/corewm/cursor_manager.h"
27 #include "ui/views/corewm/focus_controller.h" 27 #include "ui/views/corewm/focus_controller.h"
28 #include "ui/views/ime/input_method.h" 28 #include "ui/views/ime/input_method.h"
29 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" 29 #include "ui/views/widget/desktop_aura/desktop_activation_client.h"
30 #include "ui/views/widget/desktop_aura/desktop_cursor_client.h" 30 #include "ui/views/widget/desktop_aura/desktop_cursor_platform_delegate.h"
31 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" 31 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h"
32 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" 32 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h"
33 #include "ui/views/widget/desktop_aura/desktop_layout_manager.h" 33 #include "ui/views/widget/desktop_aura/desktop_layout_manager.h"
34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
35 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" 35 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h"
36 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" 36 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
37 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" 37 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h"
38 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h" 38 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h"
39 39
40 namespace views { 40 namespace views {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } else { 231 } else {
232 focus_client_.reset(new aura::FocusManager); 232 focus_client_.reset(new aura::FocusManager);
233 aura::client::SetFocusClient(root_window_, focus_client_.get()); 233 aura::client::SetFocusClient(root_window_, focus_client_.get());
234 activation_client_.reset(new DesktopActivationClient(root_window_)); 234 activation_client_.reset(new DesktopActivationClient(root_window_));
235 } 235 }
236 236
237 dispatcher_client_.reset(new DesktopDispatcherClient); 237 dispatcher_client_.reset(new DesktopDispatcherClient);
238 aura::client::SetDispatcherClient(root_window_, 238 aura::client::SetDispatcherClient(root_window_,
239 dispatcher_client_.get()); 239 dispatcher_client_.get());
240 240
241 cursor_client_.reset(new DesktopCursorClient(root_window_)); 241 cursor_client_.reset(
242 new views::corewm::CursorManager(
243 scoped_ptr<corewm::CursorPlatformDelegate>(
244 new views::DesktopCursorPlatformDelegate(root_window_))));
242 aura::client::SetCursorClient(root_window_, 245 aura::client::SetCursorClient(root_window_,
243 cursor_client_.get()); 246 cursor_client_.get());
244 247
245 position_client_.reset(new DesktopScreenPositionClient); 248 position_client_.reset(new DesktopScreenPositionClient);
246 aura::client::SetScreenPositionClient(root_window_, 249 aura::client::SetScreenPositionClient(root_window_,
247 position_client_.get()); 250 position_client_.get());
248 251
249 desktop_native_widget_aura_->InstallInputMethodEventFilter(root_window_); 252 desktop_native_widget_aura_->InstallInputMethodEventFilter(root_window_);
250 253
251 // TODO(erg): Unify this code once the other consumer goes away. 254 // TODO(erg): Unify this code once the other consumer goes away.
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() { 787 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() {
785 NOTIMPLEMENTED(); 788 NOTIMPLEMENTED();
786 return false; 789 return false;
787 } 790 }
788 791
789 void DesktopRootWindowHostLinux::UnConfineCursor() { 792 void DesktopRootWindowHostLinux::UnConfineCursor() {
790 NOTIMPLEMENTED(); 793 NOTIMPLEMENTED();
791 } 794 }
792 795
793 void DesktopRootWindowHostLinux::OnCursorVisibilityChanged(bool show) { 796 void DesktopRootWindowHostLinux::OnCursorVisibilityChanged(bool show) {
794 NOTIMPLEMENTED(); 797 // TODO(erg): Conditional on us enabling touch on desktop linux builds, do
798 // the same tap-to-click disabling here that chromeos does.
795 } 799 }
796 800
797 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { 801 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) {
798 NOTIMPLEMENTED(); 802 NOTIMPLEMENTED();
799 } 803 }
800 804
801 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { 805 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) {
802 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME"; 806 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME";
803 focus_when_shown_ = focus_when_shown; 807 focus_when_shown_ = focus_when_shown;
804 if (IsWindowManagerPresent() && !focus_when_shown_) { 808 if (IsWindowManagerPresent() && !focus_when_shown_) {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 DesktopRootWindowHost* DesktopRootWindowHost::Create( 1105 DesktopRootWindowHost* DesktopRootWindowHost::Create(
1102 internal::NativeWidgetDelegate* native_widget_delegate, 1106 internal::NativeWidgetDelegate* native_widget_delegate,
1103 DesktopNativeWidgetAura* desktop_native_widget_aura, 1107 DesktopNativeWidgetAura* desktop_native_widget_aura,
1104 const gfx::Rect& initial_bounds) { 1108 const gfx::Rect& initial_bounds) {
1105 return new DesktopRootWindowHostLinux(native_widget_delegate, 1109 return new DesktopRootWindowHostLinux(native_widget_delegate,
1106 desktop_native_widget_aura, 1110 desktop_native_widget_aura,
1107 initial_bounds); 1111 initial_bounds);
1108 } 1112 }
1109 1113
1110 } // namespace views 1114 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698