| 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/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 void ChromeManagementAPIDelegate::LaunchAppFunctionDelegate( | 174 void ChromeManagementAPIDelegate::LaunchAppFunctionDelegate( |
| 175 const extensions::Extension* extension, | 175 const extensions::Extension* extension, |
| 176 content::BrowserContext* context) const { | 176 content::BrowserContext* context) const { |
| 177 // Look at prefs to find the right launch container. | 177 // Look at prefs to find the right launch container. |
| 178 // If the user has not set a preference, the default launch value will be | 178 // If the user has not set a preference, the default launch value will be |
| 179 // returned. | 179 // returned. |
| 180 extensions::LaunchContainer launch_container = | 180 extensions::LaunchContainer launch_container = |
| 181 GetLaunchContainer(extensions::ExtensionPrefs::Get(context), extension); | 181 GetLaunchContainer(extensions::ExtensionPrefs::Get(context), extension); |
| 182 OpenApplication(AppLaunchParams( | 182 OpenApplication(AppLaunchParams(Profile::FromBrowserContext(context), |
| 183 Profile::FromBrowserContext(context), extension, launch_container, | 183 extension, launch_container, |
| 184 NEW_FOREGROUND_TAB, extensions::SOURCE_MANAGEMENT_API)); | 184 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 185 extensions::SOURCE_MANAGEMENT_API)); |
| 185 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_EXTENSION_API, | 186 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_EXTENSION_API, |
| 186 extension->GetType()); | 187 extension->GetType()); |
| 187 } | 188 } |
| 188 | 189 |
| 189 GURL ChromeManagementAPIDelegate::GetFullLaunchURL( | 190 GURL ChromeManagementAPIDelegate::GetFullLaunchURL( |
| 190 const extensions::Extension* extension) const { | 191 const extensions::Extension* extension) const { |
| 191 return extensions::AppLaunchInfo::GetFullLaunchURL(extension); | 192 return extensions::AppLaunchInfo::GetFullLaunchURL(extension); |
| 192 } | 193 } |
| 193 | 194 |
| 194 extensions::LaunchType ChromeManagementAPIDelegate::GetLaunchType( | 195 extensions::LaunchType ChromeManagementAPIDelegate::GetLaunchType( |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 336 |
| 336 GURL ChromeManagementAPIDelegate::GetIconURL( | 337 GURL ChromeManagementAPIDelegate::GetIconURL( |
| 337 const extensions::Extension* extension, | 338 const extensions::Extension* extension, |
| 338 int icon_size, | 339 int icon_size, |
| 339 ExtensionIconSet::MatchType match, | 340 ExtensionIconSet::MatchType match, |
| 340 bool grayscale, | 341 bool grayscale, |
| 341 bool* exists) const { | 342 bool* exists) const { |
| 342 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, | 343 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, |
| 343 match, grayscale, exists); | 344 match, grayscale, exists); |
| 344 } | 345 } |
| OLD | NEW |