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/exclusive_access/fullscreen_controller.h" | 5 #include "chrome/browser/ui/exclusive_access/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 "base/location.h" | 9 #include "base/location.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // size was never specified by the capturer. | 225 // size was never specified by the capturer. |
226 if (old_contents->GetCapturerCount() == 0 || | 226 if (old_contents->GetCapturerCount() == 0 || |
227 old_contents->GetPreferredSize().IsEmpty()) { | 227 old_contents->GetPreferredSize().IsEmpty()) { |
228 return; | 228 return; |
229 } | 229 } |
230 | 230 |
231 content::RenderWidgetHostView* const current_fs_view = | 231 content::RenderWidgetHostView* const current_fs_view = |
232 old_contents->GetFullscreenRenderWidgetHostView(); | 232 old_contents->GetFullscreenRenderWidgetHostView(); |
233 if (current_fs_view) | 233 if (current_fs_view) |
234 current_fs_view->SetSize(old_contents->GetPreferredSize()); | 234 current_fs_view->SetSize(old_contents->GetPreferredSize()); |
235 ResizeWebContents(old_contents, old_contents->GetPreferredSize()); | 235 ResizeWebContents(old_contents, gfx::Rect(old_contents->GetPreferredSize())); |
236 } | 236 } |
237 | 237 |
238 void FullscreenController::OnTabClosing(WebContents* web_contents) { | 238 void FullscreenController::OnTabClosing(WebContents* web_contents) { |
239 if (IsFullscreenForCapturedTab(web_contents)) | 239 if (IsFullscreenForCapturedTab(web_contents)) |
240 web_contents->ExitFullscreen( | 240 web_contents->ExitFullscreen( |
241 /* will_cause_resize */ IsFullscreenCausedByTab()); | 241 /* will_cause_resize */ IsFullscreenCausedByTab()); |
242 else | 242 else |
243 ExclusiveAccessControllerBase::OnTabClosing(web_contents); | 243 ExclusiveAccessControllerBase::OnTabClosing(web_contents); |
244 } | 244 } |
245 | 245 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return fullscreened_origin_; | 452 return fullscreened_origin_; |
453 | 453 |
454 return exclusive_access_tab()->GetLastCommittedURL(); | 454 return exclusive_access_tab()->GetLastCommittedURL(); |
455 } | 455 } |
456 | 456 |
457 GURL FullscreenController::GetEmbeddingOrigin() const { | 457 GURL FullscreenController::GetEmbeddingOrigin() const { |
458 DCHECK(exclusive_access_tab()); | 458 DCHECK(exclusive_access_tab()); |
459 | 459 |
460 return exclusive_access_tab()->GetLastCommittedURL(); | 460 return exclusive_access_tab()->GetLastCommittedURL(); |
461 } | 461 } |
OLD | NEW |