| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/extensions/api/capture_web_contents_function.h" | 5 #include "chrome/browser/extensions/api/capture_web_contents_function.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 10 #include "chrome/common/extensions/extension_constants.h" | 10 #include "chrome/common/extensions/extension_constants.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return; | 144 return; |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::string base64_result; | 147 std::string base64_result; |
| 148 base::StringPiece stream_as_string( | 148 base::StringPiece stream_as_string( |
| 149 reinterpret_cast<const char*>(vector_as_array(&data)), data.size()); | 149 reinterpret_cast<const char*>(vector_as_array(&data)), data.size()); |
| 150 | 150 |
| 151 base::Base64Encode(stream_as_string, &base64_result); | 151 base::Base64Encode(stream_as_string, &base64_result); |
| 152 base64_result.insert(0, base::StringPrintf("data:%s;base64,", | 152 base64_result.insert(0, base::StringPrintf("data:%s;base64,", |
| 153 mime_type.c_str())); | 153 mime_type.c_str())); |
| 154 SetResult(new StringValue(base64_result)); | 154 SetResult(new base::StringValue(base64_result)); |
| 155 SendResponse(true); | 155 SendResponse(true); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace extensions | 158 } // namespace extensions |
| OLD | NEW |