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

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

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix build error. Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/scoped_clipboard_writer.cc ('k') | ui/views/controls/message_box_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/base/clipboard/scoped_clipboard_writer.cc ('k') | ui/views/controls/message_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698