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

Unified Diff: chrome/browser/android/shortcut_helper.cc

Issue 2724723002: [WebAPKs]: Reduce the parameters of ShortcutHelper::AddToLauncherWithSkBitmap() (Closed)
Patch Set: Merge branch 'master' into refactor_shortcut_helper2 Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/shortcut_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index c3e60da4248922f589a3f4da5c3911f43826aab4..5e28acdec90c9423677c17e59fc2ac5bd71d7c15 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -12,7 +12,7 @@
#include "base/android/jni_string.h"
#include "base/bind.h"
#include "base/callback.h"
-#include "base/command_line.h"
+#include "base/guid.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -133,14 +133,17 @@ void AddShortcutWithSkBitmap(const ShortcutInfo& info,
// static
void ShortcutHelper::AddToLauncherWithSkBitmap(
- content::BrowserContext* browser_context,
+ content::WebContents* web_contents,
const ShortcutInfo& info,
- const std::string& webapp_id,
- const SkBitmap& icon_bitmap,
- const base::Closure& splash_image_callback) {
+ const SkBitmap& icon_bitmap) {
+ std::string webapp_id = base::GenerateGUID();
if (info.display == blink::WebDisplayModeStandalone ||
info.display == blink::WebDisplayModeFullscreen) {
- AddWebappWithSkBitmap(info, webapp_id, icon_bitmap, splash_image_callback);
+ AddWebappWithSkBitmap(
+ info, webapp_id, icon_bitmap,
+ base::Bind(&ShortcutHelper::FetchSplashScreenImage, web_contents,
+ info.splash_image_url, info.ideal_splash_image_size_in_px,
+ info.minimum_splash_image_size_in_px, webapp_id));
GooglePlayInstallState state =
ChromeWebApkHost::GetGooglePlayInstallState();
if (state != GooglePlayInstallState::SUPPORTED)
@@ -152,11 +155,11 @@ void ShortcutHelper::AddToLauncherWithSkBitmap(
// static
void ShortcutHelper::InstallWebApkWithSkBitmap(
- content::BrowserContext* browser_context,
+ content::WebContents* web_contents,
const ShortcutInfo& info,
const SkBitmap& icon_bitmap,
const WebApkInstaller::FinishCallback& callback) {
- WebApkInstallService::Get(browser_context)
+ WebApkInstallService::Get(web_contents->GetBrowserContext())
->InstallAsync(info, icon_bitmap, callback);
// Don't record metric for users who install WebAPKs via "unsigned sources"
// flow.
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/shortcut_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698