Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Side by Side Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: REBASE Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/guest_view/web_view/web_view_internal_api.h" 5 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 EXTENSION_FUNCTION_VALIDATE(params.get()); 304 EXTENSION_FUNCTION_VALIDATE(params.get());
305 305
306 std::unique_ptr<ImageDetails> image_details; 306 std::unique_ptr<ImageDetails> image_details;
307 if (args_->GetSize() > 1) { 307 if (args_->GetSize() > 1) {
308 base::Value* spec = NULL; 308 base::Value* spec = NULL;
309 EXTENSION_FUNCTION_VALIDATE(args_->Get(1, &spec) && spec); 309 EXTENSION_FUNCTION_VALIDATE(args_->Get(1, &spec) && spec);
310 image_details = ImageDetails::FromValue(*spec); 310 image_details = ImageDetails::FromValue(*spec);
311 } 311 }
312 312
313 is_guest_transparent_ = guest->allow_transparency(); 313 is_guest_transparent_ = guest->allow_transparency();
314 return CaptureAsync(guest->web_contents(), image_details.get(), 314 return CaptureAsync(
315 base::Bind(&WebViewInternalCaptureVisibleRegionFunction:: 315 guest->web_contents(), image_details.get(),
316 CopyFromBackingStoreComplete, 316 base::Bind(
317 this)); 317 &WebViewInternalCaptureVisibleRegionFunction::CopyFromSurfaceComplete,
318 this));
318 } 319 }
319 bool WebViewInternalCaptureVisibleRegionFunction::IsScreenshotEnabled() { 320 bool WebViewInternalCaptureVisibleRegionFunction::IsScreenshotEnabled() {
320 // TODO(wjmaclean): Is it ok to always return true here? 321 // TODO(wjmaclean): Is it ok to always return true here?
321 return true; 322 return true;
322 } 323 }
323 324
324 bool WebViewInternalCaptureVisibleRegionFunction::ClientAllowsTransparency() { 325 bool WebViewInternalCaptureVisibleRegionFunction::ClientAllowsTransparency() {
325 return is_guest_transparent_; 326 return is_guest_transparent_;
326 } 327 }
327 328
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 // Will finish asynchronously. 982 // Will finish asynchronously.
982 return true; 983 return true;
983 } 984 }
984 985
985 void WebViewInternalClearDataFunction::ClearDataDone() { 986 void WebViewInternalClearDataFunction::ClearDataDone() {
986 Release(); // Balanced in RunAsync(). 987 Release(); // Balanced in RunAsync().
987 SendResponse(true); 988 SendResponse(true);
988 } 989 }
989 990
990 } // namespace extensions 991 } // namespace extensions
OLDNEW
« no previous file with comments | « content/test/test_render_view_host.cc ('k') | extensions/browser/api/web_contents_capture_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698