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