OLD | NEW |
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" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
14 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
16 #include "content/browser/user_metrics.h" | 17 #include "content/browser/user_metrics.h" |
17 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
18 | 19 |
19 FullscreenController::FullscreenController(BrowserWindow* window, | 20 FullscreenController::FullscreenController(BrowserWindow* window, |
20 Profile* profile, | 21 Profile* profile, |
21 Browser* browser) | 22 Browser* browser) |
22 : window_(window), | 23 : window_(window), |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 271 |
271 bool FullscreenController::HandleUserPressedEscape() { | 272 bool FullscreenController::HandleUserPressedEscape() { |
272 if (!IsFullscreenForTab()) | 273 if (!IsFullscreenForTab()) |
273 return false; | 274 return false; |
274 ExitTabbedFullscreenModeIfNecessary(); | 275 ExitTabbedFullscreenModeIfNecessary(); |
275 return true; | 276 return true; |
276 } | 277 } |
277 | 278 |
278 void FullscreenController::NotifyTabOfFullscreenExitIfNecessary() { | 279 void FullscreenController::NotifyTabOfFullscreenExitIfNecessary() { |
279 if (fullscreened_tab_) | 280 if (fullscreened_tab_) |
280 fullscreened_tab_->ExitFullscreenMode(); | 281 fullscreened_tab_->core_tab_helper()->ExitFullscreenMode(); |
281 else | 282 else |
282 DCHECK_EQ(mouse_lock_state_, MOUSELOCK_NOT_REQUESTED); | 283 DCHECK_EQ(mouse_lock_state_, MOUSELOCK_NOT_REQUESTED); |
283 | 284 |
284 fullscreened_tab_ = NULL; | 285 fullscreened_tab_ = NULL; |
285 tab_caused_fullscreen_ = false; | 286 tab_caused_fullscreen_ = false; |
286 tab_fullscreen_accepted_ = false; | 287 tab_fullscreen_accepted_ = false; |
287 mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED; | 288 mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED; |
288 | 289 |
289 UpdateFullscreenExitBubbleContent(); | 290 UpdateFullscreenExitBubbleContent(); |
290 } | 291 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 343 |
343 ContentSetting | 344 ContentSetting |
344 FullscreenController::GetMouseLockSetting(const GURL& url) const { | 345 FullscreenController::GetMouseLockSetting(const GURL& url) const { |
345 if (url.SchemeIsFile()) | 346 if (url.SchemeIsFile()) |
346 return CONTENT_SETTING_ALLOW; | 347 return CONTENT_SETTING_ALLOW; |
347 | 348 |
348 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); | 349 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); |
349 return settings_map->GetContentSetting(url, url, | 350 return settings_map->GetContentSetting(url, url, |
350 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); | 351 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); |
351 } | 352 } |
OLD | NEW |