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

Side by Side Diff: ui/base/x/x11_util.cc

Issue 2049493004: Remove use of deprecated MessageLoop methods in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 // This file defines utility functions for X11 (Linux only). This code has been 5 // This file defines utility functions for X11 (Linux only). This code has been
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support
7 // remains woefully incomplete. 7 // remains woefully incomplete.
8 8
9 #include "ui/base/x/x11_util.h" 9 #include "ui/base/x/x11_util.h"
10 10
11 #include <X11/Xcursor/Xcursor.h>
12 #include <X11/extensions/XInput2.h>
13 #include <X11/extensions/shape.h>
14 #include <ctype.h> 11 #include <ctype.h>
15 #include <sys/ipc.h> 12 #include <sys/ipc.h>
16 #include <sys/shm.h> 13 #include <sys/shm.h>
14 #include <X11/extensions/shape.h>
15 #include <X11/extensions/XInput2.h>
16 #include <X11/Xcursor/Xcursor.h>
17 17
18 #include <list> 18 #include <list>
19 #include <map> 19 #include <map>
20 #include <memory> 20 #include <memory>
21 #include <utility> 21 #include <utility>
22 #include <vector> 22 #include <vector>
23 23
24 #include "base/bind.h" 24 #include "base/bind.h"
25 #include "base/location.h"
25 #include "base/logging.h" 26 #include "base/logging.h"
26 #include "base/macros.h" 27 #include "base/macros.h"
27 #include "base/memory/singleton.h" 28 #include "base/memory/singleton.h"
28 #include "base/message_loop/message_loop.h" 29 #include "base/message_loop/message_loop.h"
29 #include "base/metrics/histogram.h" 30 #include "base/metrics/histogram.h"
31 #include "base/single_thread_task_runner.h"
30 #include "base/stl_util.h" 32 #include "base/stl_util.h"
31 #include "base/strings/string_number_conversions.h" 33 #include "base/strings/string_number_conversions.h"
32 #include "base/strings/string_util.h" 34 #include "base/strings/string_util.h"
33 #include "base/strings/stringprintf.h" 35 #include "base/strings/stringprintf.h"
34 #include "base/sys_byteorder.h" 36 #include "base/sys_byteorder.h"
35 #include "base/threading/thread.h" 37 #include "base/threading/thread.h"
38 #include "base/threading/thread_task_runner_handle.h"
36 #include "base/trace_event/trace_event.h" 39 #include "base/trace_event/trace_event.h"
37 #include "build/build_config.h" 40 #include "build/build_config.h"
38 #include "skia/ext/image_operations.h" 41 #include "skia/ext/image_operations.h"
39 #include "third_party/skia/include/core/SkBitmap.h" 42 #include "third_party/skia/include/core/SkBitmap.h"
40 #include "third_party/skia/include/core/SkPostConfig.h" 43 #include "third_party/skia/include/core/SkPostConfig.h"
41 #include "ui/base/x/x11_menu_list.h" 44 #include "ui/base/x/x11_menu_list.h"
42 #include "ui/base/x/x11_util_internal.h" 45 #include "ui/base/x/x11_util_internal.h"
43 #include "ui/events/devices/x11/device_data_manager_x11.h" 46 #include "ui/events/devices/x11/device_data_manager_x11.h"
44 #include "ui/events/devices/x11/touch_factory_x11.h" 47 #include "ui/events/devices/x11/touch_factory_x11.h"
45 #include "ui/events/event_utils.h" 48 #include "ui/events/event_utils.h"
(...skipping 18 matching lines...) Expand all
64 #include <sys/sysctl.h> 67 #include <sys/sysctl.h>
65 #include <sys/types.h> 68 #include <sys/types.h>
66 #endif 69 #endif
67 70
68 namespace ui { 71 namespace ui {
69 72
70 namespace { 73 namespace {
71 74
72 int DefaultX11ErrorHandler(XDisplay* d, XErrorEvent* e) { 75 int DefaultX11ErrorHandler(XDisplay* d, XErrorEvent* e) {
73 if (base::MessageLoop::current()) { 76 if (base::MessageLoop::current()) {
74 base::MessageLoop::current()->PostTask( 77 base::ThreadTaskRunnerHandle::Get()->PostTask(
75 FROM_HERE, base::Bind(&LogErrorEventDescription, d, *e)); 78 FROM_HERE, base::Bind(&LogErrorEventDescription, d, *e));
76 } else { 79 } else {
77 LOG(ERROR) 80 LOG(ERROR)
78 << "X error received: " 81 << "X error received: "
79 << "serial " << e->serial << ", " 82 << "serial " << e->serial << ", "
80 << "error_code " << static_cast<int>(e->error_code) << ", " 83 << "error_code " << static_cast<int>(e->error_code) << ", "
81 << "request_code " << static_cast<int>(e->request_code) << ", " 84 << "request_code " << static_cast<int>(e->request_code) << ", "
82 << "minor_code " << static_cast<int>(e->minor_code); 85 << "minor_code " << static_cast<int>(e->minor_code);
83 } 86 }
84 return 0; 87 return 0;
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 if (depth) 1472 if (depth)
1470 *depth = s_depth; 1473 *depth = s_depth;
1471 } 1474 }
1472 #endif 1475 #endif
1473 1476
1474 // ---------------------------------------------------------------------------- 1477 // ----------------------------------------------------------------------------
1475 // End of x11_util_internal.h 1478 // End of x11_util_internal.h
1476 1479
1477 1480
1478 } // namespace ui 1481 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/osk_display_manager.cc ('k') | ui/display/chromeos/test/test_native_display_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698