Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/extensions/bookmark_app_helper.cc

Issue 202523011: Add a function to create a bookmark app from a WebApplicationInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_tab_helper
Patch Set: fix the fix Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper.h ('k') | chrome/browser/extensions/bookmark_app_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698