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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1345873003: Expose PageImportanceSignals via WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing null check Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 91713f5523e65f1930bccb4df7a7e0129cad955b..5c2a1871640bb86d3d3fe4adb82ff8fcd7396691 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -57,6 +57,7 @@
#include "content/public/common/favicon_url.h"
#include "content/public/common/file_chooser_file_info.h"
#include "content/public/common/file_chooser_params.h"
+#include "content/public/common/page_importance_signals.h"
#include "content/public/common/page_state.h"
#include "content/public/common/page_zoom.h"
#include "content/public/common/ssl_status.h"
@@ -151,6 +152,7 @@
#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
#include "third_party/WebKit/public/web/WebNetworkStateNotifier.h"
#include "third_party/WebKit/public/web/WebNodeList.h"
+#include "third_party/WebKit/public/web/WebPageImportanceSignals.h"
#include "third_party/WebKit/public/web/WebPageSerializer.h"
#include "third_party/WebKit/public/web/WebPlugin.h"
#include "third_party/WebKit/public/web/WebPluginAction.h"
@@ -3460,6 +3462,19 @@ void RenderViewImpl::draggableRegionsChanged() {
DraggableRegionsChanged(webview()->mainFrame()));
}
+void RenderViewImpl::pageImportanceSignalsChanged() {
+ if (!webview() || !main_render_frame_)
+ return;
+
+ const auto& web_signals = webview()->pageImportanceSignals();
+
+ PageImportanceSignals signals;
+ signals.had_form_interaction = web_signals->hadFormInteraction();
+
+ main_render_frame_->Send(new FrameHostMsg_UpdatePageImportanceSignals(
+ main_render_frame_->GetRoutingID(), signals));
+}
+
#if defined(OS_ANDROID)
WebContentDetectionResult RenderViewImpl::detectContentAround(
const WebHitTestResult& touch_hit) {
« content/public/browser/web_contents.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698