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/browser/ui/extensions/application_launch.h" | 5 #include "chrome/browser/ui/extensions/application_launch.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 return web_contents; | 224 return web_contents; |
225 } | 225 } |
226 | 226 |
227 WebContents* OpenApplicationTab(const AppLaunchParams& launch_params, | 227 WebContents* OpenApplicationTab(const AppLaunchParams& launch_params, |
228 const GURL& url) { | 228 const GURL& url) { |
229 const Extension* extension = GetExtension(launch_params); | 229 const Extension* extension = GetExtension(launch_params); |
230 CHECK(extension); | 230 CHECK(extension); |
231 Profile* const profile = launch_params.profile; | 231 Profile* const profile = launch_params.profile; |
232 WindowOpenDisposition disposition = launch_params.disposition; | 232 WindowOpenDisposition disposition = launch_params.disposition; |
233 | 233 |
234 Browser* browser = chrome::FindTabbedBrowser(profile, | 234 Browser* browser = chrome::FindTabbedBrowser(profile, false); |
235 false, | |
236 launch_params.desktop_type); | |
237 WebContents* contents = NULL; | 235 WebContents* contents = NULL; |
238 if (!browser) { | 236 if (!browser) { |
239 // No browser for this profile, need to open a new one. | 237 // No browser for this profile, need to open a new one. |
240 browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED, | 238 browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED, |
241 profile, | 239 profile, |
242 launch_params.desktop_type)); | 240 launch_params.desktop_type)); |
243 browser->window()->Show(); | 241 browser->window()->Show(); |
244 // There's no current tab in this browser window, so add a new one. | 242 // There's no current tab in this browser window, so add a new one. |
245 disposition = NEW_FOREGROUND_TAB; | 243 disposition = NEW_FOREGROUND_TAB; |
246 } else { | 244 } else { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); | 423 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); |
426 | 424 |
427 return tab; | 425 return tab; |
428 } | 426 } |
429 | 427 |
430 bool CanLaunchViaEvent(const extensions::Extension* extension) { | 428 bool CanLaunchViaEvent(const extensions::Extension* extension) { |
431 const extensions::Feature* feature = | 429 const extensions::Feature* feature = |
432 extensions::FeatureProvider::GetAPIFeature("app.runtime"); | 430 extensions::FeatureProvider::GetAPIFeature("app.runtime"); |
433 return feature->IsAvailableToExtension(extension).is_available(); | 431 return feature->IsAvailableToExtension(extension).is_available(); |
434 } | 432 } |
OLD | NEW |