OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webclipboard_impl.h" | 5 #include "webkit/glue/webclipboard_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void WebClipboardImpl::writePlainText(const WebString& plain_text) { | 138 void WebClipboardImpl::writePlainText(const WebString& plain_text) { |
139 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); | 139 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); |
140 scw.WriteText(plain_text); | 140 scw.WriteText(plain_text); |
141 } | 141 } |
142 | 142 |
143 void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) { | 143 void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) { |
144 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); | 144 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); |
145 | 145 |
146 scw.WriteBookmark(title, url.spec()); | 146 scw.WriteBookmark(title, url.spec()); |
147 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); | 147 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); |
148 scw.WriteText(UTF8ToUTF16(url.spec())); | 148 scw.WriteText(UTF8ToUTF16(std::string(url.spec()))); |
149 } | 149 } |
150 | 150 |
151 void WebClipboardImpl::writeImage( | 151 void WebClipboardImpl::writeImage( |
152 const WebImage& image, const WebURL& url, const WebString& title) { | 152 const WebImage& image, const WebURL& url, const WebString& title) { |
153 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); | 153 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); |
154 | 154 |
155 if (!image.isNull()) { | 155 if (!image.isNull()) { |
156 #if WEBKIT_USING_SKIA | 156 #if WEBKIT_USING_SKIA |
157 const SkBitmap& bitmap = image.getSkBitmap(); | 157 const SkBitmap& bitmap = image.getSkBitmap(); |
158 #elif WEBKIT_USING_CG | 158 #elif WEBKIT_USING_CG |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 break; | 225 break; |
226 #endif | 226 #endif |
227 default: | 227 default: |
228 NOTREACHED(); | 228 NOTREACHED(); |
229 return false; | 229 return false; |
230 } | 230 } |
231 return true; | 231 return true; |
232 } | 232 } |
233 | 233 |
234 } // namespace webkit_glue | 234 } // namespace webkit_glue |
OLD | NEW |