| OLD | NEW |
| 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/base/dragdrop/os_exchange_data_provider_aurax11.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/message_loop/message_pump_aurax11.h" | 9 #include "base/message_loop/message_pump_x11.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
| 13 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
| 14 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 14 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 15 #include "ui/base/x/selection_utils.h" | 15 #include "ui/base/x/selection_utils.h" |
| 16 #include "ui/base/x/x11_util.h" | 16 #include "ui/base/x/x11_util.h" |
| 17 | 17 |
| 18 // Note: the GetBlah() methods are used immediately by the | 18 // Note: the GetBlah() methods are used immediately by the |
| 19 // web_contents_view_aura.cc:PrepareDropData(), while the omnibox is a | 19 // web_contents_view_aura.cc:PrepareDropData(), while the omnibox is a |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 NULL)), | 70 NULL)), |
| 71 atom_cache_(x_display_, kAtomsToCache), | 71 atom_cache_(x_display_, kAtomsToCache), |
| 72 format_map_(), | 72 format_map_(), |
| 73 selection_owner_(x_display_, x_window_, | 73 selection_owner_(x_display_, x_window_, |
| 74 atom_cache_.GetAtom(kDndSelection)) { | 74 atom_cache_.GetAtom(kDndSelection)) { |
| 75 // We don't know all possible MIME types at compile time. | 75 // We don't know all possible MIME types at compile time. |
| 76 atom_cache_.allow_uncached_atoms(); | 76 atom_cache_.allow_uncached_atoms(); |
| 77 | 77 |
| 78 XStoreName(x_display_, x_window_, "Chromium Drag & Drop Window"); | 78 XStoreName(x_display_, x_window_, "Chromium Drag & Drop Window"); |
| 79 | 79 |
| 80 base::MessagePumpAuraX11::Current()->AddDispatcherForWindow(this, x_window_); | 80 base::MessagePumpX11::Current()->AddDispatcherForWindow(this, x_window_); |
| 81 } | 81 } |
| 82 | 82 |
| 83 OSExchangeDataProviderAuraX11::~OSExchangeDataProviderAuraX11() { | 83 OSExchangeDataProviderAuraX11::~OSExchangeDataProviderAuraX11() { |
| 84 if (own_window_) { | 84 if (own_window_) { |
| 85 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(x_window_); | 85 base::MessagePumpX11::Current()->RemoveDispatcherForWindow(x_window_); |
| 86 XDestroyWindow(x_display_, x_window_); | 86 XDestroyWindow(x_display_, x_window_); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 void OSExchangeDataProviderAuraX11::TakeOwnershipOfSelection() const { | 90 void OSExchangeDataProviderAuraX11::TakeOwnershipOfSelection() const { |
| 91 selection_owner_.TakeOwnershipOfSelection(format_map_); | 91 selection_owner_.TakeOwnershipOfSelection(format_map_); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void OSExchangeDataProviderAuraX11::RetrieveTargets( | 94 void OSExchangeDataProviderAuraX11::RetrieveTargets( |
| 95 std::vector<Atom>* targets) const { | 95 std::vector<Atom>* targets) const { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 /////////////////////////////////////////////////////////////////////////////// | 374 /////////////////////////////////////////////////////////////////////////////// |
| 375 // OSExchangeData, public: | 375 // OSExchangeData, public: |
| 376 | 376 |
| 377 // static | 377 // static |
| 378 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 378 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
| 379 return new OSExchangeDataProviderAuraX11(); | 379 return new OSExchangeDataProviderAuraX11(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace ui | 382 } // namespace ui |
| OLD | NEW |