OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "chrome/browser/translate/chrome_translate_client.h" | 62 #include "chrome/browser/translate/chrome_translate_client.h" |
63 #include "chrome/browser/translate/cld_data_harness.h" | 63 #include "chrome/browser/translate/cld_data_harness.h" |
64 #include "chrome/browser/translate/cld_data_harness_factory.h" | 64 #include "chrome/browser/translate/cld_data_harness_factory.h" |
65 #include "chrome/browser/translate/translate_service.h" | 65 #include "chrome/browser/translate/translate_service.h" |
66 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 66 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
67 #include "chrome/browser/ui/browser.h" | 67 #include "chrome/browser/ui/browser.h" |
68 #include "chrome/browser/ui/browser_commands.h" | 68 #include "chrome/browser/ui/browser_commands.h" |
69 #include "chrome/browser/ui/browser_list.h" | 69 #include "chrome/browser/ui/browser_list.h" |
70 #include "chrome/browser/ui/browser_tabstrip.h" | 70 #include "chrome/browser/ui/browser_tabstrip.h" |
71 #include "chrome/browser/ui/browser_window.h" | 71 #include "chrome/browser/ui/browser_window.h" |
| 72 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| 73 #include "chrome/browser/ui/extensions/application_launch.h" |
72 #include "chrome/browser/ui/host_desktop.h" | 74 #include "chrome/browser/ui/host_desktop.h" |
73 #include "chrome/browser/ui/location_bar/location_bar.h" | 75 #include "chrome/browser/ui/location_bar/location_bar.h" |
74 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 76 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
75 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 77 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
76 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 78 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
77 #include "chrome/common/chrome_paths.h" | 79 #include "chrome/common/chrome_paths.h" |
78 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/extensions/extension_constants.h" | 81 #include "chrome/common/extensions/extension_constants.h" |
80 #include "chrome/common/extensions/features/feature_channel.h" | 82 #include "chrome/common/extensions/features/feature_channel.h" |
81 #include "chrome/common/pref_names.h" | 83 #include "chrome/common/pref_names.h" |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 NULL); | 2430 NULL); |
2429 UpdateProviderPolicy(policies); | 2431 UpdateProviderPolicy(policies); |
2430 | 2432 |
2431 const extensions::Extension* extension = | 2433 const extensions::Extension* extension = |
2432 LoadUnpackedExtension(kUnpackedFullscreenAppName, true); | 2434 LoadUnpackedExtension(kUnpackedFullscreenAppName, true); |
2433 ASSERT_TRUE(extension); | 2435 ASSERT_TRUE(extension); |
2434 | 2436 |
2435 // Launch an app that tries to open a fullscreen window. | 2437 // Launch an app that tries to open a fullscreen window. |
2436 TestAddAppWindowObserver add_window_observer( | 2438 TestAddAppWindowObserver add_window_observer( |
2437 extensions::AppWindowRegistry::Get(browser()->profile())); | 2439 extensions::AppWindowRegistry::Get(browser()->profile())); |
2438 OpenApplication(AppLaunchParams(browser()->profile(), | 2440 OpenApplication(AppLaunchParams(browser()->profile(), extension, |
2439 extension, | 2441 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, |
2440 extensions::LAUNCH_CONTAINER_NONE, | 2442 extensions::SOURCE_UNTRACKED)); |
2441 NEW_WINDOW)); | |
2442 extensions::AppWindow* window = add_window_observer.WaitForAppWindow(); | 2443 extensions::AppWindow* window = add_window_observer.WaitForAppWindow(); |
2443 ASSERT_TRUE(window); | 2444 ASSERT_TRUE(window); |
2444 | 2445 |
2445 // Verify that the window is not in fullscreen mode. | 2446 // Verify that the window is not in fullscreen mode. |
2446 EXPECT_FALSE(window->GetBaseWindow()->IsFullscreen()); | 2447 EXPECT_FALSE(window->GetBaseWindow()->IsFullscreen()); |
2447 | 2448 |
2448 // Verify that the window cannot be toggled into fullscreen mode via apps | 2449 // Verify that the window cannot be toggled into fullscreen mode via apps |
2449 // APIs. | 2450 // APIs. |
2450 EXPECT_TRUE(content::ExecuteScript( | 2451 EXPECT_TRUE(content::ExecuteScript( |
2451 window->web_contents(), | 2452 window->web_contents(), |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3428 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3428 browser2->tab_strip_model()->GetActiveWebContents(), | 3429 browser2->tab_strip_model()->GetActiveWebContents(), |
3429 "domAutomationController.send(window.showModalDialog !== undefined);", | 3430 "domAutomationController.send(window.showModalDialog !== undefined);", |
3430 &result)); | 3431 &result)); |
3431 EXPECT_TRUE(result); | 3432 EXPECT_TRUE(result); |
3432 } | 3433 } |
3433 | 3434 |
3434 #endif // !defined(CHROME_OS) | 3435 #endif // !defined(CHROME_OS) |
3435 | 3436 |
3436 } // namespace policy | 3437 } // namespace policy |
OLD | NEW |