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 #include "chrome/browser/extensions/api/management/chrome_management_api_delegat
e.h" | 5 #include "chrome/browser/extensions/api/management/chrome_management_api_delegat
e.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/bookmark_app_helper.h" | 8 #include "chrome/browser/extensions/bookmark_app_helper.h" |
9 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 9 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 bool ChromeManagementAPIDelegate::LaunchAppFunctionDelegate( | 237 bool ChromeManagementAPIDelegate::LaunchAppFunctionDelegate( |
238 const extensions::Extension* extension, | 238 const extensions::Extension* extension, |
239 content::BrowserContext* context) const { | 239 content::BrowserContext* context) const { |
240 // Look at prefs to find the right launch container. | 240 // Look at prefs to find the right launch container. |
241 // If the user has not set a preference, the default launch value will be | 241 // If the user has not set a preference, the default launch value will be |
242 // returned. | 242 // returned. |
243 extensions::LaunchContainer launch_container = | 243 extensions::LaunchContainer launch_container = |
244 GetLaunchContainer(extensions::ExtensionPrefs::Get(context), extension); | 244 GetLaunchContainer(extensions::ExtensionPrefs::Get(context), extension); |
245 OpenApplication(AppLaunchParams( | 245 OpenApplication(AppLaunchParams(Profile::FromBrowserContext(context), |
246 Profile::FromBrowserContext(context), extension, launch_container, | 246 extension, launch_container, |
247 NEW_FOREGROUND_TAB, extensions::SOURCE_MANAGEMENT_API)); | 247 NEW_FOREGROUND_TAB)); |
248 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_EXTENSION_API, | 248 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_EXTENSION_API, |
249 extension->GetType()); | 249 extension->GetType()); |
250 | 250 |
251 return true; | 251 return true; |
252 } | 252 } |
253 | 253 |
254 GURL ChromeManagementAPIDelegate::GetFullLaunchURL( | 254 GURL ChromeManagementAPIDelegate::GetFullLaunchURL( |
255 const extensions::Extension* extension) const { | 255 const extensions::Extension* extension) const { |
256 return extensions::AppLaunchInfo::GetFullLaunchURL(extension); | 256 return extensions::AppLaunchInfo::GetFullLaunchURL(extension); |
257 } | 257 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 GURL ChromeManagementAPIDelegate::GetIconURL( | 381 GURL ChromeManagementAPIDelegate::GetIconURL( |
382 const extensions::Extension* extension, | 382 const extensions::Extension* extension, |
383 int icon_size, | 383 int icon_size, |
384 ExtensionIconSet::MatchType match, | 384 ExtensionIconSet::MatchType match, |
385 bool grayscale, | 385 bool grayscale, |
386 bool* exists) const { | 386 bool* exists) const { |
387 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, | 387 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, |
388 match, grayscale, exists); | 388 match, grayscale, exists); |
389 } | 389 } |
OLD | NEW |