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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.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/desktop_drag_drop_client_aurax11_unittest.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
index 21cd3ff1ba9aed6775f1c1d80df4ccfb3ea27545..862d806f43ff6c45b4404d6f83496adc631b9798 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
@@ -24,7 +24,6 @@
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/event_utils.h"
-#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h"
#include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h"
@@ -38,18 +37,6 @@ namespace views {
namespace {
-const char* kAtomsToCache[] = {
- "XdndActionCopy",
- "XdndDrop",
- "XdndEnter",
- "XdndFinished",
- "XdndLeave",
- "XdndPosition",
- "XdndStatus",
- "XdndTypeList",
- NULL
-};
-
class TestDragDropClient;
// Collects messages which would otherwise be sent to |xid_| via
@@ -195,8 +182,6 @@ class TestDragDropClient : public SimpleTestDragDropClient {
// for that window.
std::map< ::Window, ClientMessageEventCollector*> collectors_;
- ui::X11AtomCache atom_cache_;
-
DISALLOW_COPY_AND_ASSIGN(TestDragDropClient);
};
@@ -310,20 +295,18 @@ TestDragDropClient::TestDragDropClient(
aura::Window* window,
DesktopNativeCursorManager* cursor_manager)
: SimpleTestDragDropClient(window, cursor_manager),
- source_xid_(window->GetHost()->GetAcceleratedWidget()),
- atom_cache_(gfx::GetXDisplay(), kAtomsToCache) {
-}
+ source_xid_(window->GetHost()->GetAcceleratedWidget()) {}
TestDragDropClient::~TestDragDropClient() {
}
Atom TestDragDropClient::GetAtom(const char* name) {
- return atom_cache_.GetAtom(name);
+ return ui::GetAtom(name);
}
bool TestDragDropClient::MessageHasType(const XClientMessageEvent& event,
const char* type) {
- return event.message_type == atom_cache_.GetAtom(type);
+ return event.message_type == GetAtom(type);
}
void TestDragDropClient::SetEventCollectorFor(
@@ -339,7 +322,7 @@ void TestDragDropClient::OnStatus(XID target_window,
bool will_accept_drop,
::Atom accepted_action) {
XClientMessageEvent event;
- event.message_type = atom_cache_.GetAtom("XdndStatus");
+ event.message_type = GetAtom("XdndStatus");
event.format = 32;
event.window = source_xid_;
event.data.l[0] = target_window;
@@ -354,7 +337,7 @@ void TestDragDropClient::OnFinished(XID target_window,
bool accepted_drop,
::Atom performed_action) {
XClientMessageEvent event;
- event.message_type = atom_cache_.GetAtom("XdndFinished");
+ event.message_type = GetAtom("XdndFinished");
event.format = 32;
event.window = source_xid_;
event.data.l[0] = target_window;
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698