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

Side by Side Diff: chrome/browser/android/webapk/webapk_installer.cc

Issue 2921623004: Support badge icon in WebAPK update components (Closed)
Patch Set: rebase Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/webapk/webapk_installer.h" 5 #include "chrome/browser/android/webapk/webapk_installer.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/path_utils.h" 10 #include "base/android/path_utils.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 WebApkInstaller* installer = 202 WebApkInstaller* installer =
203 new WebApkInstaller(context, shortcut_info, primary_icon, badge_icon); 203 new WebApkInstaller(context, shortcut_info, primary_icon, badge_icon);
204 installer->InstallAsync(finish_callback); 204 installer->InstallAsync(finish_callback);
205 } 205 }
206 206
207 // static 207 // static
208 void WebApkInstaller::UpdateAsync( 208 void WebApkInstaller::UpdateAsync(
209 content::BrowserContext* context, 209 content::BrowserContext* context,
210 const ShortcutInfo& shortcut_info, 210 const ShortcutInfo& shortcut_info,
211 const SkBitmap& primary_icon, 211 const SkBitmap& primary_icon,
212 const SkBitmap& badge_icon,
212 const std::string& webapk_package, 213 const std::string& webapk_package,
213 int webapk_version, 214 int webapk_version,
214 const std::map<std::string, std::string>& icon_url_to_murmur2_hash, 215 const std::map<std::string, std::string>& icon_url_to_murmur2_hash,
215 bool is_manifest_stale, 216 bool is_manifest_stale,
216 const FinishCallback& finish_callback) { 217 const FinishCallback& finish_callback) {
217 // The installer will delete itself when it is done. 218 // The installer will delete itself when it is done.
218 WebApkInstaller* installer = new WebApkInstaller( 219 WebApkInstaller* installer = new WebApkInstaller(
219 context, shortcut_info, primary_icon, SkBitmap()); 220 context, shortcut_info, primary_icon, badge_icon);
220 installer->UpdateAsync(webapk_package, webapk_version, 221 installer->UpdateAsync(webapk_package, webapk_version,
221 icon_url_to_murmur2_hash, is_manifest_stale, 222 icon_url_to_murmur2_hash, is_manifest_stale,
222 finish_callback); 223 finish_callback);
223 } 224 }
224 225
225 // staic 226 // staic
226 void WebApkInstaller::InstallAsyncForTesting( 227 void WebApkInstaller::InstallAsyncForTesting(
227 WebApkInstaller* installer, 228 WebApkInstaller* installer,
228 const FinishCallback& finish_callback) { 229 const FinishCallback& finish_callback) {
229 installer->InstallAsync(finish_callback); 230 installer->InstallAsync(finish_callback);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 net::URLFetcher::Create(server_url, net::URLFetcher::POST, this); 490 net::URLFetcher::Create(server_url, net::URLFetcher::POST, this);
490 url_fetcher_->SetRequestContext(request_context_getter_); 491 url_fetcher_->SetRequestContext(request_context_getter_);
491 std::string serialized_request; 492 std::string serialized_request;
492 request_proto->SerializeToString(&serialized_request); 493 request_proto->SerializeToString(&serialized_request);
493 url_fetcher_->SetUploadData(kProtoMimeType, serialized_request); 494 url_fetcher_->SetUploadData(kProtoMimeType, serialized_request);
494 url_fetcher_->SetLoadFlags( 495 url_fetcher_->SetLoadFlags(
495 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_COOKIES | 496 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_COOKIES |
496 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA); 497 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA);
497 url_fetcher_->Start(); 498 url_fetcher_->Start();
498 } 499 }
OLDNEW
« no previous file with comments | « chrome/browser/android/webapk/webapk_installer.h ('k') | chrome/browser/android/webapk/webapk_installer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698