| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/webclipboard_impl.h" | 5 #include "content/renderer/webclipboard_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 ui::ClipboardType clipboard_type; | 123 ui::ClipboardType clipboard_type; |
| 124 if (!ConvertBufferType(buffer, &clipboard_type)) | 124 if (!ConvertBufferType(buffer, &clipboard_type)) |
| 125 return WebBlobInfo(); | 125 return WebBlobInfo(); |
| 126 | 126 |
| 127 std::string blob_uuid; | 127 std::string blob_uuid; |
| 128 std::string type; | 128 std::string type; |
| 129 int64_t size; | 129 int64_t size; |
| 130 delegate_->ReadImage(clipboard_type, &blob_uuid, &type, &size); | 130 delegate_->ReadImage(clipboard_type, &blob_uuid, &type, &size); |
| 131 if (size < 0) | 131 if (size < 0) |
| 132 return WebBlobInfo(); | 132 return WebBlobInfo(); |
| 133 return WebBlobInfo(base::ASCIIToUTF16(blob_uuid), base::UTF8ToUTF16(type), | 133 return WebBlobInfo(WebString::fromASCII(blob_uuid), WebString::fromUTF8(type), |
| 134 size); | 134 size); |
| 135 } | 135 } |
| 136 | 136 |
| 137 WebString WebClipboardImpl::readCustomData(Buffer buffer, | 137 WebString WebClipboardImpl::readCustomData(Buffer buffer, |
| 138 const WebString& type) { | 138 const WebString& type) { |
| 139 ui::ClipboardType clipboard_type; | 139 ui::ClipboardType clipboard_type; |
| 140 if (!ConvertBufferType(buffer, &clipboard_type)) | 140 if (!ConvertBufferType(buffer, &clipboard_type)) |
| 141 return WebString(); | 141 return WebString(); |
| 142 | 142 |
| 143 base::string16 data; | 143 base::string16 data; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 return false; | 222 return false; |
| 223 #endif | 223 #endif |
| 224 default: | 224 default: |
| 225 NOTREACHED(); | 225 NOTREACHED(); |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 return true; | 228 return true; |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace content | 231 } // namespace content |
| OLD | NEW |