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

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: added missing test file 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
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
43 void set_drag_image(const SkBitmap& drag_image) { drag_image_ = drag_image; }
44 const SkBitmap& drag_image() const { return drag_image_; }
45
46 private:
47 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData;
48
49 // Returns true if |formats_| contains a string format and the string can be
50 // parsed as a URL.
51 bool GetPlainTextURL(GURL* url) const;
52
53 // Actual formats that have been set. See comment above |known_formats_|
54 // for details.
55 int formats_;
56
57 // String contents.
58 string16 string_;
59
60 // URL contents.
61 GURL url_;
62 string16 title_;
63
64 // File name.
65 FilePath filename_;
66
67 // PICKLED_DATA contents.
68 PickleData pickle_data_;
69
70 // Drag image and offset data.
71 SkBitmap drag_image_;
72
73 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAura);
74 };
75
76 } // namespace ui
77
78 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698