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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void FullscreenController::ExitExclusiveAccessIfNecessary() { | 292 void FullscreenController::ExitExclusiveAccessIfNecessary() { |
293 if (IsWindowFullscreenForTabOrPending()) | 293 if (IsWindowFullscreenForTabOrPending()) |
294 ExitFullscreenModeForTab(exclusive_access_tab()); | 294 ExitFullscreenModeForTab(exclusive_access_tab()); |
295 else | 295 else |
296 NotifyTabExclusiveAccessLost(); | 296 NotifyTabExclusiveAccessLost(); |
297 } | 297 } |
298 | 298 |
299 void FullscreenController::PostFullscreenChangeNotification( | 299 void FullscreenController::PostFullscreenChangeNotification( |
300 bool is_fullscreen) { | 300 bool is_fullscreen) { |
301 base::ThreadTaskRunnerHandle::Get()->PostTask( | 301 base::ThreadTaskRunnerHandle::Get()->PostTask( |
302 FROM_HERE, base::Bind(&FullscreenController::NotifyFullscreenChange, | 302 FROM_HERE, base::BindOnce(&FullscreenController::NotifyFullscreenChange, |
303 ptr_factory_.GetWeakPtr(), is_fullscreen)); | 303 ptr_factory_.GetWeakPtr(), is_fullscreen)); |
304 } | 304 } |
305 | 305 |
306 void FullscreenController::NotifyFullscreenChange(bool is_fullscreen) { | 306 void FullscreenController::NotifyFullscreenChange(bool is_fullscreen) { |
307 content::NotificationService::current()->Notify( | 307 content::NotificationService::current()->Notify( |
308 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 308 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
309 content::Source<FullscreenController>(this), | 309 content::Source<FullscreenController>(this), |
310 content::Details<bool>(&is_fullscreen)); | 310 content::Details<bool>(&is_fullscreen)); |
311 } | 311 } |
312 | 312 |
313 void FullscreenController::NotifyTabExclusiveAccessLost() { | 313 void FullscreenController::NotifyTabExclusiveAccessLost() { |
(...skipping 138 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 |