OLD | NEW |
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 "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
6 | 6 |
| 7 #include "apps/ui/web_contents_sizer.h" |
7 #include "base/bind.h" | 8 #include "base/bind.h" |
8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/app_mode/app_mode_utils.h" | 11 #include "chrome/browser/app_mode/app_mode_utils.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
13 #include "chrome/browser/download/download_shelf.h" | 14 #include "chrome/browser/download/download_shelf.h" |
14 #include "chrome/browser/fullscreen.h" | 15 #include "chrome/browser/fullscreen.h" |
15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // size was never specified by the capturer. | 306 // size was never specified by the capturer. |
306 if (old_contents->GetCapturerCount() == 0 || | 307 if (old_contents->GetCapturerCount() == 0 || |
307 old_contents->GetPreferredSize().IsEmpty()) { | 308 old_contents->GetPreferredSize().IsEmpty()) { |
308 return; | 309 return; |
309 } | 310 } |
310 | 311 |
311 content::RenderWidgetHostView* const current_fs_view = | 312 content::RenderWidgetHostView* const current_fs_view = |
312 old_contents->GetFullscreenRenderWidgetHostView(); | 313 old_contents->GetFullscreenRenderWidgetHostView(); |
313 if (current_fs_view) | 314 if (current_fs_view) |
314 current_fs_view->SetSize(old_contents->GetPreferredSize()); | 315 current_fs_view->SetSize(old_contents->GetPreferredSize()); |
315 old_contents->GetView()->SizeContents(old_contents->GetPreferredSize()); | 316 apps::ResizeWebContents(old_contents, old_contents->GetPreferredSize()); |
316 } | 317 } |
317 | 318 |
318 void FullscreenController::OnTabClosing(WebContents* web_contents) { | 319 void FullscreenController::OnTabClosing(WebContents* web_contents) { |
319 if (IsFullscreenForCapturedTab(web_contents)) { | 320 if (IsFullscreenForCapturedTab(web_contents)) { |
320 RenderViewHost* const rvh = web_contents->GetRenderViewHost(); | 321 RenderViewHost* const rvh = web_contents->GetRenderViewHost(); |
321 if (rvh) | 322 if (rvh) |
322 rvh->ExitFullscreen(); | 323 rvh->ExitFullscreen(); |
323 } else if (web_contents == fullscreened_tab_ || | 324 } else if (web_contents == fullscreened_tab_ || |
324 web_contents == mouse_lock_tab_) { | 325 web_contents == mouse_lock_tab_) { |
325 ExitTabFullscreenOrMouseLockIfNecessary(); | 326 ExitTabFullscreenOrMouseLockIfNecessary(); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 (fullscreened_tab_ == mouse_lock_tab_ && IsPrivilegedFullscreenForTab()) ? | 770 (fullscreened_tab_ == mouse_lock_tab_ && IsPrivilegedFullscreenForTab()) ? |
770 mouse_lock_tab_->GetFullscreenRenderWidgetHostView() : NULL; | 771 mouse_lock_tab_->GetFullscreenRenderWidgetHostView() : NULL; |
771 if (!mouse_lock_view) { | 772 if (!mouse_lock_view) { |
772 RenderViewHost* const rvh = mouse_lock_tab_->GetRenderViewHost(); | 773 RenderViewHost* const rvh = mouse_lock_tab_->GetRenderViewHost(); |
773 if (rvh) | 774 if (rvh) |
774 mouse_lock_view = rvh->GetView(); | 775 mouse_lock_view = rvh->GetView(); |
775 } | 776 } |
776 if (mouse_lock_view) | 777 if (mouse_lock_view) |
777 mouse_lock_view->UnlockMouse(); | 778 mouse_lock_view->UnlockMouse(); |
778 } | 779 } |
OLD | NEW |