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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1345873003: Expose PageImportanceSignals via WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7d03dc1e3299e3e67fcd20ccdb651621e6f66d2f..51087b6b377c8a7f970ee607e91b1fe51bff1188 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -642,6 +642,8 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
OnRegisterProtocolHandler)
IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler,
OnUnregisterProtocolHandler)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals,
+ OnUpdatePageImportanceSignals)
IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)
IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
@@ -911,6 +913,10 @@ gfx::NativeViewAccessible accessible_parent) {
}
#endif
+const PageImportanceSignals* WebContentsImpl::GetPageImportanceSignals() const {
kinuko 2015/09/24 00:26:22 nit: maybe could be a const ref if this can't be n
kouhei (in TOK) 2015/09/24 01:13:46 Done.
+ return &page_importance_signals_;
+}
+
const base::string16& WebContentsImpl::GetTitle() const {
// Transient entries take precedence. They are used for interstitial pages
// that are shown on top of existing pages.
@@ -3166,6 +3172,11 @@ void WebContentsImpl::OnUnregisterProtocolHandler(const std::string& protocol,
delegate_->UnregisterProtocolHandler(this, protocol, url, user_gesture);
}
+void WebContentsImpl::OnUpdatePageImportanceSignals(
+ const PageImportanceSignals& signals) {
+ page_importance_signals_ = signals;
+}
+
void WebContentsImpl::OnFindReply(int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,

Powered by Google App Engine
This is Rietveld 408576698