| 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_test.h" | 5 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool FullscreenControllerTest::IsFullscreenForBrowser() { | 54 bool FullscreenControllerTest::IsFullscreenForBrowser() { |
| 55 return GetFullscreenController()->IsFullscreenForBrowser(); | 55 return GetFullscreenController()->IsFullscreenForBrowser(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool FullscreenControllerTest::IsWindowFullscreenForTabOrPending() { | 58 bool FullscreenControllerTest::IsWindowFullscreenForTabOrPending() { |
| 59 return GetFullscreenController()->IsWindowFullscreenForTabOrPending(); | 59 return GetFullscreenController()->IsWindowFullscreenForTabOrPending(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool FullscreenControllerTest::IsMouseLockPermissionRequested() { | |
| 63 ExclusiveAccessBubbleType type = GetExclusiveAccessBubbleType(); | |
| 64 bool mouse_lock = false; | |
| 65 exclusive_access_bubble::PermissionRequestedByType(type, NULL, &mouse_lock); | |
| 66 return mouse_lock; | |
| 67 } | |
| 68 | |
| 69 bool FullscreenControllerTest::IsFullscreenPermissionRequested() { | |
| 70 ExclusiveAccessBubbleType type = GetExclusiveAccessBubbleType(); | |
| 71 bool fullscreen = false; | |
| 72 exclusive_access_bubble::PermissionRequestedByType(type, &fullscreen, NULL); | |
| 73 return fullscreen; | |
| 74 } | |
| 75 | |
| 76 ExclusiveAccessBubbleType | 62 ExclusiveAccessBubbleType |
| 77 FullscreenControllerTest::GetExclusiveAccessBubbleType() { | 63 FullscreenControllerTest::GetExclusiveAccessBubbleType() { |
| 78 return GetExclusiveAccessManager()->GetExclusiveAccessExitBubbleType(); | 64 return GetExclusiveAccessManager()->GetExclusiveAccessExitBubbleType(); |
| 79 } | 65 } |
| 80 | 66 |
| 81 bool FullscreenControllerTest::IsFullscreenBubbleDisplayed() { | 67 bool FullscreenControllerTest::IsFullscreenBubbleDisplayed() { |
| 82 return GetExclusiveAccessBubbleType() != EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE; | 68 return GetExclusiveAccessBubbleType() != EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE; |
| 83 } | 69 } |
| 84 | 70 |
| 85 bool FullscreenControllerTest::IsFullscreenBubbleDisplayingButtons() { | |
| 86 return exclusive_access_bubble::ShowButtonsForType( | |
| 87 GetExclusiveAccessBubbleType()); | |
| 88 } | |
| 89 | |
| 90 void FullscreenControllerTest::AcceptCurrentFullscreenOrMouseLockRequest() { | |
| 91 GetExclusiveAccessManager()->OnAcceptExclusiveAccessPermission(); | |
| 92 } | |
| 93 | |
| 94 void FullscreenControllerTest::DenyCurrentFullscreenOrMouseLockRequest() { | |
| 95 GetExclusiveAccessManager()->OnDenyExclusiveAccessPermission(); | |
| 96 } | |
| 97 | |
| 98 void FullscreenControllerTest::GoBack() { | 71 void FullscreenControllerTest::GoBack() { |
| 99 content::TestNavigationObserver observer( | 72 content::TestNavigationObserver observer( |
| 100 browser()->tab_strip_model()->GetActiveWebContents(), 1); | 73 browser()->tab_strip_model()->GetActiveWebContents(), 1); |
| 101 chrome::GoBack(browser(), CURRENT_TAB); | 74 chrome::GoBack(browser(), CURRENT_TAB); |
| 102 observer.Wait(); | 75 observer.Wait(); |
| 103 } | 76 } |
| 104 | 77 |
| 105 void FullscreenControllerTest::Reload() { | 78 void FullscreenControllerTest::Reload() { |
| 106 content::TestNavigationObserver observer( | 79 content::TestNavigationObserver observer( |
| 107 browser()->tab_strip_model()->GetActiveWebContents(), 1); | 80 browser()->tab_strip_model()->GetActiveWebContents(), 1); |
| 108 chrome::Reload(browser(), CURRENT_TAB); | 81 chrome::Reload(browser(), CURRENT_TAB); |
| 109 observer.Wait(); | 82 observer.Wait(); |
| 110 } | 83 } |
| 111 | 84 |
| 112 void FullscreenControllerTest::SetPrivilegedFullscreen(bool is_privileged) { | 85 void FullscreenControllerTest::SetPrivilegedFullscreen(bool is_privileged) { |
| 113 GetFullscreenController()->SetPrivilegedFullscreenForTesting(is_privileged); | 86 GetFullscreenController()->SetPrivilegedFullscreenForTesting(is_privileged); |
| 114 } | 87 } |
| OLD | NEW |