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

Side by Side Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.cc

Issue 836933005: Refactor fullscreen_controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build break Created 5 years, 11 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
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/exclusive_access/fullscreen_controller_state_test.h" 5 #include "chrome/browser/ui/exclusive_access/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>
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 case METRO_SNAP_FALSE: 404 case METRO_SNAP_FALSE:
405 #if defined(OS_WIN) 405 #if defined(OS_WIN)
406 GetFullscreenController()->SetMetroSnapMode(false); 406 GetFullscreenController()->SetMetroSnapMode(false);
407 #else 407 #else
408 NOTREACHED() << GetAndClearDebugLog(); 408 NOTREACHED() << GetAndClearDebugLog();
409 #endif 409 #endif
410 break; 410 break;
411 411
412 case BUBBLE_EXIT_LINK: 412 case BUBBLE_EXIT_LINK:
413 GetFullscreenController()->ExitTabOrBrowserFullscreenToPreviousState(); 413 GetFullscreenController()->ExitExclusiveAccessToPreviousState();
414 break; 414 break;
415 415
416 case BUBBLE_ALLOW: 416 case BUBBLE_ALLOW:
417 GetFullscreenController()->OnAcceptFullscreenPermission(); 417 GetBrowser()
418 ->GetExclusiveAccessManager()
419 ->OnAcceptExclusiveAccessPermission();
418 break; 420 break;
419 421
420 case BUBBLE_DENY: 422 case BUBBLE_DENY:
421 GetFullscreenController()->OnDenyFullscreenPermission(); 423 GetBrowser()
424 ->GetExclusiveAccessManager()
425 ->OnDenyExclusiveAccessPermission();
422 break; 426 break;
423 427
424 case WINDOW_CHANGE: 428 case WINDOW_CHANGE:
425 ChangeWindowFullscreenState(); 429 ChangeWindowFullscreenState();
426 break; 430 break;
427 431
428 default: 432 default:
429 NOTREACHED() << "InvokeEvent needs a handler for event " 433 NOTREACHED() << "InvokeEvent needs a handler for event "
430 << GetEventString(event) << GetAndClearDebugLog(); 434 << GetEventString(event) << GetAndClearDebugLog();
431 return false; 435 return false;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(), 748 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(),
745 !!fullscreen_for_tab) << GetAndClearDebugLog(); 749 !!fullscreen_for_tab) << GetAndClearDebugLog();
746 } 750 }
747 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) { 751 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) {
748 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(), 752 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(),
749 !!in_metro_snap) << GetAndClearDebugLog(); 753 !!in_metro_snap) << GetAndClearDebugLog();
750 } 754 }
751 } 755 }
752 756
753 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { 757 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() {
754 return GetBrowser()->fullscreen_controller(); 758 return GetBrowser()->GetExclusiveAccessManager()->GetFullscreenController();
755 } 759 }
756 760
757 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const { 761 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const {
758 std::ostringstream output; 762 std::ostringstream output;
759 output << "transition_table_[NUM_STATES = " << NUM_STATES 763 output << "transition_table_[NUM_STATES = " << NUM_STATES
760 << "][NUM_EVENTS = " << NUM_EVENTS 764 << "][NUM_EVENTS = " << NUM_EVENTS
761 << "] =\n"; 765 << "] =\n";
762 for (int state_int = 0; state_int < NUM_STATES; ++state_int) { 766 for (int state_int = 0; state_int < NUM_STATES; ++state_int) {
763 State state = static_cast<State>(state_int); 767 State state = static_cast<State>(state_int);
764 output << " { // " << GetStateString(state) << ":\n"; 768 output << " { // " << GetStateString(state) << ":\n";
(...skipping 29 matching lines...) Expand all
794 << std::right << std::setw(2) 798 << std::right << std::setw(2)
795 << info.distance 799 << info.distance
796 << " }, // " 800 << " }, // "
797 << GetStateString(state2) << "\n"; 801 << GetStateString(state2) << "\n";
798 } 802 }
799 output << "},\n"; 803 output << "},\n";
800 } 804 }
801 output << "};"; 805 output << "};";
802 return output.str(); 806 return output.str();
803 } 807 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698