Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Unified Diff: chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc

Issue 158253002: Tabs being screen-captured will fullscreen within their tab contents area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECK to make sure tab capture isn't started after tab fullscreen. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
index cafbcd588402f291cff866fc3c51f6c9ced90560..5606705ae76c8cec957750a59b09941223731f8e 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -384,14 +385,17 @@ bool FullscreenControllerStateTest::InvokeEvent(Event event) {
break;
case TAB_FULLSCREEN_TRUE:
- GetFullscreenController()->ToggleFullscreenModeForTab(
- GetBrowser()->tab_strip_model()->GetActiveWebContents(), true);
- break;
-
- case TAB_FULLSCREEN_FALSE:
- GetFullscreenController()->ToggleFullscreenModeForTab(
- GetBrowser()->tab_strip_model()->GetActiveWebContents(), false);
+ case TAB_FULLSCREEN_FALSE: {
+ content::WebContents* const active_tab =
+ GetBrowser()->tab_strip_model()->GetActiveWebContents();
+ GetFullscreenController()->
+ ToggleFullscreenModeForTab(active_tab, event == TAB_FULLSCREEN_TRUE);
+ // Activating/Deactivating tab fullscreen on a captured tab should not
+ // evoke a state change in the browser window.
+ if (active_tab->GetCapturerCount() > 0)
+ state_ = source_state;
break;
+ }
case METRO_SNAP_TRUE:
#if defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698