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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after
2041 2041
2042 void WebContentsImpl::Cut() { 2042 void WebContentsImpl::Cut() {
2043 RenderFrameHost* focused_frame = GetFocusedFrame(); 2043 RenderFrameHost* focused_frame = GetFocusedFrame();
2044 if (!focused_frame) 2044 if (!focused_frame)
2045 return; 2045 return;
2046 2046
2047 focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID())); 2047 focused_frame->Send(new InputMsg_Cut(focused_frame->GetRoutingID()));
2048 RecordAction(base::UserMetricsAction("Cut")); 2048 RecordAction(base::UserMetricsAction("Cut"));
2049 } 2049 }
2050 2050
2051 void WebContentsImpl::Print() {
2052 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2053 SetHistoryContext(controller_.GetLastCommittedEntry(), 3));
2054 printf("\nPrint\n");
2055 }
2056
2057 void WebContentsImpl::SaveImage() {
2058 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2059 SetHistoryContext(controller_.GetLastCommittedEntry(), 2));
2060 printf("\nSave Image\n");
2061 }
2062
2051 void WebContentsImpl::Copy() { 2063 void WebContentsImpl::Copy() {
2052 RenderFrameHost* focused_frame = GetFocusedFrame(); 2064 RenderFrameHost* focused_frame = GetFocusedFrame();
2053 if (!focused_frame) 2065 if (!focused_frame)
2054 return; 2066 return;
2055 2067
2056 focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID())); 2068 focused_frame->Send(new InputMsg_Copy(focused_frame->GetRoutingID()));
2057 RecordAction(base::UserMetricsAction("Copy")); 2069 RecordAction(base::UserMetricsAction("Copy"));
2070 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2071 SetHistoryContext(controller_.GetLastCommittedEntry(), 1));
2072 printf("\nCopy\n");
2058 } 2073 }
2059 2074
2060 void WebContentsImpl::CopyToFindPboard() { 2075 void WebContentsImpl::CopyToFindPboard() {
2061 #if defined(OS_MACOSX) 2076 #if defined(OS_MACOSX)
2062 RenderFrameHost* focused_frame = GetFocusedFrame(); 2077 RenderFrameHost* focused_frame = GetFocusedFrame();
2063 if (!focused_frame) 2078 if (!focused_frame)
2064 return; 2079 return;
2065 2080
2066 // Windows/Linux don't have the concept of a find pasteboard. 2081 // Windows/Linux don't have the concept of a find pasteboard.
2067 focused_frame->Send( 2082 focused_frame->Send(
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
3140 3155
3141 if (has_video) { 3156 if (has_video) {
3142 AddMediaPlayerEntry(player_cookie, &active_video_players_); 3157 AddMediaPlayerEntry(player_cookie, &active_video_players_);
3143 3158
3144 // If we're not hidden and have just created a player, create a blocker. 3159 // If we're not hidden and have just created a player, create a blocker.
3145 if (!video_power_save_blocker_ && !IsHidden()) 3160 if (!video_power_save_blocker_ && !IsHidden())
3146 CreateVideoPowerSaveBlocker(); 3161 CreateVideoPowerSaveBlocker();
3147 } 3162 }
3148 3163
3149 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying()); 3164 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying());
3165 printf("\nPlaying media\n");
3166 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3167 SetHistoryContext(controller_.GetLastCommittedEntry(), 4));
3150 } 3168 }
3151 3169
3152 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { 3170 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) {
3153 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_); 3171 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_);
3154 RemoveMediaPlayerEntry(player_cookie, &active_video_players_); 3172 RemoveMediaPlayerEntry(player_cookie, &active_video_players_);
3155 MaybeReleasePowerSaveBlockers(); 3173 MaybeReleasePowerSaveBlockers();
3156 3174
3157 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused()); 3175 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused());
3158 } 3176 }
3159 3177
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4422 node->render_manager()->ResumeResponseDeferredAtStart(); 4440 node->render_manager()->ResumeResponseDeferredAtStart();
4423 } 4441 }
4424 4442
4425 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4443 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4426 force_disable_overscroll_content_ = force_disable; 4444 force_disable_overscroll_content_ = force_disable;
4427 if (view_) 4445 if (view_)
4428 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4446 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4429 } 4447 }
4430 4448
4431 } // namespace content 4449 } // namespace content
OLDNEW
« 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