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

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

Issue 1143183002: Proof of concept implementation of context based history filtering. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 59791b51e94f69bfbe162b375242ea576cb65ebc..f792db7257ddde432652b9c32b7174781ecb4d69 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2048,6 +2048,18 @@ void WebContentsImpl::Cut() {
RecordAction(base::UserMetricsAction("Cut"));
}
+void WebContentsImpl::Print() {
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ SetHistoryContext(controller_.GetLastCommittedEntry(), 3));
+ printf("\nPrint\n");
+}
+
+void WebContentsImpl::SaveImage() {
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ SetHistoryContext(controller_.GetLastCommittedEntry(), 2));
+ printf("\nSave Image\n");
+}
+
void WebContentsImpl::Copy() {
RenderFrameHost* focused_frame = GetFocusedFrame();
if (!focused_frame)
@@ -2055,6 +2067,9 @@ void WebContentsImpl::Copy() {
focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID()));
RecordAction(base::UserMetricsAction("Copy"));
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ SetHistoryContext(controller_.GetLastCommittedEntry(), 1));
+ printf("\nCopy\n");
}
void WebContentsImpl::CopyToFindPboard() {
@@ -3147,6 +3162,9 @@ void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie,
}
FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying());
+ printf("\nPlaying media\n");
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ SetHistoryContext(controller_.GetLastCommittedEntry(), 4));
}
void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698