| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/tabs/tab_strip_model.h" | 24 #include "chrome/browser/tabs/tab_strip_model.h" |
| 25 #include "chrome/browser/translate/translate_tab_helper.h" | 25 #include "chrome/browser/translate/translate_tab_helper.h" |
| 26 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 26 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 27 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 27 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
| 28 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 28 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
| 29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| 30 #include "chrome/browser/ui/browser_init.h" | 30 #include "chrome/browser/ui/browser_init.h" |
| 31 #include "chrome/browser/ui/browser_list.h" | 31 #include "chrome/browser/ui/browser_list.h" |
| 32 #include "chrome/browser/ui/browser_navigator.h" | 32 #include "chrome/browser/ui/browser_navigator.h" |
| 33 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
| 34 #include "chrome/browser/ui/fullscreen_controller.h" |
| 34 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 35 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 35 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 36 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 36 #include "chrome/common/chrome_notification_types.h" | 37 #include "chrome/common/chrome_notification_types.h" |
| 37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/extensions/extension.h" | 39 #include "chrome/common/extensions/extension.h" |
| 39 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 40 #include "chrome/test/base/in_process_browser_test.h" | 41 #include "chrome/test/base/in_process_browser_test.h" |
| 41 #include "chrome/test/base/ui_test_utils.h" | 42 #include "chrome/test/base/ui_test_utils.h" |
| 42 #include "content/browser/renderer_host/render_process_host_impl.h" | 43 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 43 #include "content/browser/renderer_host/render_view_host.h" | 44 #include "content/browser/renderer_host/render_view_host.h" |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 { | 899 { |
| 899 ui_test_utils::WindowedNotificationObserver fullscreen_observer( | 900 ui_test_utils::WindowedNotificationObserver fullscreen_observer( |
| 900 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 901 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
| 901 content::NotificationService::AllSources()); | 902 content::NotificationService::AllSources()); |
| 902 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); | 903 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); |
| 903 fullscreen_observer.Wait(); | 904 fullscreen_observer.Wait(); |
| 904 ASSERT_TRUE(browser()->window()->IsFullscreen()); | 905 ASSERT_TRUE(browser()->window()->IsFullscreen()); |
| 905 } | 906 } |
| 906 | 907 |
| 907 browser()->RequestToLockMouse(fullscreen_tab); | 908 browser()->RequestToLockMouse(fullscreen_tab); |
| 908 FullscreenExitBubbleType type = browser()->GetFullscreenExitBubbleType(); | 909 FullscreenExitBubbleType type = |
| 910 browser()->fullscreen_controller_->GetFullscreenExitBubbleType(); |
| 909 bool mouse_lock = false; | 911 bool mouse_lock = false; |
| 910 fullscreen_bubble::PermissionRequestedByType(type, NULL, &mouse_lock); | 912 fullscreen_bubble::PermissionRequestedByType(type, NULL, &mouse_lock); |
| 911 ASSERT_TRUE(mouse_lock); | 913 ASSERT_TRUE(mouse_lock); |
| 912 | 914 |
| 913 browser()->OnAcceptFullscreenPermission(fullscreen_tab->GetURL(), type); | 915 browser()->OnAcceptFullscreenPermission(fullscreen_tab->GetURL(), type); |
| 914 type = browser()->GetFullscreenExitBubbleType(); | 916 type = browser()->fullscreen_controller_->GetFullscreenExitBubbleType(); |
| 915 ASSERT_FALSE(fullscreen_bubble::ShowButtonsForType(type)); | 917 ASSERT_FALSE(fullscreen_bubble::ShowButtonsForType(type)); |
| 916 } | 918 } |
| 917 | 919 |
| 918 #if defined(OS_MACOSX) | 920 #if defined(OS_MACOSX) |
| 919 // http://crbug.com/100467 | 921 // http://crbug.com/100467 |
| 920 IN_PROC_BROWSER_TEST_F( | 922 IN_PROC_BROWSER_TEST_F( |
| 921 BrowserTest, FAILS_TabEntersPresentationModeFromWindowed) { | 923 BrowserTest, FAILS_TabEntersPresentationModeFromWindowed) { |
| 922 ASSERT_TRUE(test_server()->Start()); | 924 ASSERT_TRUE(test_server()->Start()); |
| 923 | 925 |
| 924 AddTabAtIndex( | 926 AddTabAtIndex( |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 | 1363 |
| 1362 // The normal browser should now have four. | 1364 // The normal browser should now have four. |
| 1363 EXPECT_EQ(4, browser()->tab_count()); | 1365 EXPECT_EQ(4, browser()->tab_count()); |
| 1364 | 1366 |
| 1365 // Close the additional browsers. | 1367 // Close the additional browsers. |
| 1366 popup_browser->CloseAllTabs(); | 1368 popup_browser->CloseAllTabs(); |
| 1367 app_browser->CloseAllTabs(); | 1369 app_browser->CloseAllTabs(); |
| 1368 app_popup_browser->CloseAllTabs(); | 1370 app_popup_browser->CloseAllTabs(); |
| 1369 } | 1371 } |
| 1370 #endif | 1372 #endif |
| OLD | NEW |