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

Unified Diff: ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.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_topmost_window_finder_interactive_uitest.cc
diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
index 112a741c6140a5888daac8ad044c02efe21e06cc..355093016bf2cd14744d9aef6181f2a35bb2e521 100644
--- a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
+++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
@@ -26,7 +26,6 @@
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/gfx/path.h"
#include "ui/gfx/path_x11.h"
-#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/views/test/views_interactive_ui_test_base.h"
#include "ui/views/test/x11_property_change_waiter.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
@@ -41,10 +40,7 @@ namespace {
class MinimizeWaiter : public X11PropertyChangeWaiter {
public:
explicit MinimizeWaiter(XID window)
- : X11PropertyChangeWaiter(window, "_NET_WM_STATE") {
- const char* const kAtomsToCache[] = {"_NET_WM_STATE_HIDDEN", nullptr};
- atom_cache_.reset(new ui::X11AtomCache(gfx::GetXDisplay(), kAtomsToCache));
- }
+ : X11PropertyChangeWaiter(window, "_NET_WM_STATE") {}
~MinimizeWaiter() override {}
@@ -54,14 +50,12 @@ class MinimizeWaiter : public X11PropertyChangeWaiter {
std::vector<Atom> wm_states;
if (ui::GetAtomArrayProperty(xwindow(), "_NET_WM_STATE", &wm_states)) {
auto it = std::find(wm_states.cbegin(), wm_states.cend(),
- atom_cache_->GetAtom("_NET_WM_STATE_HIDDEN"));
+ ui::GetAtom("_NET_WM_STATE_HIDDEN"));
return it == wm_states.cend();
}
return true;
}
- std::unique_ptr<ui::X11AtomCache> atom_cache_;
-
DISALLOW_COPY_AND_ASSIGN(MinimizeWaiter);
};
@@ -400,12 +394,8 @@ TEST_F(X11TopmostWindowFinderTest, Menu) {
CWOverrideRedirect,
&swa);
{
- const char* const kAtomsToCache[] = {"_NET_WM_WINDOW_TYPE_MENU", nullptr};
- ui::X11AtomCache atom_cache(gfx::GetXDisplay(), kAtomsToCache);
- ui::SetAtomProperty(menu_xid,
- "_NET_WM_WINDOW_TYPE",
- "ATOM",
- atom_cache.GetAtom("_NET_WM_WINDOW_TYPE_MENU"));
+ ui::SetAtomProperty(menu_xid, "_NET_WM_WINDOW_TYPE", "ATOM",
+ ui::GetAtom("_NET_WM_WINDOW_TYPE_MENU"));
}
ui::SetUseOSWindowFrame(menu_xid, false);
ShowAndSetXWindowBounds(menu_xid, gfx::Rect(140, 110, 100, 100));
« no previous file with comments | « ui/views/widget/desktop_aura/x11_desktop_handler.cc ('k') | ui/views/widget/desktop_aura/x11_window_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698