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 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ | 5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ |
6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ | 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/pickle.h" | 11 #include "base/pickle.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 #include "ui/base/dragdrop/os_exchange_data.h" | 13 #include "ui/base/dragdrop/os_exchange_data.h" |
14 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
15 #include "ui/gfx/point.h" | 15 #include "ui/gfx/vector2d.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 class Clipboard; | 19 class Clipboard; |
20 | 20 |
21 // OSExchangeData::Provider implementation for aura on linux. | 21 // OSExchangeData::Provider implementation for aura on linux. |
22 class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider { | 22 class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider { |
23 public: | 23 public: |
24 OSExchangeDataProviderAura(); | 24 OSExchangeDataProviderAura(); |
25 virtual ~OSExchangeDataProviderAura(); | 25 virtual ~OSExchangeDataProviderAura(); |
(...skipping 30 matching lines...) Expand all Loading... |
56 | 56 |
57 virtual void SetHtml(const string16& html, const GURL& base_url) OVERRIDE; | 57 virtual void SetHtml(const string16& html, const GURL& base_url) OVERRIDE; |
58 virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE; | 58 virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE; |
59 virtual bool HasHtml() const OVERRIDE; | 59 virtual bool HasHtml() const OVERRIDE; |
60 | 60 |
61 void set_drag_image(const gfx::ImageSkia& drag_image) { | 61 void set_drag_image(const gfx::ImageSkia& drag_image) { |
62 drag_image_ = drag_image; | 62 drag_image_ = drag_image; |
63 } | 63 } |
64 | 64 |
65 const gfx::ImageSkia& drag_image() const { return drag_image_; } | 65 const gfx::ImageSkia& drag_image() const { return drag_image_; } |
66 void set_drag_image_offset(const gfx::Point& drag_image_offset) { | 66 void set_drag_image_offset(const gfx::Vector2d& drag_image_offset) { |
67 drag_image_offset_ = drag_image_offset; | 67 drag_image_offset_ = drag_image_offset; |
68 } | 68 } |
69 const gfx::Point& drag_image_offset() const { return drag_image_offset_; } | 69 const gfx::Vector2d& drag_image_offset() const { return drag_image_offset_; } |
70 | 70 |
71 private: | 71 private: |
72 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData; | 72 typedef std::map<OSExchangeData::CustomFormat, Pickle> PickleData; |
73 | 73 |
74 // Returns true if |formats_| contains a string format and the string can be | 74 // Returns true if |formats_| contains a string format and the string can be |
75 // parsed as a URL. | 75 // parsed as a URL. |
76 bool GetPlainTextURL(GURL* url) const; | 76 bool GetPlainTextURL(GURL* url) const; |
77 | 77 |
78 // Actual formats that have been set. See comment above |known_formats_| | 78 // Actual formats that have been set. See comment above |known_formats_| |
79 // for details. | 79 // for details. |
80 int formats_; | 80 int formats_; |
81 | 81 |
82 // String contents. | 82 // String contents. |
83 string16 string_; | 83 string16 string_; |
84 | 84 |
85 // URL contents. | 85 // URL contents. |
86 GURL url_; | 86 GURL url_; |
87 string16 title_; | 87 string16 title_; |
88 | 88 |
89 // File name. | 89 // File name. |
90 std::vector<OSExchangeData::FileInfo> filenames_; | 90 std::vector<OSExchangeData::FileInfo> filenames_; |
91 | 91 |
92 // PICKLED_DATA contents. | 92 // PICKLED_DATA contents. |
93 PickleData pickle_data_; | 93 PickleData pickle_data_; |
94 | 94 |
95 // Drag image and offset data. | 95 // Drag image and offset data. |
96 gfx::ImageSkia drag_image_; | 96 gfx::ImageSkia drag_image_; |
97 gfx::Point drag_image_offset_; | 97 gfx::Vector2d drag_image_offset_; |
98 | 98 |
99 // For HTML format | 99 // For HTML format |
100 string16 html_; | 100 string16 html_; |
101 GURL base_url_; | 101 GURL base_url_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAura); | 103 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAura); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace ui | 106 } // namespace ui |
107 | 107 |
108 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ | 108 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURA_H_ |
OLD | NEW |