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

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

Issue 2860193002: Correctly record WebAPK install source for Launch.HomescreenSource (Closed)
Patch Set: Rebase. Created 3 years, 7 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
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 base::android::ScopedJavaLocalRef<jstring> java_title = 280 base::android::ScopedJavaLocalRef<jstring> java_title =
281 base::android::ConvertUTF16ToJavaString(env, shortcut_info_.user_title); 281 base::android::ConvertUTF16ToJavaString(env, shortcut_info_.user_title);
282 base::android::ScopedJavaLocalRef<jstring> java_token = 282 base::android::ScopedJavaLocalRef<jstring> java_token =
283 base::android::ConvertUTF8ToJavaString(env, token); 283 base::android::ConvertUTF8ToJavaString(env, token);
284 base::android::ScopedJavaLocalRef<jstring> java_url = 284 base::android::ScopedJavaLocalRef<jstring> java_url =
285 base::android::ConvertUTF8ToJavaString(env, shortcut_info_.url.spec()); 285 base::android::ConvertUTF8ToJavaString(env, shortcut_info_.url.spec());
286 286
287 if (task_type_ == WebApkInstaller::INSTALL) { 287 if (task_type_ == WebApkInstaller::INSTALL) {
288 Java_WebApkInstaller_installWebApkAsync(env, java_ref_, java_webapk_package, 288 Java_WebApkInstaller_installWebApkAsync(env, java_ref_, java_webapk_package,
289 version, java_title, java_token, 289 version, java_title, java_token,
290 java_url); 290 java_url, shortcut_info_.source);
291 } else { 291 } else {
292 Java_WebApkInstaller_updateAsync(env, java_ref_, java_webapk_package, 292 Java_WebApkInstaller_updateAsync(env, java_ref_, java_webapk_package,
293 version, java_title, java_token, java_url); 293 version, java_title, java_token, java_url);
294 } 294 }
295 } 295 }
296 296
297 void WebApkInstaller::OnResult(WebApkInstallResult result) { 297 void WebApkInstaller::OnResult(WebApkInstallResult result) {
298 weak_ptr_factory_.InvalidateWeakPtrs(); 298 weak_ptr_factory_.InvalidateWeakPtrs();
299 finish_callback_.Run(result, relax_updates_, webapk_package_); 299 finish_callback_.Run(result, relax_updates_, webapk_package_);
300 300
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 net::URLFetcher::Create(server_url, net::URLFetcher::POST, this); 488 net::URLFetcher::Create(server_url, net::URLFetcher::POST, this);
489 url_fetcher_->SetRequestContext(request_context_getter_); 489 url_fetcher_->SetRequestContext(request_context_getter_);
490 std::string serialized_request; 490 std::string serialized_request;
491 request_proto->SerializeToString(&serialized_request); 491 request_proto->SerializeToString(&serialized_request);
492 url_fetcher_->SetUploadData(kProtoMimeType, serialized_request); 492 url_fetcher_->SetUploadData(kProtoMimeType, serialized_request);
493 url_fetcher_->SetLoadFlags( 493 url_fetcher_->SetLoadFlags(
494 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_COOKIES | 494 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_COOKIES |
495 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA); 495 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA);
496 url_fetcher_->Start(); 496 url_fetcher_->Start();
497 } 497 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698