 Chromium Code Reviews
 Chromium Code Reviews Issue 1737413002:
  Modified the behavior of "Hide Toolbar in Full Screen"  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1737413002:
  Modified the behavior of "Hide Toolbar in Full Screen"  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" | 
| 9 | 9 | 
| 10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" | 
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 | 690 | 
| 691 // Tests that the omnibox and tabs are hidden/visible in fullscreen mode. | 691 // Tests that the omnibox and tabs are hidden/visible in fullscreen mode. | 
| 692 // Ensure that when the user toggles this setting, the omnibox, tabs and | 692 // Ensure that when the user toggles this setting, the omnibox, tabs and | 
| 693 // preferences are updated correctly. | 693 // preferences are updated correctly. | 
| 694 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 694 IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, | 
| 695 FullscreenToolbarIsVisibleAccordingToPrefs) { | 695 FullscreenToolbarIsVisibleAccordingToPrefs) { | 
| 696 // This feature is only available on SystemFullscreen. | 696 // This feature is only available on SystemFullscreen. | 
| 697 if (!chrome::mac::SupportsSystemFullscreen()) | 697 if (!chrome::mac::SupportsSystemFullscreen()) | 
| 698 return; | 698 return; | 
| 699 | 699 | 
| 700 // Tests that the preference is set to false by default. | 700 // Tests that the preference is set to false by default. | 
| 
msw
2016/03/01 00:07:15
nit: update comment
 
spqchan
2016/03/01 17:50:18
Done.
 | |
| 701 PrefService* prefs = browser()->profile()->GetPrefs(); | 701 PrefService* prefs = browser()->profile()->GetPrefs(); | 
| 702 EXPECT_FALSE(prefs->GetBoolean(prefs::kHideFullscreenToolbar)); | 702 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); | 
| 703 | 703 | 
| 704 // Toggle fullscreen and check if the toolbar is shown. | 704 // Toggle fullscreen and check if the toolbar is shown. | 
| 705 ToggleFullscreenAndWaitForNotification(); | 705 ToggleFullscreenAndWaitForNotification(); | 
| 706 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_PRESENT); | 706 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_PRESENT); | 
| 707 | 707 | 
| 708 // Toggle the visibility of the fullscreen toolbar. Verify that the toolbar | 708 // Toggle the visibility of the fullscreen toolbar. Verify that the toolbar | 
| 709 // is hidden and the preference is correctly updated. | 709 // is hidden and the preference is correctly updated. | 
| 710 [[controller() presentationModeController] setToolbarFraction:0.0]; | 710 [[controller() presentationModeController] setToolbarFraction:0.0]; | 
| 711 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); | 711 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); | 
| 712 EXPECT_TRUE(prefs->GetBoolean(prefs::kHideFullscreenToolbar)); | 712 EXPECT_FALSE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); | 
| 713 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); | 713 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); | 
| 714 | 714 | 
| 715 // Toggle out and back into fullscreen and verify that the toolbar is still | 715 // Toggle out and back into fullscreen and verify that the toolbar is still | 
| 716 // hidden. | 716 // hidden. | 
| 717 ToggleFullscreenAndWaitForNotification(); | 717 ToggleFullscreenAndWaitForNotification(); | 
| 718 ToggleFullscreenAndWaitForNotification(); | 718 ToggleFullscreenAndWaitForNotification(); | 
| 719 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); | 719 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); | 
| 720 | 720 | 
| 721 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); | 721 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); | 
| 722 EXPECT_FALSE(prefs->GetBoolean(prefs::kHideFullscreenToolbar)); | 722 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); | 
| 723 } | 723 } | 
| OLD | NEW |