| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/test/histogram_tester.h" | 6 #include "base/test/histogram_tester.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 TO_NORMAL, | 41 TO_NORMAL, |
| 42 TO_FULLSCREEN, | 42 TO_FULLSCREEN, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 FullscreenControllerTestWindow(); | 45 FullscreenControllerTestWindow(); |
| 46 ~FullscreenControllerTestWindow() override {} | 46 ~FullscreenControllerTestWindow() override {} |
| 47 | 47 |
| 48 // BrowserWindow Interface: | 48 // BrowserWindow Interface: |
| 49 bool ShouldHideUIForFullscreen() const override; | 49 bool ShouldHideUIForFullscreen() const override; |
| 50 bool IsFullscreen() const override; | 50 bool IsFullscreen() const override; |
| 51 void UpdateFullscreenWithToolbar(bool with_toolbar) override; | |
| 52 static const char* GetWindowStateString(WindowState state); | 51 static const char* GetWindowStateString(WindowState state); |
| 53 WindowState state() const { return state_; } | 52 WindowState state() const { return state_; } |
| 54 void set_browser(Browser* browser) { browser_ = browser; } | 53 void set_browser(Browser* browser) { browser_ = browser; } |
| 55 ExclusiveAccessContext* GetExclusiveAccessContext() override; | 54 ExclusiveAccessContext* GetExclusiveAccessContext() override; |
| 56 | 55 |
| 57 // ExclusiveAccessContext Interface: | 56 // ExclusiveAccessContext Interface: |
| 58 Profile* GetProfile() override; | 57 Profile* GetProfile() override; |
| 59 content::WebContents* GetActiveWebContents() override; | 58 content::WebContents* GetActiveWebContents() override; |
| 60 void HideDownloadShelf() override; | 59 void HideDownloadShelf() override; |
| 61 void UnhideDownloadShelf() override; | 60 void UnhideDownloadShelf() override; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 105 } |
| 107 | 106 |
| 108 bool FullscreenControllerTestWindow::IsFullscreen() const { | 107 bool FullscreenControllerTestWindow::IsFullscreen() const { |
| 109 #if defined(OS_MACOSX) | 108 #if defined(OS_MACOSX) |
| 110 return state_ == FULLSCREEN || state_ == TO_FULLSCREEN; | 109 return state_ == FULLSCREEN || state_ == TO_FULLSCREEN; |
| 111 #else | 110 #else |
| 112 return state_ == FULLSCREEN || state_ == TO_NORMAL; | 111 return state_ == FULLSCREEN || state_ == TO_NORMAL; |
| 113 #endif | 112 #endif |
| 114 } | 113 } |
| 115 | 114 |
| 116 void FullscreenControllerTestWindow::UpdateFullscreenWithToolbar( | |
| 117 bool with_toolbar) { | |
| 118 EnterFullscreen(); | |
| 119 } | |
| 120 | |
| 121 // static | 115 // static |
| 122 const char* FullscreenControllerTestWindow::GetWindowStateString( | 116 const char* FullscreenControllerTestWindow::GetWindowStateString( |
| 123 WindowState state) { | 117 WindowState state) { |
| 124 switch (state) { | 118 switch (state) { |
| 125 ENUM_TO_STRING(NORMAL); | 119 ENUM_TO_STRING(NORMAL); |
| 126 ENUM_TO_STRING(FULLSCREEN); | 120 ENUM_TO_STRING(FULLSCREEN); |
| 127 ENUM_TO_STRING(TO_FULLSCREEN); | 121 ENUM_TO_STRING(TO_FULLSCREEN); |
| 128 ENUM_TO_STRING(TO_NORMAL); | 122 ENUM_TO_STRING(TO_NORMAL); |
| 129 default: | 123 default: |
| 130 NOTREACHED() << "No string for state " << state; | 124 NOTREACHED() << "No string for state " << state; |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); | 833 EXPECT_FALSE(wc_delegate->IsFullscreenForTabOrPending(tab)); |
| 840 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); | 834 EXPECT_FALSE(second_wc_delegate->IsFullscreenForTabOrPending(tab)); |
| 841 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); | 835 EXPECT_FALSE(GetFullscreenController()->IsWindowFullscreenForTabOrPending()); |
| 842 EXPECT_FALSE(second_browser->exclusive_access_manager() | 836 EXPECT_FALSE(second_browser->exclusive_access_manager() |
| 843 ->fullscreen_controller() | 837 ->fullscreen_controller() |
| 844 ->IsWindowFullscreenForTabOrPending()); | 838 ->IsWindowFullscreenForTabOrPending()); |
| 845 | 839 |
| 846 // Required tear-down specific to this test. | 840 // Required tear-down specific to this test. |
| 847 second_browser->tab_strip_model()->CloseAllTabs(); | 841 second_browser->tab_strip_model()->CloseAllTabs(); |
| 848 } | 842 } |
| OLD | NEW |