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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 bool FullscreenController::IsControllerInitiatedFullscreen() const { | 86 bool FullscreenController::IsControllerInitiatedFullscreen() const { |
87 return toggled_into_fullscreen_; | 87 return toggled_into_fullscreen_; |
88 } | 88 } |
89 | 89 |
90 bool FullscreenController::IsUserAcceptedFullscreen() const { | 90 bool FullscreenController::IsUserAcceptedFullscreen() const { |
91 return tab_fullscreen_accepted_; | 91 return tab_fullscreen_accepted_; |
92 } | 92 } |
93 | 93 |
94 bool FullscreenController::IsFullscreenForTabOrPending( | 94 bool FullscreenController::IsFullscreenForTabOrPending( |
95 const WebContents* web_contents) const { | 95 const WebContents* web_contents) const { |
| 96 if (IsFullscreenForCapturedTab(web_contents)) |
| 97 return true; |
96 if (web_contents == exclusive_access_tab()) { | 98 if (web_contents == exclusive_access_tab()) { |
97 DCHECK(web_contents == | 99 DCHECK(web_contents == |
98 exclusive_access_manager()->context()->GetActiveWebContents()); | 100 exclusive_access_manager()->context()->GetActiveWebContents()); |
99 DCHECK(web_contents->GetCapturerCount() == 0); | |
100 return true; | 101 return true; |
101 } | 102 } |
102 return IsFullscreenForCapturedTab(web_contents); | 103 return false; |
103 } | 104 } |
104 | 105 |
105 bool FullscreenController::IsFullscreenCausedByTab() const { | 106 bool FullscreenController::IsFullscreenCausedByTab() const { |
106 return state_prior_to_tab_fullscreen_ == STATE_NORMAL; | 107 return state_prior_to_tab_fullscreen_ == STATE_NORMAL; |
107 } | 108 } |
108 | 109 |
109 void FullscreenController::EnterFullscreenModeForTab(WebContents* web_contents, | 110 void FullscreenController::EnterFullscreenModeForTab(WebContents* web_contents, |
110 const GURL& origin) { | 111 const GURL& origin) { |
111 DCHECK(web_contents); | 112 DCHECK(web_contents); |
112 | 113 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 return fullscreened_origin_; | 598 return fullscreened_origin_; |
598 | 599 |
599 return exclusive_access_tab()->GetLastCommittedURL(); | 600 return exclusive_access_tab()->GetLastCommittedURL(); |
600 } | 601 } |
601 | 602 |
602 GURL FullscreenController::GetEmbeddingOrigin() const { | 603 GURL FullscreenController::GetEmbeddingOrigin() const { |
603 DCHECK(exclusive_access_tab()); | 604 DCHECK(exclusive_access_tab()); |
604 | 605 |
605 return exclusive_access_tab()->GetLastCommittedURL(); | 606 return exclusive_access_tab()->GetLastCommittedURL(); |
606 } | 607 } |
OLD | NEW |