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 if (tab_fullscreen) { |
77 web_contents, tab_fullscreen); | 77 browser()->fullscreen_controller()->EnterFullscreenModeForTab( |
| 78 web_contents, GURL()); |
| 79 } else { |
| 80 browser()->fullscreen_controller()->ExitFullscreenModeForTab( |
| 81 web_contents); |
| 82 } |
| 83 |
78 waiter->Wait(); | 84 waiter->Wait(); |
79 } | 85 } |
80 | 86 |
81 // Attempt revealing the top-of-window views. | 87 // Attempt revealing the top-of-window views. |
82 void AttemptReveal() { | 88 void AttemptReveal() { |
83 if (!revealed_lock_.get()) { | 89 if (!revealed_lock_.get()) { |
84 revealed_lock_.reset(controller_->GetRevealedLock( | 90 revealed_lock_.reset(controller_->GetRevealedLock( |
85 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO)); | 91 ImmersiveModeControllerAsh::ANIMATE_REVEAL_NO)); |
86 } | 92 } |
87 } | 93 } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 335 |
330 // Exit immersive fullscreen. The web contents should be back below the window | 336 // Exit immersive fullscreen. The web contents should be back below the window |
331 // header. | 337 // header. |
332 ToggleFullscreen(); | 338 ToggleFullscreen(); |
333 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); | 339 EXPECT_FALSE(browser_view()->GetWidget()->IsFullscreen()); |
334 EXPECT_FALSE(controller()->IsEnabled()); | 340 EXPECT_FALSE(controller()->IsEnabled()); |
335 EXPECT_FALSE(tabstrip->visible()); | 341 EXPECT_FALSE(tabstrip->visible()); |
336 EXPECT_FALSE(toolbar->visible()); | 342 EXPECT_FALSE(toolbar->visible()); |
337 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); | 343 EXPECT_EQ(header_height, GetBoundsInWidget(contents_web_view).y()); |
338 } | 344 } |
OLD | NEW |