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

Side by Side Diff: trunk/src/chrome/browser/extensions/platform_app_browsertest_util.cc

Issue 22355002: Revert 215753 "Move native_app_window code to apps areas" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 months 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 | Annotate | Revision Log
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 "chrome/browser/extensions/platform_app_browsertest_util.h" 5 #include "chrome/browser/extensions/platform_app_browsertest_util.h"
6 6
7 #include "apps/app_window_contents.h" 7 #include "apps/app_window_contents.h"
8 #include "apps/native_app_window.h"
9 #include "base/command_line.h" 8 #include "base/command_line.h"
10 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
11 #include "chrome/browser/extensions/api/tabs/tabs_api.h" 10 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
12 #include "chrome/browser/extensions/extension_function_test_utils.h" 11 #include "chrome/browser/extensions/extension_function_test_utils.h"
13 #include "chrome/browser/extensions/shell_window_registry.h" 12 #include "chrome/browser/extensions/shell_window_registry.h"
14 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" 13 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
15 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/extensions/application_launch.h" 15 #include "chrome/browser/ui/extensions/application_launch.h"
16 #include "chrome/browser/ui/extensions/native_app_window.h"
17 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 #include "content/public/test/test_utils.h" 19 #include "content/public/test/test_utils.h"
20 #include "extensions/common/switches.h" 20 #include "extensions/common/switches.h"
21 21
22 using apps::ShellWindow; 22 using apps::ShellWindow;
23 using content::WebContents; 23 using content::WebContents;
24 24
25 namespace utils = extension_function_test_utils; 25 namespace utils = extension_function_test_utils;
26 26
27 namespace extensions { 27 namespace extensions {
28 28
29 PlatformAppBrowserTest::PlatformAppBrowserTest() { 29 PlatformAppBrowserTest::PlatformAppBrowserTest() {
30 ChromeShellWindowDelegate::DisableExternalOpenForTesting(); 30 chrome::ChromeShellWindowDelegate::DisableExternalOpenForTesting();
31 } 31 }
32 32
33 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { 33 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) {
34 // Skips ExtensionApiTest::SetUpCommandLine. 34 // Skips ExtensionApiTest::SetUpCommandLine.
35 ExtensionBrowserTest::SetUpCommandLine(command_line); 35 ExtensionBrowserTest::SetUpCommandLine(command_line);
36 36
37 // Make event pages get suspended quicker. 37 // Make event pages get suspended quicker.
38 command_line->AppendSwitchASCII(::switches::kEventPageIdleTime, "1"); 38 command_line->AppendSwitchASCII(::switches::kEventPageIdleTime, "1");
39 command_line->AppendSwitchASCII(::switches::kEventPageSuspendingTime, "1"); 39 command_line->AppendSwitchASCII(::switches::kEventPageSuspendingTime, "1");
40 } 40 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 command_line->AppendArgPath(test_doc); 146 command_line->AppendArgPath(test_doc);
147 } 147 }
148 148
149 ShellWindow* PlatformAppBrowserTest::CreateShellWindow( 149 ShellWindow* PlatformAppBrowserTest::CreateShellWindow(
150 const Extension* extension) { 150 const Extension* extension) {
151 return CreateShellWindowFromParams(extension, ShellWindow::CreateParams()); 151 return CreateShellWindowFromParams(extension, ShellWindow::CreateParams());
152 } 152 }
153 153
154 ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams( 154 ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams(
155 const Extension* extension, const ShellWindow::CreateParams& params) { 155 const Extension* extension, const ShellWindow::CreateParams& params) {
156 ShellWindow* window = new ShellWindow(browser()->profile(), 156 ShellWindow* window = new ShellWindow(
157 new ChromeShellWindowDelegate(), 157 browser()->profile(),
158 extension); 158 new chrome::ChromeShellWindowDelegate(),
159 extension);
159 window->Init(GURL(std::string()), 160 window->Init(GURL(std::string()),
160 new apps::AppWindowContents(window), 161 new apps::AppWindowContents(window),
161 params); 162 params);
162 return window; 163 return window;
163 } 164 }
164 165
165 void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) { 166 void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) {
166 content::WindowedNotificationObserver destroyed_observer( 167 content::WindowedNotificationObserver destroyed_observer(
167 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 168 content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
168 content::NotificationService::AllSources()); 169 content::NotificationService::AllSources());
(...skipping 15 matching lines...) Expand all
184 bounds); 185 bounds);
185 } 186 }
186 187
187 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( 188 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine(
188 CommandLine* command_line) { 189 CommandLine* command_line) {
189 PlatformAppBrowserTest::SetUpCommandLine(command_line); 190 PlatformAppBrowserTest::SetUpCommandLine(command_line);
190 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 191 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
191 } 192 }
192 193
193 } // namespace extensions 194 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698