OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "apps/app_lifetime_monitor_factory.h" | 8 #include "apps/app_lifetime_monitor_factory.h" |
9 #include "apps/switches.h" | 9 #include "apps/switches.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // Use a WebAppShortcutCreator to get the path. | 221 // Use a WebAppShortcutCreator to get the path. |
222 scoped_ptr<web_app::ShortcutInfo> shortcut_info = | 222 scoped_ptr<web_app::ShortcutInfo> shortcut_info = |
223 web_app::ShortcutInfoForExtensionAndProfile(app, profile); | 223 web_app::ShortcutInfoForExtensionAndProfile(app, profile); |
224 web_app::WebAppShortcutCreator shortcut_creator( | 224 web_app::WebAppShortcutCreator shortcut_creator( |
225 web_app::GetWebAppDataDirectory(profile->GetPath(), app->id(), GURL()), | 225 web_app::GetWebAppDataDirectory(profile->GetPath(), app->id(), GURL()), |
226 shortcut_info.get(), extensions::FileHandlersInfo()); | 226 shortcut_info.get(), extensions::FileHandlersInfo()); |
227 return shortcut_creator.GetInternalShortcutPath(); | 227 return shortcut_creator.GetInternalShortcutPath(); |
228 } | 228 } |
229 | 229 |
230 Browser* GetFirstHostedAppWindow() { | 230 Browser* GetFirstHostedAppWindow() { |
231 BrowserList* browsers = | 231 for (Browser* browser : *BrowserList::GetInstance()) { |
232 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); | |
233 for (Browser* browser : *browsers) { | |
234 const extensions::Extension* extension = | 232 const extensions::Extension* extension = |
235 apps::ExtensionAppShimHandler::MaybeGetAppForBrowser(browser); | 233 apps::ExtensionAppShimHandler::MaybeGetAppForBrowser(browser); |
236 if (extension && extension->is_hosted_app()) | 234 if (extension && extension->is_hosted_app()) |
237 return browser; | 235 return browser; |
238 } | 236 } |
239 return nullptr; | 237 return nullptr; |
240 } | 238 } |
241 | 239 |
242 const extensions::Extension* AppShimInteractiveTest::InstallAppWithShim( | 240 const extensions::Extension* AppShimInteractiveTest::InstallAppWithShim( |
243 AppType type, | 241 AppType type, |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 // the shim is rebuilt. | 623 // the shim is rebuilt. |
626 WindowedAppShimLaunchObserver(app->id()).Wait(); | 624 WindowedAppShimLaunchObserver(app->id()).Wait(); |
627 | 625 |
628 EXPECT_TRUE(GetFirstAppWindow()); | 626 EXPECT_TRUE(GetFirstAppWindow()); |
629 EXPECT_TRUE(HasAppShimHost(profile(), app->id())); | 627 EXPECT_TRUE(HasAppShimHost(profile(), app->id())); |
630 } | 628 } |
631 | 629 |
632 #endif // defined(ARCH_CPU_64_BITS) | 630 #endif // defined(ARCH_CPU_64_BITS) |
633 | 631 |
634 } // namespace apps | 632 } // namespace apps |
OLD | NEW |