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_aura.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 10 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 OSExchangeDataProviderAura::OSExchangeDataProviderAura() : formats_(0) {} | 14 OSExchangeDataProviderAura::OSExchangeDataProviderAura() : formats_(0) {} |
15 | 15 |
16 OSExchangeDataProviderAura::~OSExchangeDataProviderAura() {} | 16 OSExchangeDataProviderAura::~OSExchangeDataProviderAura() {} |
17 | 17 |
18 void OSExchangeDataProviderAura::WriteDataToClipboard( | 18 void OSExchangeDataProviderAura::WriteDataToClipboard( |
19 Clipboard* clipboard) const { | 19 Clipboard* clipboard) const { |
20 ScopedClipboardWriter scw(clipboard); | 20 ScopedClipboardWriter scw(clipboard, Clipboard::BUFFER_STANDARD); |
21 if (HasString()) | 21 if (HasString()) |
22 scw.WriteText(string_); | 22 scw.WriteText(string_); |
23 if (HasURL()) | 23 if (HasURL()) |
24 scw.WriteHyperlink(title_, url_.spec()); | 24 scw.WriteHyperlink(title_, url_.spec()); |
25 if (HasFile()) { | 25 if (HasFile()) { |
26 Pickle filename_pickle; | 26 Pickle filename_pickle; |
27 filename_pickle.WriteString(net::FilePathToFileURL(filename_).spec()); | 27 filename_pickle.WriteString(net::FilePathToFileURL(filename_).spec()); |
28 scw.WritePickledData(filename_pickle, Clipboard::GetFilenameFormatType()); | 28 scw.WritePickledData(filename_pickle, Clipboard::GetFilenameFormatType()); |
29 } | 29 } |
30 // TODO(varunjain): support pickle format. | 30 // TODO(varunjain): support pickle format. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 | 179 |
180 // static | 180 // static |
181 OSExchangeData::CustomFormat | 181 OSExchangeData::CustomFormat |
182 OSExchangeData::RegisterCustomFormat(const std::string& type) { | 182 OSExchangeData::RegisterCustomFormat(const std::string& type) { |
183 // TODO(davemoore) Implement this for aura. | 183 // TODO(davemoore) Implement this for aura. |
184 return NULL; | 184 return NULL; |
185 } | 185 } |
186 | 186 |
187 } // namespace ui | 187 } // namespace ui |
OLD | NEW |