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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_manager.cc

Issue 2724723002: [WebAPKs]: Reduce the parameters of ShortcutHelper::AddToLauncherWithSkBitmap() (Closed)
Patch Set: Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/webapps/add_to_homescreen_manager.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_manager.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/guid.h"
10 #include "base/location.h" 9 #include "base/location.h"
11 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
12 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
13 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
14 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/threading/sequenced_worker_pool.h"
15 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" 14 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h"
16 #include "chrome/browser/android/shortcut_helper.h" 15 #include "chrome/browser/android/shortcut_helper.h"
17 #include "chrome/browser/android/webapk/chrome_webapk_host.h" 16 #include "chrome/browser/android/webapk/chrome_webapk_host.h"
18 #include "chrome/browser/android/webapk/webapk_install_service.h" 17 #include "chrome/browser/android/webapk/webapk_install_service.h"
19 #include "chrome/browser/android/webapk/webapk_metrics.h" 18 #include "chrome/browser/android/webapk/webapk_metrics.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 DCHECK(add_shortcut_pending_); 109 DCHECK(add_shortcut_pending_);
111 if (!add_shortcut_pending_) 110 if (!add_shortcut_pending_)
112 return; 111 return;
113 add_shortcut_pending_ = false; 112 add_shortcut_pending_ = false;
114 113
115 content::WebContents* web_contents = data_fetcher_->web_contents(); 114 content::WebContents* web_contents = data_fetcher_->web_contents();
116 if (!web_contents) 115 if (!web_contents)
117 return; 116 return;
118 117
119 RecordAddToHomescreen(); 118 RecordAddToHomescreen();
120 119
dominickn 2017/03/01 02:29:40 Minor nit: remove newline on line 119
121 const std::string& uid = base::GenerateGUID(); 120 ShortcutHelper::AddToLauncherWithSkBitmap(web_contents, info, icon);
122 ShortcutHelper::AddToLauncherWithSkBitmap(
123 web_contents->GetBrowserContext(), info, uid, icon,
124 data_fetcher_->FetchSplashScreenImageCallback(uid));
125 121
126 // Fire the appinstalled event. 122 // Fire the appinstalled event.
127 blink::mojom::InstallationServicePtr installation_service; 123 blink::mojom::InstallationServicePtr installation_service;
128 web_contents->GetMainFrame()->GetRemoteInterfaces()->GetInterface( 124 web_contents->GetMainFrame()->GetRemoteInterfaces()->GetInterface(
129 mojo::MakeRequest(&installation_service)); 125 mojo::MakeRequest(&installation_service));
130 DCHECK(installation_service); 126 DCHECK(installation_service);
131 installation_service->OnInstall(); 127 installation_service->OnInstall();
132 } 128 }
133 129
134 void AddToHomescreenManager::RecordAddToHomescreen() { 130 void AddToHomescreenManager::RecordAddToHomescreen() {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 196
201 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( 197 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground(
202 const SkBitmap& bitmap, 198 const SkBitmap& bitmap,
203 const GURL& url, 199 const GURL& url,
204 bool* is_generated) { 200 bool* is_generated) {
205 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 201 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
206 202
207 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, 203 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url,
208 is_generated); 204 is_generated);
209 } 205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698