| 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/bookmark_app_helper.h" | 5 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/favicon_downloader.h" | 11 #include "chrome/browser/extensions/favicon_downloader.h" |
| 12 #include "chrome/browser/extensions/tab_helper.h" | 12 #include "chrome/browser/extensions/tab_helper.h" |
| 13 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 14 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 14 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 15 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 15 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 16 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
| 17 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 18 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
| 19 #include "skia/ext/image_operations.h" | 20 #include "skia/ext/image_operations.h" |
| 20 #include "skia/ext/platform_canvas.h" | 21 #include "skia/ext/platform_canvas.h" |
| 21 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
| 22 #include "ui/gfx/color_analysis.h" | 23 #include "ui/gfx/color_analysis.h" |
| 23 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
| 24 | 25 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 276 } |
| 276 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: | 277 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: |
| 277 callback_.Run(NULL, web_app_info_); | 278 callback_.Run(NULL, web_app_info_); |
| 278 break; | 279 break; |
| 279 default: | 280 default: |
| 280 NOTREACHED(); | 281 NOTREACHED(); |
| 281 break; | 282 break; |
| 282 } | 283 } |
| 283 } | 284 } |
| 284 | 285 |
| 286 void CreateOrUpdateBookmarkApp(ExtensionService* service, |
| 287 WebApplicationInfo& web_app_info) { |
| 288 scoped_refptr<extensions::CrxInstaller> installer( |
| 289 extensions::CrxInstaller::CreateSilent(service)); |
| 290 installer->set_error_on_unsupported_requirements(true); |
| 291 installer->InstallWebApp(web_app_info); |
| 292 } |
| 293 |
| 285 } // namespace extensions | 294 } // namespace extensions |
| OLD | NEW |