| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/bookmark_app_helper.h" | 10 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 const GURL& launch_url) const { | 268 const GURL& launch_url) const { |
| 269 favicon::FaviconService* favicon_service = | 269 favicon::FaviconService* favicon_service = |
| 270 FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), | 270 FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), |
| 271 ServiceAccessType::EXPLICIT_ACCESS); | 271 ServiceAccessType::EXPLICIT_ACCESS); |
| 272 DCHECK(favicon_service); | 272 DCHECK(favicon_service); |
| 273 | 273 |
| 274 ChromeAppForLinkDelegate* delegate = new ChromeAppForLinkDelegate; | 274 ChromeAppForLinkDelegate* delegate = new ChromeAppForLinkDelegate; |
| 275 | 275 |
| 276 favicon_service->GetFaviconImageForPageURL( | 276 favicon_service->GetFaviconImageForPageURL( |
| 277 launch_url, | 277 launch_url, |
| 278 base::Bind( | 278 base::Bind(&ChromeAppForLinkDelegate::OnFaviconForApp, |
| 279 &ChromeAppForLinkDelegate::OnFaviconForApp, | 279 base::Unretained(delegate), base::RetainedRef(function), |
| 280 base::Unretained(delegate), | 280 context, title, launch_url), |
| 281 scoped_refptr<extensions::ManagementGenerateAppForLinkFunction>( | |
| 282 function), | |
| 283 context, title, launch_url), | |
| 284 &delegate->cancelable_task_tracker_); | 281 &delegate->cancelable_task_tracker_); |
| 285 | 282 |
| 286 return scoped_ptr<extensions::AppForLinkDelegate>(delegate); | 283 return scoped_ptr<extensions::AppForLinkDelegate>(delegate); |
| 287 } | 284 } |
| 288 | 285 |
| 289 bool ChromeManagementAPIDelegate::CanHostedAppsOpenInWindows() const { | 286 bool ChromeManagementAPIDelegate::CanHostedAppsOpenInWindows() const { |
| 290 return extensions::util::CanHostedAppsOpenInWindows(); | 287 return extensions::util::CanHostedAppsOpenInWindows(); |
| 291 } | 288 } |
| 292 | 289 |
| 293 bool ChromeManagementAPIDelegate::IsNewBookmarkAppsEnabled() const { | 290 bool ChromeManagementAPIDelegate::IsNewBookmarkAppsEnabled() const { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 329 |
| 333 GURL ChromeManagementAPIDelegate::GetIconURL( | 330 GURL ChromeManagementAPIDelegate::GetIconURL( |
| 334 const extensions::Extension* extension, | 331 const extensions::Extension* extension, |
| 335 int icon_size, | 332 int icon_size, |
| 336 ExtensionIconSet::MatchType match, | 333 ExtensionIconSet::MatchType match, |
| 337 bool grayscale, | 334 bool grayscale, |
| 338 bool* exists) const { | 335 bool* exists) const { |
| 339 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, | 336 return extensions::ExtensionIconSource::GetIconURL(extension, icon_size, |
| 340 match, grayscale, exists); | 337 match, grayscale, exists); |
| 341 } | 338 } |
| OLD | NEW |