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

Side by Side Diff: content/browser/renderer_host/render_view_host.cc

Issue 8072011: Only allow to lock the mouse when the tab is in fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes in response to review comments & sync. Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer_host/render_view_host.h" 5 #include "content/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 1124
1125 void RenderViewHost::NotifyRendererUnresponsive() { 1125 void RenderViewHost::NotifyRendererUnresponsive() {
1126 delegate_->RendererUnresponsive( 1126 delegate_->RendererUnresponsive(
1127 this, is_waiting_for_beforeunload_ack_ || is_waiting_for_unload_ack_); 1127 this, is_waiting_for_beforeunload_ack_ || is_waiting_for_unload_ack_);
1128 } 1128 }
1129 1129
1130 void RenderViewHost::NotifyRendererResponsive() { 1130 void RenderViewHost::NotifyRendererResponsive() {
1131 delegate_->RendererResponsive(this); 1131 delegate_->RendererResponsive(this);
1132 } 1132 }
1133 1133
1134 bool RenderViewHost::CanLockMouse() const {
1135 // Only allow to lock the mouse when the current tab is in fullscreen mode.
1136 return delegate_->IsFullscreenForCurrentTab();
1137 }
1138
1134 void RenderViewHost::OnMsgFocus() { 1139 void RenderViewHost::OnMsgFocus() {
1135 delegate_->Activate(); 1140 delegate_->Activate();
1136 } 1141 }
1137 1142
1138 void RenderViewHost::OnMsgBlur() { 1143 void RenderViewHost::OnMsgBlur() {
1139 delegate_->Deactivate(); 1144 delegate_->Deactivate();
1140 } 1145 }
1141 1146
1142 void RenderViewHost::ForwardMouseEvent( 1147 void RenderViewHost::ForwardMouseEvent(
1143 const WebKit::WebMouseEvent& mouse_event) { 1148 const WebKit::WebMouseEvent& mouse_event) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 VLOG(1) << "Blocked URL " << url->spec(); 1221 VLOG(1) << "Blocked URL " << url->spec();
1217 *url = GURL(); 1222 *url = GURL();
1218 } 1223 }
1219 } 1224 }
1220 1225
1221 void RenderViewHost::SetAltErrorPageURL(const GURL& url) { 1226 void RenderViewHost::SetAltErrorPageURL(const GURL& url) {
1222 Send(new ViewMsg_SetAltErrorPageURL(routing_id(), url)); 1227 Send(new ViewMsg_SetAltErrorPageURL(routing_id(), url));
1223 } 1228 }
1224 1229
1225 void RenderViewHost::ExitFullscreen() { 1230 void RenderViewHost::ExitFullscreen() {
1231 UnlockMouseIfNecessary();
1232
1226 Send(new ViewMsg_ExitFullscreen(routing_id())); 1233 Send(new ViewMsg_ExitFullscreen(routing_id()));
1227 } 1234 }
1228 1235
1229 void RenderViewHost::UpdateWebkitPreferences(const WebPreferences& prefs) { 1236 void RenderViewHost::UpdateWebkitPreferences(const WebPreferences& prefs) {
1230 Send(new ViewMsg_UpdateWebPreferences(routing_id(), prefs)); 1237 Send(new ViewMsg_UpdateWebPreferences(routing_id(), prefs));
1231 } 1238 }
1232 1239
1233 void RenderViewHost::ClearFocusedNode() { 1240 void RenderViewHost::ClearFocusedNode() {
1234 Send(new ViewMsg_ClearFocusedNode(routing_id())); 1241 Send(new ViewMsg_ClearFocusedNode(routing_id()));
1235 } 1242 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 void RenderViewHost::OnRunFileChooser( 1409 void RenderViewHost::OnRunFileChooser(
1403 const ViewHostMsg_RunFileChooser_Params& params) { 1410 const ViewHostMsg_RunFileChooser_Params& params) {
1404 delegate_->RunFileChooser(this, params); 1411 delegate_->RunFileChooser(this, params);
1405 } 1412 }
1406 1413
1407 void RenderViewHost::OnWebUISend(const GURL& source_url, 1414 void RenderViewHost::OnWebUISend(const GURL& source_url,
1408 const std::string& name, 1415 const std::string& name,
1409 const base::ListValue& args) { 1416 const base::ListValue& args) {
1410 delegate_->WebUISend(this, source_url, name, args); 1417 delegate_->WebUISend(this, source_url, name, args);
1411 } 1418 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host.h ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698