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

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

Issue 28119: Chromium changes to use new WebKit, WebKitClient, and WebClipboard interfaces... (Closed) Base URL: svn://svn.chromium.org/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 | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webclipboard_impl.h » ('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 "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 #include "webkit/glue/scoped_clipboard_writer_glue.h" 12 #include "webkit/glue/scoped_clipboard_writer_glue.h"
13 13
14 #include "SkBitmap.h" 14 #include "SkBitmap.h"
15 15
16 // Clipboard glue 16 // Clipboard glue
17 17
18 #if defined(OS_WIN) 18 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(
19 // The call is being made within the current process. 19 const void* pixels, const gfx::Size& size) {
20 void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) { 20 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
21 SkAutoLockPixels bitmap_lock(bitmap);
22 WriteBitmapFromPixels(bitmap.getPixels(), gfx::Size(bitmap.width(),
23 bitmap.height()));
24 } 21 }
25 #endif // defined(OS_WIN)
26 22
27 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { 23 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
28 } 24 }
29 25
30 namespace webkit_glue { 26 namespace webkit_glue {
31 27
32 base::LazyInstance<Clipboard> clipboard(base::LINKER_INITIALIZED); 28 base::LazyInstance<Clipboard> clipboard(base::LINKER_INITIALIZED);
33 29
34 Clipboard* ClipboardGetClipboard() { 30 Clipboard* ClipboardGetClipboard() {
35 return clipboard.Pointer(); 31 return clipboard.Pointer();
(...skipping 12 matching lines...) Expand all
48 } 44 }
49 45
50 void ClipboardReadHTML(std::wstring* markup, GURL* url) { 46 void ClipboardReadHTML(std::wstring* markup, GURL* url) {
51 std::string url_str; 47 std::string url_str;
52 ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL); 48 ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL);
53 if (url) 49 if (url)
54 *url = GURL(url_str); 50 *url = GURL(url_str);
55 } 51 }
56 52
57 } // namespace webkit_glue 53 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webclipboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698