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

Unified Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 2914103002: Remove usages of XInternAtom (Closed)
Patch Set: Address sadrul and sergeyu comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/x11_desktop_handler.cc
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
index 4d9ba573c229ae67398de9eeaa402c29a72e89f7..3ee269bb3d4bec82e20a74f1b827029ba5825e2a 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -20,11 +20,6 @@
namespace {
-const char* const kAtomsToCache[] = {
- "_NET_CURRENT_DESKTOP",
- nullptr
-};
-
// Our global instance. Deleted when our Env() is deleted.
views::X11DesktopHandler* g_handler = NULL;
@@ -47,8 +42,7 @@ X11DesktopHandler* X11DesktopHandler::get_dont_create() {
X11DesktopHandler::X11DesktopHandler()
: xdisplay_(gfx::GetXDisplay()),
- x_root_window_(DefaultRootWindow(xdisplay_)),
- atom_cache_(xdisplay_, kAtomsToCache) {
+ x_root_window_(DefaultRootWindow(xdisplay_)) {
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
aura::Env::GetInstance()->AddObserver(this);
@@ -96,8 +90,7 @@ bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) {
uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) {
switch (event->type) {
case PropertyNotify: {
- if (event->xproperty.atom ==
- atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) {
+ if (event->xproperty.atom == ui::GetAtom("_NET_CURRENT_DESKTOP")) {
if (UpdateWorkspace()) {
for (views::X11DesktopHandlerObserver& observer : observers_)
observer.OnWorkspaceChanged(workspace_);

Powered by Google App Engine
This is Rietveld 408576698