OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "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" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
17 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 17 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
18 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 18 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
19 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" | 19 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
20 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
21 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 21 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
22 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" | 22 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" |
| 23 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" |
23 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 24 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
24 #include "chrome/browser/ui/views/browser_dialogs.h" | 25 #include "chrome/browser/ui/views/browser_dialogs.h" |
25 #include "chrome/browser/ui/views/frame/browser_view.h" | 26 #include "chrome/browser/ui/views/frame/browser_view.h" |
26 #include "chrome/browser/ui/views/frame/top_container_view.h" | 27 #include "chrome/browser/ui/views/frame/top_container_view.h" |
27 #include "chrome/browser/ui/views/tabs/tab.h" | 28 #include "chrome/browser/ui/views/tabs/tab.h" |
28 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 29 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
29 #include "chrome/test/base/in_process_browser_test.h" | 30 #include "chrome/test/base/in_process_browser_test.h" |
30 #include "chrome/test/base/ui_test_utils.h" | 31 #include "chrome/test/base/ui_test_utils.h" |
31 #include "content/public/browser/javascript_dialog_manager.h" | 32 #include "content/public/browser/javascript_dialog_manager.h" |
32 #include "ui/aura/env.h" | 33 #include "ui/aura/env.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 // Callback for when the onbeforeunload dialog closes for the sake of testing | 70 // Callback for when the onbeforeunload dialog closes for the sake of testing |
70 // the dialog with immersive mode. | 71 // the dialog with immersive mode. |
71 void OnBeforeUnloadJavaScriptDialogClosed( | 72 void OnBeforeUnloadJavaScriptDialogClosed( |
72 bool success, | 73 bool success, |
73 const string16& user_input) { | 74 const string16& user_input) { |
74 } | 75 } |
75 | 76 |
76 // content::BrowserTestBase overrides: | 77 // content::BrowserTestBase overrides: |
77 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 78 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
78 chrome::EnableImmersiveFullscreenForTest(); | 79 ImmersiveFullscreenConfiguration::EnableImmersiveFullscreenForTest(); |
79 } | 80 } |
80 | 81 |
81 virtual void SetUpOnMainThread() OVERRIDE { | 82 virtual void SetUpOnMainThread() OVERRIDE { |
82 ASSERT_TRUE(chrome::UseImmersiveFullscreen()); | 83 ASSERT_TRUE(ImmersiveFullscreenConfiguration::UseImmersiveFullscreen()); |
83 browser_view_ = static_cast<BrowserView*>(browser()->window()); | 84 browser_view_ = static_cast<BrowserView*>(browser()->window()); |
84 controller_ = static_cast<ImmersiveModeControllerAsh*>( | 85 controller_ = static_cast<ImmersiveModeControllerAsh*>( |
85 browser_view_->immersive_mode_controller()); | 86 browser_view_->immersive_mode_controller()); |
86 zero_duration_mode_.reset(new ScopedAnimationDurationScaleMode( | 87 zero_duration_mode_.reset(new ScopedAnimationDurationScaleMode( |
87 ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 88 ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
88 } | 89 } |
89 | 90 |
90 virtual void CleanUpOnMainThread() OVERRIDE { | 91 virtual void CleanUpOnMainThread() OVERRIDE { |
91 zero_duration_mode_.reset(); | 92 zero_duration_mode_.reset(); |
92 } | 93 } |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 waiter.reset(new FullscreenNotificationObserver()); | 738 waiter.reset(new FullscreenNotificationObserver()); |
738 chrome::ToggleFullscreenMode(browser()); | 739 chrome::ToggleFullscreenMode(browser()); |
739 waiter->Wait(); | 740 waiter->Wait(); |
740 | 741 |
741 ASSERT_FALSE(controller()->IsEnabled()); | 742 ASSERT_FALSE(controller()->IsEnabled()); |
742 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); | 743 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); |
743 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); | 744 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); |
744 } | 745 } |
745 | 746 |
746 #endif // defined(OS_CHROMEOS) | 747 #endif // defined(OS_CHROMEOS) |
OLD | NEW |