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_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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 408 |
409 case METRO_SNAP_FALSE: | 409 case METRO_SNAP_FALSE: |
410 #if defined(OS_WIN) | 410 #if defined(OS_WIN) |
411 GetFullscreenController()->SetMetroSnapMode(false); | 411 GetFullscreenController()->SetMetroSnapMode(false); |
412 #else | 412 #else |
413 NOTREACHED() << GetAndClearDebugLog(); | 413 NOTREACHED() << GetAndClearDebugLog(); |
414 #endif | 414 #endif |
415 break; | 415 break; |
416 | 416 |
417 case BUBBLE_EXIT_LINK: | 417 case BUBBLE_EXIT_LINK: |
418 GetFullscreenController()->ExitTabOrBrowserFullscreenToPreviousState(); | 418 GetFullscreenController()->ExitExclusiveAccessToPreviousState(); |
419 break; | 419 break; |
420 | 420 |
421 case BUBBLE_ALLOW: | 421 case BUBBLE_ALLOW: |
422 GetFullscreenController()->OnAcceptFullscreenPermission(); | 422 GetBrowser() |
| 423 ->exclusive_access_manager() |
| 424 ->OnAcceptExclusiveAccessPermission(); |
423 break; | 425 break; |
424 | 426 |
425 case BUBBLE_DENY: | 427 case BUBBLE_DENY: |
426 GetFullscreenController()->OnDenyFullscreenPermission(); | 428 GetBrowser() |
| 429 ->exclusive_access_manager() |
| 430 ->OnDenyExclusiveAccessPermission(); |
427 break; | 431 break; |
428 | 432 |
429 case WINDOW_CHANGE: | 433 case WINDOW_CHANGE: |
430 ChangeWindowFullscreenState(); | 434 ChangeWindowFullscreenState(); |
431 break; | 435 break; |
432 | 436 |
433 default: | 437 default: |
434 NOTREACHED() << "InvokeEvent needs a handler for event " | 438 NOTREACHED() << "InvokeEvent needs a handler for event " |
435 << GetEventString(event) << GetAndClearDebugLog(); | 439 << GetEventString(event) << GetAndClearDebugLog(); |
436 return false; | 440 return false; |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(), | 753 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(), |
750 !!fullscreen_for_tab) << GetAndClearDebugLog(); | 754 !!fullscreen_for_tab) << GetAndClearDebugLog(); |
751 } | 755 } |
752 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) { | 756 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) { |
753 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(), | 757 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(), |
754 !!in_metro_snap) << GetAndClearDebugLog(); | 758 !!in_metro_snap) << GetAndClearDebugLog(); |
755 } | 759 } |
756 } | 760 } |
757 | 761 |
758 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { | 762 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { |
759 return GetBrowser()->fullscreen_controller(); | 763 return GetBrowser()->exclusive_access_manager()->fullscreen_controller(); |
760 } | 764 } |
761 | 765 |
762 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const { | 766 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const { |
763 std::ostringstream output; | 767 std::ostringstream output; |
764 output << "transition_table_[NUM_STATES = " << NUM_STATES | 768 output << "transition_table_[NUM_STATES = " << NUM_STATES |
765 << "][NUM_EVENTS = " << NUM_EVENTS | 769 << "][NUM_EVENTS = " << NUM_EVENTS |
766 << "] =\n"; | 770 << "] =\n"; |
767 for (int state_int = 0; state_int < NUM_STATES; ++state_int) { | 771 for (int state_int = 0; state_int < NUM_STATES; ++state_int) { |
768 State state = static_cast<State>(state_int); | 772 State state = static_cast<State>(state_int); |
769 output << " { // " << GetStateString(state) << ":\n"; | 773 output << " { // " << GetStateString(state) << ":\n"; |
(...skipping 29 matching lines...) Expand all Loading... |
799 << std::right << std::setw(2) | 803 << std::right << std::setw(2) |
800 << info.distance | 804 << info.distance |
801 << " }, // " | 805 << " }, // " |
802 << GetStateString(state2) << "\n"; | 806 << GetStateString(state2) << "\n"; |
803 } | 807 } |
804 output << "},\n"; | 808 output << "},\n"; |
805 } | 809 } |
806 output << "};"; | 810 output << "};"; |
807 return output.str(); | 811 return output.str(); |
808 } | 812 } |
OLD | NEW |