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/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 #endif | 502 #endif |
503 exclusive_access_manager()->context()->ExitFullscreen(); | 503 exclusive_access_manager()->context()->ExitFullscreen(); |
504 extension_caused_fullscreen_ = GURL(); | 504 extension_caused_fullscreen_ = GURL(); |
505 | 505 |
506 exclusive_access_manager()->UpdateExclusiveAccessExitBubbleContent(); | 506 exclusive_access_manager()->UpdateExclusiveAccessExitBubbleContent(); |
507 } | 507 } |
508 | 508 |
509 ContentSetting FullscreenController::GetFullscreenSetting() const { | 509 ContentSetting FullscreenController::GetFullscreenSetting() const { |
510 DCHECK(exclusive_access_tab()); | 510 DCHECK(exclusive_access_tab()); |
511 | 511 |
| 512 // If simplified UI is enabled, never ask the user, just auto-allow. |
| 513 // TODO(mgiuca): Should we allow the user to block use of fullscreen? |
| 514 // http://crbug.com/515747. |
| 515 if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) |
| 516 return CONTENT_SETTING_ALLOW; |
| 517 |
512 GURL url = GetRequestingOrigin(); | 518 GURL url = GetRequestingOrigin(); |
513 | 519 |
514 // Always ask on file:// URLs, since we can't meaningfully make the | 520 // Always ask on file:// URLs, since we can't meaningfully make the |
515 // decision stick for a particular origin. | 521 // decision stick for a particular origin. |
516 // TODO(estark): Revisit this when crbug.com/455882 is fixed. | 522 // TODO(estark): Revisit this when crbug.com/455882 is fixed. |
517 if (url.SchemeIsFile()) | 523 if (url.SchemeIsFile()) |
518 return CONTENT_SETTING_ASK; | 524 return CONTENT_SETTING_ASK; |
519 | 525 |
520 if (IsPrivilegedFullscreenForTab()) | 526 if (IsPrivilegedFullscreenForTab()) |
521 return CONTENT_SETTING_ALLOW; | 527 return CONTENT_SETTING_ALLOW; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return fullscreened_origin_; | 600 return fullscreened_origin_; |
595 | 601 |
596 return exclusive_access_tab()->GetLastCommittedURL(); | 602 return exclusive_access_tab()->GetLastCommittedURL(); |
597 } | 603 } |
598 | 604 |
599 GURL FullscreenController::GetEmbeddingOrigin() const { | 605 GURL FullscreenController::GetEmbeddingOrigin() const { |
600 DCHECK(exclusive_access_tab()); | 606 DCHECK(exclusive_access_tab()); |
601 | 607 |
602 return exclusive_access_tab()->GetLastCommittedURL(); | 608 return exclusive_access_tab()->GetLastCommittedURL(); |
603 } | 609 } |
OLD | NEW |