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

Side by Side 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: Addressed scheib's review comments. Rebased. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/fullscreen/fullscreen_controller_state_test.h" 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h"
6 6
7 #include <memory.h> 7 #include <memory.h>
8 8
9 #include <iomanip> 9 #include <iomanip>
10 #include <iostream> 10 #include <iostream>
11 11
12 #include "chrome/browser/fullscreen.h" 12 #include "chrome/browser/fullscreen.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_window.h" 14 #include "chrome/browser/ui/browser_window.h"
15 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 15 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
16 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" 16 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
18 #include "content/public/browser/web_contents.h"
18 #include "content/public/common/url_constants.h" 19 #include "content/public/common/url_constants.h"
19 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
20 21
21 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
22 #include "base/mac/mac_util.h" 23 #include "base/mac/mac_util.h"
23 #endif 24 #endif
24 25
25 namespace { 26 namespace {
26 27
27 bool SupportsMacSystemFullscreen() { 28 bool SupportsMacSystemFullscreen() {
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 #if defined(OS_MACOSX) 378 #if defined(OS_MACOSX)
378 if (chrome::mac::SupportsSystemFullscreen()) { 379 if (chrome::mac::SupportsSystemFullscreen()) {
379 GetFullscreenController()->ToggleFullscreenWithChrome(); 380 GetFullscreenController()->ToggleFullscreenWithChrome();
380 break; 381 break;
381 } 382 }
382 #endif 383 #endif
383 NOTREACHED() << GetAndClearDebugLog(); 384 NOTREACHED() << GetAndClearDebugLog();
384 break; 385 break;
385 386
386 case TAB_FULLSCREEN_TRUE: 387 case TAB_FULLSCREEN_TRUE:
387 GetFullscreenController()->ToggleFullscreenModeForTab( 388 case TAB_FULLSCREEN_FALSE: {
388 GetBrowser()->tab_strip_model()->GetActiveWebContents(), true); 389 content::WebContents* const active_tab =
390 GetBrowser()->tab_strip_model()->GetActiveWebContents();
391 GetFullscreenController()->
392 ToggleFullscreenModeForTab(active_tab, event == TAB_FULLSCREEN_TRUE);
393 // Activating/Deactivating tab fullscreen on a captured tab should not
394 // evoke a state change in the browser window.
395 if (active_tab->GetCapturerCount() > 0)
396 state_ = source_state;
389 break; 397 break;
390 398 }
391 case TAB_FULLSCREEN_FALSE:
392 GetFullscreenController()->ToggleFullscreenModeForTab(
393 GetBrowser()->tab_strip_model()->GetActiveWebContents(), false);
394 break;
395 399
396 case METRO_SNAP_TRUE: 400 case METRO_SNAP_TRUE:
397 #if defined(OS_WIN) 401 #if defined(OS_WIN)
398 GetFullscreenController()->SetMetroSnapMode(true); 402 GetFullscreenController()->SetMetroSnapMode(true);
399 #else 403 #else
400 NOTREACHED() << GetAndClearDebugLog(); 404 NOTREACHED() << GetAndClearDebugLog();
401 #endif 405 #endif
402 break; 406 break;
403 407
404 case METRO_SNAP_FALSE: 408 case METRO_SNAP_FALSE:
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 << std::right << std::setw(2) 815 << std::right << std::setw(2)
812 << info.distance 816 << info.distance
813 << " }, // " 817 << " }, // "
814 << GetStateString(state2) << "\n"; 818 << GetStateString(state2) << "\n";
815 } 819 }
816 output << "},\n"; 820 output << "},\n";
817 } 821 }
818 output << "};"; 822 output << "};";
819 return output.str(); 823 return output.str();
820 } 824 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698