OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <shlobj.h> // Must be before propkey. | 7 #include <shlobj.h> // Must be before propkey. |
8 #include <propkey.h> | 8 #include <propkey.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/win/scoped_comptr.h" | 16 #include "base/win/scoped_comptr.h" |
17 #include "base/win/scoped_propvariant.h" | 17 #include "base/win/scoped_propvariant.h" |
18 #include "base/win/windows_version.h" | 18 #include "base/win/windows_version.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/extensions/extension_browsertest.h" | 20 #include "chrome/browser/extensions/extension_browsertest.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_info_cache.h" | 22 #include "chrome/browser/profiles/profile_info_cache.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" | 24 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" |
25 #include "chrome/browser/profiles/profiles_state.h" | 25 #include "chrome/browser/profiles/profiles_state.h" |
26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/browser_finder.h" | 27 #include "chrome/browser/ui/browser_finder.h" |
28 #include "chrome/browser/ui/browser_iterator.h" | 28 #include "chrome/browser/ui/browser_list.h" |
29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
30 #include "chrome/browser/ui/extensions/app_launch_params.h" | 30 #include "chrome/browser/ui/extensions/app_launch_params.h" |
31 #include "chrome/browser/ui/extensions/application_launch.h" | 31 #include "chrome/browser/ui/extensions/application_launch.h" |
32 #include "chrome/browser/web_applications/web_app.h" | 32 #include "chrome/browser/web_applications/web_app.h" |
33 #include "chrome/browser/web_applications/web_app_win.h" | 33 #include "chrome/browser/web_applications/web_app_win.h" |
34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
36 #include "chrome/installer/util/browser_distribution.h" | 36 #include "chrome/installer/util/browser_distribution.h" |
37 #include "chrome/test/base/in_process_browser_test.h" | 37 #include "chrome/test/base/in_process_browser_test.h" |
38 #include "chrome/test/base/test_switches.h" | 38 #include "chrome/test/base/test_switches.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 NEW_FOREGROUND_TAB, extensions::SOURCE_TEST)); | 255 NEW_FOREGROUND_TAB, extensions::SOURCE_TEST)); |
256 | 256 |
257 // Check that the new browser has an app name. | 257 // Check that the new browser has an app name. |
258 // The launch should have created a new browser. | 258 // The launch should have created a new browser. |
259 ASSERT_EQ(2u, | 259 ASSERT_EQ(2u, |
260 chrome::GetBrowserCount(browser()->profile(), | 260 chrome::GetBrowserCount(browser()->profile(), |
261 browser()->host_desktop_type())); | 261 browser()->host_desktop_type())); |
262 | 262 |
263 // Find the new browser. | 263 // Find the new browser. |
264 Browser* app_browser = nullptr; | 264 Browser* app_browser = nullptr; |
265 for (chrome::BrowserIterator it; !it.done() && !app_browser; it.Next()) { | 265 for (auto* b : *BrowserList::GetInstance()) { |
266 if (*it != browser()) | 266 if (b != browser()) |
267 app_browser = *it; | 267 app_browser = b; |
268 } | 268 } |
269 ASSERT_TRUE(app_browser); | 269 ASSERT_TRUE(app_browser); |
270 ASSERT_TRUE(app_browser != browser()); | 270 ASSERT_TRUE(app_browser != browser()); |
271 | 271 |
272 WaitAndValidateBrowserWindowProperties( | 272 WaitAndValidateBrowserWindowProperties( |
273 base::Bind(&ValidateHostedAppWindowProperties, app_browser, extension)); | 273 base::Bind(&ValidateHostedAppWindowProperties, app_browser, extension)); |
274 } | 274 } |
OLD | NEW |