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

Side by Side Diff: android_webview/browser/renderer_host/aw_render_view_host_ext.cc

Issue 11823027: [Android WebView] Implement the capture picture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes in native/Java AwContents to support SW rendering without platform functions (tests). Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 5 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
6 6
7 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
7 #include "android_webview/common/render_view_messages.h" 8 #include "android_webview/common/render_view_messages.h"
8 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
9 #include "base/callback.h" 10 #include "base/callback.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "content/public/browser/render_process_host.h" 12 #include "content/public/browser/render_process_host.h"
12 #include "content/public/browser/user_metrics.h" 13 #include "content/public/browser/user_metrics.h"
13 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
14 15
15 namespace android_webview { 16 namespace android_webview {
16 17
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 Send(new AwViewMsg_DoHitTest(web_contents()->GetRoutingID(), 55 Send(new AwViewMsg_DoHitTest(web_contents()->GetRoutingID(),
55 view_x, 56 view_x,
56 view_y)); 57 view_y));
57 } 58 }
58 59
59 const AwHitTestData& AwRenderViewHostExt::GetLastHitTestData() const { 60 const AwHitTestData& AwRenderViewHostExt::GetLastHitTestData() const {
60 DCHECK(CalledOnValidThread()); 61 DCHECK(CalledOnValidThread());
61 return last_hit_test_data_; 62 return last_hit_test_data_;
62 } 63 }
63 64
65 void AwRenderViewHostExt::EnableCapturePictureCallback(bool enabled) {
66 Send(new AwViewMsg_EnableCapturePictureCallback(
67 web_contents()->GetRoutingID(), enabled));
68 }
69
64 void AwRenderViewHostExt::RenderViewGone(base::TerminationStatus status) { 70 void AwRenderViewHostExt::RenderViewGone(base::TerminationStatus status) {
65 DCHECK(CalledOnValidThread()); 71 DCHECK(CalledOnValidThread());
66 for (std::map<int, DocumentHasImagesResult>::iterator pending_req = 72 for (std::map<int, DocumentHasImagesResult>::iterator pending_req =
67 pending_document_has_images_requests_.begin(); 73 pending_document_has_images_requests_.begin();
68 pending_req != pending_document_has_images_requests_.end(); 74 pending_req != pending_document_has_images_requests_.end();
69 ++pending_req) { 75 ++pending_req) {
70 pending_req->second.Run(false); 76 pending_req->second.Run(false);
71 } 77 }
72 } 78 }
73 79
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 last_hit_test_data_ = hit_test_data; 111 last_hit_test_data_ = hit_test_data;
106 has_new_hit_test_data_ = true; 112 has_new_hit_test_data_ = true;
107 } 113 }
108 114
109 void AwRenderViewHostExt::OnPictureUpdated() { 115 void AwRenderViewHostExt::OnPictureUpdated() {
110 if (client_) 116 if (client_)
111 client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(), 117 client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(),
112 routing_id()); 118 routing_id());
113 } 119 }
114 120
121 void AwRenderViewHostExt::CapturePictureSync() {
122 ScopedAllowWaitForLegacyWebViewApi wait;
123 Send(new AwViewMsg_CapturePictureSync(web_contents()->GetRoutingID()));
124 }
125
115 } // namespace android_webview 126 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698