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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_provider_aura.h

Issue 8450018: First shot at implementing drag&drop for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed windows build errors Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura_shell/shell.cc ('k') | ui/base/dragdrop/os_exchange_data_provider_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_
6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_
7 #pragma once
8
9 #include <map>
10
11 #include "ui/base/dragdrop/os_exchange_data.h"
12 #include "googleurl/src/gurl.h"
13 #include "base/pickle.h"
14 #include "base/file_path.h"
15 #include "third_party/skia/include/core/SkBitmap.h"
16
17 namespace ui {
18
19 // OSExchangeData::Provider implementation for aura on linux.
20 class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider {
21 public:
22 OSExchangeDataProviderAura();
23
24 virtual ~OSExchangeDataProviderAura() {}
25
26 // Overridden from OSExchangeData::Provider:
27 virtual void SetString(const string16& data) OVERRIDE;
28 virtual void SetURL(const GURL& url, const string16& title) OVERRIDE;
29 virtual void SetFilename(const FilePath& path) OVERRIDE;
30 virtual void SetPickledData(OSExchangeData::CustomFormat format,
31 const Pickle& data) OVERRIDE;
32 virtual bool GetString(string16* data) const OVERRIDE;
33 virtual bool GetURLAndTitle(GURL* url, string16* title) const OVERRIDE;
34 virtual bool GetFilename(FilePath* path) const OVERRIDE;
35 virtual bool GetPickledData(OSExchangeData::CustomFormat format,
36 Pickle* data) const OVERRIDE;
37 virtual bool HasString() const OVERRIDE;
38 virtual bool HasURL() const OVERRIDE;
39 virtual bool HasFile() const OVERRIDE;
40 virtual bool HasCustomFormat(
41 OSExchangeData::CustomFormat format) const OVERRIDE;
42 #if defined(OS_WIN)
43 virtual void SetFileContents(const FilePath& filename,
44 const std::string& file_contents) OVERRIDE;
45 virtual void SetHtml(const string16& html, const GURL& base_url) OVERRIDE;
46 virtual bool GetFileContents(FilePath* filename,
47 std::string* file_contents) const OVERRIDE;
48 virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE;
49 virtual bool HasFileContents() const OVERRIDE;
50 virtual bool HasHtml() const OVERRIDE;
51 virtual void SetDownloadFileInfo(
52 const OSExchangeData::DownloadFileInfo& download) OVERRIDE;
53 #endif
54
55 void set_drag_image(const SkBitmap& drag_image) { drag_image_ = drag_image; }
56 const SkBitmap& drag_image() const { return drag_image_; }
57
58 private:
59 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData;
60
61 // Returns true if |formats_| contains a string format and the string can be
62 // parsed as a URL.
63 bool GetPlainTextURL(GURL* url) const;
64
65 // Actual formats that have been set. See comment above |known_formats_|
66 // for details.
67 int formats_;
68
69 // String contents.
70 string16 string_;
71
72 // URL contents.
73 GURL url_;
74 string16 title_;
75
76 // File name.
77 FilePath filename_;
78
79 // PICKLED_DATA contents.
80 PickleData pickle_data_;
81
82 // Drag image and offset data.
83 SkBitmap drag_image_;
84
85 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAura);
86 };
87
88 } // namespace ui
89
90 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_
OLDNEW
« no previous file with comments | « ui/aura_shell/shell.cc ('k') | ui/base/dragdrop/os_exchange_data_provider_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698