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

Side by Side Diff: webkit/glue/simple_clipboard_impl.cc

Issue 27370: Update clipboard classes to use string16 and FilePath instead of wstring.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « chrome/renderer/renderer_glue.cc ('k') | webkit/glue/webclipboard_impl.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/glue/webkit_glue.h" 5 #include "webkit/glue/webkit_glue.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/clipboard.h" 9 #include "base/clipboard.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/string16.h"
11 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
12 #include "webkit/glue/scoped_clipboard_writer_glue.h" 13 #include "webkit/glue/scoped_clipboard_writer_glue.h"
13 14
14 #include "SkBitmap.h" 15 #include "SkBitmap.h"
15 16
16 // Clipboard glue 17 // Clipboard glue
17 18
18 #if defined(OS_WIN) 19 #if defined(OS_WIN)
19 void ScopedClipboardWriterGlue::WriteBitmapFromPixels( 20 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(
20 const void* pixels, const gfx::Size& size) { 21 const void* pixels, const gfx::Size& size) {
21 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size); 22 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
22 } 23 }
23 #endif 24 #endif
24 25
25 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { 26 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
26 } 27 }
27 28
28 namespace webkit_glue { 29 namespace webkit_glue {
29 30
30 base::LazyInstance<Clipboard> clipboard(base::LINKER_INITIALIZED); 31 base::LazyInstance<Clipboard> clipboard(base::LINKER_INITIALIZED);
31 32
32 Clipboard* ClipboardGetClipboard() { 33 Clipboard* ClipboardGetClipboard() {
33 return clipboard.Pointer(); 34 return clipboard.Pointer();
34 } 35 }
35 36
36 bool ClipboardIsFormatAvailable(Clipboard::FormatType format) { 37 bool ClipboardIsFormatAvailable(Clipboard::FormatType format) {
37 return ClipboardGetClipboard()->IsFormatAvailable(format); 38 return ClipboardGetClipboard()->IsFormatAvailable(format);
38 } 39 }
39 40
40 void ClipboardReadText(std::wstring* result) { 41 void ClipboardReadText(string16* result) {
41 ClipboardGetClipboard()->ReadText(result); 42 ClipboardGetClipboard()->ReadText(result);
42 } 43 }
43 44
44 void ClipboardReadAsciiText(std::string* result) { 45 void ClipboardReadAsciiText(std::string* result) {
45 ClipboardGetClipboard()->ReadAsciiText(result); 46 ClipboardGetClipboard()->ReadAsciiText(result);
46 } 47 }
47 48
48 void ClipboardReadHTML(std::wstring* markup, GURL* url) { 49 void ClipboardReadHTML(string16* markup, GURL* url) {
49 std::string url_str; 50 std::string url_str;
50 ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL); 51 ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL);
51 if (url) 52 if (url)
52 *url = GURL(url_str); 53 *url = GURL(url_str);
53 } 54 }
54 55
55 } // namespace webkit_glue 56 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_glue.cc ('k') | webkit/glue/webclipboard_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698