| 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/ui/android/context_menu_helper.h" | 5 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 231 content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
| 232 if (!render_frame_host) | 232 if (!render_frame_host) |
| 233 return; | 233 return; |
| 234 | 234 |
| 235 chrome::mojom::ThumbnailCapturerPtr thumbnail_capturer; | 235 chrome::mojom::ThumbnailCapturerPtr thumbnail_capturer; |
| 236 render_frame_host->GetRemoteInterfaces()->GetInterface(&thumbnail_capturer); | 236 render_frame_host->GetRemoteInterfaces()->GetInterface(&thumbnail_capturer); |
| 237 // Bind the InterfacePtr into the callback so that it's kept alive | 237 // Bind the InterfacePtr into the callback so that it's kept alive |
| 238 // until there's either a connection error or a response. | 238 // until there's either a connection error or a response. |
| 239 auto* thumbnail_capturer_proxy = thumbnail_capturer.get(); | 239 auto* thumbnail_capturer_proxy = thumbnail_capturer.get(); |
| 240 thumbnail_capturer_proxy->RequestThumbnailForContextNode( | 240 thumbnail_capturer_proxy->RequestThumbnailForContextNode( |
| 241 0, gfx::Size(max_dimen_px, max_dimen_px), | 241 0, gfx::Size(max_dimen_px, max_dimen_px), chrome::mojom::ImageFormat::PNG, |
| 242 base::Bind(retrieve_callback, base::Passed(&thumbnail_capturer), | 242 base::Bind(retrieve_callback, base::Passed(&thumbnail_capturer), |
| 243 base::android::ScopedJavaGlobalRef<jobject>(env, jcallback))); | 243 base::android::ScopedJavaGlobalRef<jobject>(env, jcallback))); |
| 244 } | 244 } |
| 245 | 245 |
| 246 bool RegisterContextMenuHelper(JNIEnv* env) { | 246 bool RegisterContextMenuHelper(JNIEnv* env) { |
| 247 return RegisterNativesImpl(env); | 247 return RegisterNativesImpl(env); |
| 248 } | 248 } |
| OLD | NEW |