Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 722703002: Make "source" a required argument of AppLaunchParams and fill in the argument in all call points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "chrome/browser/search_engines/template_url_service_factory.h" 61 #include "chrome/browser/search_engines/template_url_service_factory.h"
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/translate_service.h" 64 #include "chrome/browser/translate/translate_service.h"
65 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 65 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
66 #include "chrome/browser/ui/browser.h" 66 #include "chrome/browser/ui/browser.h"
67 #include "chrome/browser/ui/browser_commands.h" 67 #include "chrome/browser/ui/browser_commands.h"
68 #include "chrome/browser/ui/browser_list.h" 68 #include "chrome/browser/ui/browser_list.h"
69 #include "chrome/browser/ui/browser_tabstrip.h" 69 #include "chrome/browser/ui/browser_tabstrip.h"
70 #include "chrome/browser/ui/browser_window.h" 70 #include "chrome/browser/ui/browser_window.h"
71 #include "chrome/browser/ui/extensions/app_launch_params.h"
72 #include "chrome/browser/ui/extensions/application_launch.h"
71 #include "chrome/browser/ui/host_desktop.h" 73 #include "chrome/browser/ui/host_desktop.h"
72 #include "chrome/browser/ui/location_bar/location_bar.h" 74 #include "chrome/browser/ui/location_bar/location_bar.h"
73 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" 75 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
74 #include "chrome/browser/ui/omnibox/omnibox_view.h" 76 #include "chrome/browser/ui/omnibox/omnibox_view.h"
75 #include "chrome/browser/ui/tabs/tab_strip_model.h" 77 #include "chrome/browser/ui/tabs/tab_strip_model.h"
76 #include "chrome/common/chrome_paths.h" 78 #include "chrome/common/chrome_paths.h"
77 #include "chrome/common/chrome_switches.h" 79 #include "chrome/common/chrome_switches.h"
78 #include "chrome/common/extensions/extension_constants.h" 80 #include "chrome/common/extensions/extension_constants.h"
79 #include "chrome/common/extensions/features/feature_channel.h" 81 #include "chrome/common/extensions/features/feature_channel.h"
80 #include "chrome/common/pref_names.h" 82 #include "chrome/common/pref_names.h"
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 NULL); 2429 NULL);
2428 UpdateProviderPolicy(policies); 2430 UpdateProviderPolicy(policies);
2429 2431
2430 const extensions::Extension* extension = 2432 const extensions::Extension* extension =
2431 LoadUnpackedExtension(kUnpackedFullscreenAppName, true); 2433 LoadUnpackedExtension(kUnpackedFullscreenAppName, true);
2432 ASSERT_TRUE(extension); 2434 ASSERT_TRUE(extension);
2433 2435
2434 // Launch an app that tries to open a fullscreen window. 2436 // Launch an app that tries to open a fullscreen window.
2435 TestAddAppWindowObserver add_window_observer( 2437 TestAddAppWindowObserver add_window_observer(
2436 extensions::AppWindowRegistry::Get(browser()->profile())); 2438 extensions::AppWindowRegistry::Get(browser()->profile()));
2437 OpenApplication(AppLaunchParams(browser()->profile(), 2439 OpenApplication(AppLaunchParams(browser()->profile(), extension,
2438 extension, 2440 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW,
2439 extensions::LAUNCH_CONTAINER_NONE, 2441 extensions::SOURCE_UNTRACKED));
2440 NEW_WINDOW));
2441 extensions::AppWindow* window = add_window_observer.WaitForAppWindow(); 2442 extensions::AppWindow* window = add_window_observer.WaitForAppWindow();
2442 ASSERT_TRUE(window); 2443 ASSERT_TRUE(window);
2443 2444
2444 // Verify that the window is not in fullscreen mode. 2445 // Verify that the window is not in fullscreen mode.
2445 EXPECT_FALSE(window->GetBaseWindow()->IsFullscreen()); 2446 EXPECT_FALSE(window->GetBaseWindow()->IsFullscreen());
2446 2447
2447 // Verify that the window cannot be toggled into fullscreen mode via apps 2448 // Verify that the window cannot be toggled into fullscreen mode via apps
2448 // APIs. 2449 // APIs.
2449 EXPECT_TRUE(content::ExecuteScript( 2450 EXPECT_TRUE(content::ExecuteScript(
2450 window->web_contents(), 2451 window->web_contents(),
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
3426 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
3427 browser2->tab_strip_model()->GetActiveWebContents(), 3428 browser2->tab_strip_model()->GetActiveWebContents(),
3428 "domAutomationController.send(window.showModalDialog !== undefined);", 3429 "domAutomationController.send(window.showModalDialog !== undefined);",
3429 &result)); 3430 &result));
3430 EXPECT_TRUE(result); 3431 EXPECT_TRUE(result);
3431 } 3432 }
3432 3433
3433 #endif // !defined(CHROME_OS) 3434 #endif // !defined(CHROME_OS)
3434 3435
3435 } // namespace policy 3436 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698