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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_aurax11.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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/base/dragdrop/os_exchange_data_provider_aurax11.h
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
deleted file mode 100644
index 9664b026144daa9d67355bd4c90ba204165a758e..0000000000000000000000000000000000000000
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
-#define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
-
-#include <X11/Xlib.h>
-
-// Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
-#undef RootWindow
-
-#include <map>
-
-#include "base/files/file_path.h"
-#include "base/pickle.h"
-#include "ui/base/dragdrop/os_exchange_data.h"
-#include "ui/base/x/selection_owner.h"
-#include "ui/base/x/selection_requestor.h"
-#include "ui/base/x/selection_utils.h"
-#include "ui/events/platform/platform_event_dispatcher.h"
-#include "ui/gfx/image/image_skia.h"
-#include "ui/gfx/vector2d.h"
-#include "ui/gfx/x/x11_atom_cache.h"
-#include "url/gurl.h"
-
-namespace ui {
-
-class Clipboard;
-class OSExchangeDataProviderAuraX11Test;
-
-// OSExchangeData::Provider implementation for aura on linux.
-class UI_BASE_EXPORT OSExchangeDataProviderAuraX11
- : public OSExchangeData::Provider,
- public ui::PlatformEventDispatcher {
- public:
- // |x_window| is the window the cursor is over, and |selection| is the set of
- // data being offered.
- OSExchangeDataProviderAuraX11(::Window x_window,
- const SelectionFormatMap& selection);
-
- // Creates a Provider for sending drag information. This creates its own,
- // hidden X11 window to own send data.
- OSExchangeDataProviderAuraX11();
-
- virtual ~OSExchangeDataProviderAuraX11();
-
- // After all the Set* methods have built up the data we're offering, call
- // this to take ownership of the XdndSelection clipboard.
- void TakeOwnershipOfSelection() const;
-
- // Retrieves a list of types we're offering. Noop if we haven't taken the
- // selection.
- void RetrieveTargets(std::vector<Atom>* targets) const;
-
- // Makes a copy of the format map currently being offered.
- SelectionFormatMap GetFormatMap() const;
-
- const base::FilePath& file_contents_name() const {
- return file_contents_name_;
- }
-
- // Overridden from OSExchangeData::Provider:
- virtual Provider* Clone() const override;
- virtual void MarkOriginatedFromRenderer() override;
- virtual bool DidOriginateFromRenderer() const override;
- virtual void SetString(const base::string16& data) override;
- virtual void SetURL(const GURL& url, const base::string16& title) override;
- virtual void SetFilename(const base::FilePath& path) override;
- virtual void SetFilenames(const std::vector<FileInfo>& filenames) override;
- virtual void SetPickledData(const OSExchangeData::CustomFormat& format,
- const Pickle& pickle) override;
- virtual bool GetString(base::string16* data) const override;
- virtual bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
- GURL* url,
- base::string16* title) const override;
- virtual bool GetFilename(base::FilePath* path) const override;
- virtual bool GetFilenames(std::vector<FileInfo>* filenames) const override;
- virtual bool GetPickledData(const OSExchangeData::CustomFormat& format,
- Pickle* pickle) const override;
- virtual bool HasString() const override;
- virtual bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const
- override;
- virtual bool HasFile() const override;
- virtual bool HasCustomFormat(const OSExchangeData::CustomFormat& format) const
- override;
-
- virtual void SetFileContents(const base::FilePath& filename,
- const std::string& file_contents) override;
-
- virtual void SetHtml(const base::string16& html,
- const GURL& base_url) override;
- virtual bool GetHtml(base::string16* html, GURL* base_url) const override;
- virtual bool HasHtml() const override;
- virtual void SetDragImage(const gfx::ImageSkia& image,
- const gfx::Vector2d& cursor_offset) override;
- virtual const gfx::ImageSkia& GetDragImage() const override;
- virtual const gfx::Vector2d& GetDragImageOffset() const override;
-
- // ui::PlatformEventDispatcher:
- virtual bool CanDispatchEvent(const PlatformEvent& event) override;
- virtual uint32_t DispatchEvent(const PlatformEvent& event) override;
-
- private:
- friend class OSExchangeDataProviderAuraX11Test;
- typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData;
-
- // Returns true if |formats_| contains a string format and the string can be
- // parsed as a URL.
- bool GetPlainTextURL(GURL* url) const;
-
- // Returns the targets in |format_map_|.
- std::vector< ::Atom> GetTargets() const;
-
- // Drag image and offset data.
- gfx::ImageSkia drag_image_;
- gfx::Vector2d drag_image_offset_;
-
- // Our X11 state.
- Display* x_display_;
- ::Window x_root_window_;
-
- // In X11, because the IPC parts of drag operations are implemented by
- // XSelection, we require an x11 window to receive drag messages on. The
- // OSExchangeDataProvider system is modeled on the Windows implementation,
- // which does not require a window. We only sometimes have a valid window
- // available (in the case of drag receiving). Other times, we need to create
- // our own xwindow just to receive events on it.
- const bool own_window_;
-
- ::Window x_window_;
-
- X11AtomCache atom_cache_;
-
- // A representation of data. This is either passed to us from the other
- // process, or built up through a sequence of Set*() calls. It can be passed
- // to |selection_owner_| when we take the selection.
- SelectionFormatMap format_map_;
-
- // Auxilary data for the X Direct Save protocol.
- base::FilePath file_contents_name_;
-
- // Takes a snapshot of |format_map_| and offers it to other windows.
- mutable SelectionOwner selection_owner_;
-
- DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAuraX11);
-};
-
-} // namespace ui
-
-#endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aura.cc ('k') | ui/base/dragdrop/os_exchange_data_provider_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698