| 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 "extensions/browser/api/web_contents_capture_client.h" | 5 #include "extensions/browser/api/web_contents_capture_client.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 "content/public/browser/render_widget_host.h" | 9 #include "content/public/browser/render_widget_host.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "extensions/browser/extension_function.h" | 12 #include "extensions/browser/extension_function.h" |
| 13 #include "extensions/common/constants.h" | 13 #include "extensions/common/constants.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 14 #include "ui/display/display.h" | 15 #include "ui/display/display.h" |
| 15 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 16 #include "ui/gfx/codec/jpeg_codec.h" | 17 #include "ui/gfx/codec/jpeg_codec.h" |
| 17 #include "ui/gfx/codec/png_codec.h" | 18 #include "ui/gfx/codec/png_codec.h" |
| 18 #include "ui/gfx/geometry/size_conversions.h" | 19 #include "ui/gfx/geometry/size_conversions.h" |
| 19 | 20 |
| 20 using content::RenderWidgetHost; | 21 using content::RenderWidgetHost; |
| 21 using content::RenderWidgetHostView; | 22 using content::RenderWidgetHostView; |
| 22 using content::WebContents; | 23 using content::WebContents; |
| 23 | 24 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 data.size()); | 135 data.size()); |
| 135 | 136 |
| 136 base::Base64Encode(stream_as_string, base64_result); | 137 base::Base64Encode(stream_as_string, base64_result); |
| 137 base64_result->insert( | 138 base64_result->insert( |
| 138 0, base::StringPrintf("data:%s;base64,", mime_type.c_str())); | 139 0, base::StringPrintf("data:%s;base64,", mime_type.c_str())); |
| 139 | 140 |
| 140 return true; | 141 return true; |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace extensions | 144 } // namespace extensions |
| OLD | NEW |