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

Side by Side Diff: chrome/browser/ui/fullscreen_controller.cc

Issue 8598027: Handle mouselock allowed in content settings while fullscreen is not. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to tip of tree; code moved from browser.cc to fullscreen_controller.cc Created 9 years 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
« no previous file with comments | « no previous file | no next file » | 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) 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 "chrome/browser/ui/fullscreen_controller.h" 5 #include "chrome/browser/ui/fullscreen_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return; 51 return;
52 } 52 }
53 53
54 if (mouse_lock_state_ == MOUSELOCK_ACCEPTED) { 54 if (mouse_lock_state_ == MOUSELOCK_ACCEPTED) {
55 tab->GotResponseToLockMouseRequest(true); 55 tab->GotResponseToLockMouseRequest(true);
56 return; 56 return;
57 } 57 }
58 58
59 switch (GetMouseLockSetting(tab->GetURL())) { 59 switch (GetMouseLockSetting(tab->GetURL())) {
60 case CONTENT_SETTING_ALLOW: 60 case CONTENT_SETTING_ALLOW:
61 mouse_lock_state_ = MOUSELOCK_ACCEPTED; 61 if (tab_fullscreen_accepted_) {
62 tab->GotResponseToLockMouseRequest(true); 62 mouse_lock_state_ = MOUSELOCK_ACCEPTED;
63 tab->GotResponseToLockMouseRequest(true);
64 } else {
65 mouse_lock_state_ = MOUSELOCK_REQUESTED;
66 }
63 break; 67 break;
64 case CONTENT_SETTING_BLOCK: 68 case CONTENT_SETTING_BLOCK:
65 mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED; 69 mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
66 tab->GotResponseToLockMouseRequest(false); 70 tab->GotResponseToLockMouseRequest(false);
67 break; 71 break;
68 case CONTENT_SETTING_ASK: 72 case CONTENT_SETTING_ASK:
69 mouse_lock_state_ = MOUSELOCK_REQUESTED; 73 mouse_lock_state_ = MOUSELOCK_REQUESTED;
70 break; 74 break;
71 default: 75 default:
72 NOTREACHED(); 76 NOTREACHED();
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 342
339 ContentSetting 343 ContentSetting
340 FullscreenController::GetMouseLockSetting(const GURL& url) const { 344 FullscreenController::GetMouseLockSetting(const GURL& url) const {
341 if (url.SchemeIsFile()) 345 if (url.SchemeIsFile())
342 return CONTENT_SETTING_ALLOW; 346 return CONTENT_SETTING_ALLOW;
343 347
344 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); 348 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap();
345 return settings_map->GetContentSetting(url, url, 349 return settings_map->GetContentSetting(url, url,
346 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); 350 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string());
347 } 351 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698