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 "chrome/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/profiles/profile_destroyer.h" | 8 #include "chrome/browser/profiles/profile_destroyer.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return new TestBrowserWindow(); | 219 return new TestBrowserWindow(); |
220 } | 220 } |
221 | 221 |
222 Browser* BrowserWithTestWindowTest::CreateBrowser( | 222 Browser* BrowserWithTestWindowTest::CreateBrowser( |
223 Profile* profile, | 223 Profile* profile, |
224 Browser::Type browser_type, | 224 Browser::Type browser_type, |
225 bool hosted_app, | 225 bool hosted_app, |
226 chrome::HostDesktopType host_desktop_type, | 226 chrome::HostDesktopType host_desktop_type, |
227 BrowserWindow* browser_window) { | 227 BrowserWindow* browser_window) { |
228 Browser::CreateParams params(profile, host_desktop_type); | 228 Browser::CreateParams params(profile, host_desktop_type); |
229 params.type = browser_type; | 229 if (hosted_app) { |
| 230 params = Browser::CreateParams::CreateForApp(Browser::TYPE_TRUSTED_POPUP, |
| 231 "Test", |
| 232 gfx::Rect(), |
| 233 profile, |
| 234 host_desktop_type); |
| 235 } else { |
| 236 params.type = browser_type; |
| 237 } |
230 params.window = browser_window; | 238 params.window = browser_window; |
231 if (hosted_app) | |
232 params.app_name = "Test"; | |
233 return new Browser(params); | 239 return new Browser(params); |
234 } | 240 } |
235 | 241 |
236 #if defined(TOOLKIT_VIEWS) | 242 #if defined(TOOLKIT_VIEWS) |
237 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { | 243 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { |
238 return new views::TestViewsDelegate; | 244 return new views::TestViewsDelegate; |
239 } | 245 } |
240 #endif | 246 #endif |
OLD | NEW |