| OLD | NEW |
| 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_install_service.h" | 5 #include "chrome/browser/android/webapk/webapk_install_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/android/shortcut_info.h" | 8 #include "chrome/browser/android/shortcut_info.h" |
| 9 #include "chrome/browser/android/webapk/webapk_install_service_factory.h" | 9 #include "chrome/browser/android/webapk/webapk_install_service_factory.h" |
| 10 #include "chrome/browser/android/webapk/webapk_installer.h" | |
| 11 | 10 |
| 12 // static | 11 // static |
| 13 WebApkInstallService* WebApkInstallService::Get( | 12 WebApkInstallService* WebApkInstallService::Get( |
| 14 content::BrowserContext* context) { | 13 content::BrowserContext* context) { |
| 15 return WebApkInstallServiceFactory::GetForBrowserContext(context); | 14 return WebApkInstallServiceFactory::GetForBrowserContext(context); |
| 16 } | 15 } |
| 17 | 16 |
| 18 WebApkInstallService::WebApkInstallService( | 17 WebApkInstallService::WebApkInstallService( |
| 19 content::BrowserContext* browser_context) | 18 content::BrowserContext* browser_context) |
| 20 : browser_context_(browser_context), | 19 : browser_context_(browser_context), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 webapk_version, icon_url_to_murmur2_hash, is_manifest_stale, | 56 webapk_version, icon_url_to_murmur2_hash, is_manifest_stale, |
| 58 base::Bind(&WebApkInstallService::OnFinishedInstall, | 57 base::Bind(&WebApkInstallService::OnFinishedInstall, |
| 59 weak_ptr_factory_.GetWeakPtr(), shortcut_info.manifest_url, | 58 weak_ptr_factory_.GetWeakPtr(), shortcut_info.manifest_url, |
| 60 finish_callback)); | 59 finish_callback)); |
| 61 } | 60 } |
| 62 | 61 |
| 63 void WebApkInstallService::OnFinishedInstall( | 62 void WebApkInstallService::OnFinishedInstall( |
| 64 const GURL& web_manifest_url, | 63 const GURL& web_manifest_url, |
| 65 const FinishCallback& finish_callback, | 64 const FinishCallback& finish_callback, |
| 66 bool success, | 65 bool success, |
| 67 const std::string& webapk_package_name) { | 66 const FinishCallbackData& data) { |
| 68 finish_callback.Run(success, webapk_package_name); | 67 finish_callback.Run(success, data); |
| 69 installs_.erase(web_manifest_url); | 68 installs_.erase(web_manifest_url); |
| 70 } | 69 } |
| OLD | NEW |