| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/views/frame/immersive_mode_controller_ash.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 chrome::ToggleFullscreenMode(browser()); | 66 chrome::ToggleFullscreenMode(browser()); |
| 67 waiter->Wait(); | 67 waiter->Wait(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Set whether the browser is in tab fullscreen. | 70 // Set whether the browser is in tab fullscreen. |
| 71 void SetTabFullscreen(bool tab_fullscreen) { | 71 void SetTabFullscreen(bool tab_fullscreen) { |
| 72 content::WebContents* web_contents = | 72 content::WebContents* web_contents = |
| 73 browser_view()->GetContentsWebViewForTest()->GetWebContents(); | 73 browser_view()->GetContentsWebViewForTest()->GetWebContents(); |
| 74 scoped_ptr<FullscreenNotificationObserver> waiter( | 74 scoped_ptr<FullscreenNotificationObserver> waiter( |
| 75 new FullscreenNotificationObserver()); | 75 new FullscreenNotificationObserver()); |
| 76 browser()->fullscreen_controller()->ToggleFullscreenModeForTab( | 76 browser()->ToggleFullscreenModeForTab(web_contents, tab_fullscreen); |
| 77 web_contents, tab_fullscreen); | |
| 78 waiter->Wait(); | 77 waiter->Wait(); |
| 79 } | 78 } |
| 80 | 79 |
| 81 // Attempt revealing the top-of-window views. | 80 // Attempt revealing the top-of-window views. |
| 82 void AttemptReveal() { | 81 void AttemptReveal() { |
| 83 if (!revealed_lock_.get()) { | 82 if (!revealed_lock_.get()) { |
| 84 revealed_lock_.reset(controller_->GetRevealedLock( | 83 revealed_lock_.reset(controller_->GetRevealedLock( |
| 85 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO)); | 84 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO)); |
| 86 } | 85 } |
| 87 } | 86 } |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 328 |
| 330 // Exit immersive fullscreen. The web contents should be back below the window | 329 // Exit immersive fullscreen. The web contents should be back below the window |
| 331 // header. | 330 // header. |
| 332 ToggleFullscreen(); | 331 ToggleFullscreen(); |
| 333 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); | 332 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); |
| 334 EXPECT_FALSE(controller()->IsEnabled()); | 333 EXPECT_FALSE(controller()->IsEnabled()); |
| 335 EXPECT_FALSE(tabstrip->visible()); | 334 EXPECT_FALSE(tabstrip->visible()); |
| 336 EXPECT_FALSE(toolbar->visible()); | 335 EXPECT_FALSE(toolbar->visible()); |
| 337 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); | 336 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); |
| 338 } | 337 } |
| OLD | NEW |