| OLD | NEW |
| 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" | 9 #include "base/guid.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 RecordAddToHomescreen(); | 116 RecordAddToHomescreen(); |
| 117 | 117 |
| 118 const std::string& uid = base::GenerateGUID(); | 118 const std::string& uid = base::GenerateGUID(); |
| 119 ShortcutHelper::AddToLauncherWithSkBitmap( | 119 ShortcutHelper::AddToLauncherWithSkBitmap( |
| 120 web_contents->GetBrowserContext(), info, uid, icon, | 120 web_contents->GetBrowserContext(), info, uid, icon, |
| 121 data_fetcher_->FetchSplashScreenImageCallback(uid)); | 121 data_fetcher_->FetchSplashScreenImageCallback(uid)); |
| 122 | 122 |
| 123 // Fire the appinstalled event. | 123 // Fire the appinstalled event. |
| 124 blink::mojom::InstallationServicePtr installation_service; | 124 blink::mojom::InstallationServicePtr installation_service; |
| 125 web_contents->GetMainFrame()->GetRemoteInterfaces()->GetInterface( | 125 web_contents->GetMainFrame()->GetRemoteInterfaces()->GetInterface( |
| 126 mojo::GetProxy(&installation_service)); | 126 mojo::MakeRequest(&installation_service)); |
| 127 DCHECK(installation_service); | 127 DCHECK(installation_service); |
| 128 installation_service->OnInstall(); | 128 installation_service->OnInstall(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void AddToHomescreenManager::RecordAddToHomescreen() { | 131 void AddToHomescreenManager::RecordAddToHomescreen() { |
| 132 // Record that the shortcut has been added, so no banners will be shown | 132 // Record that the shortcut has been added, so no banners will be shown |
| 133 // for this app. | 133 // for this app. |
| 134 content::WebContents* web_contents = data_fetcher_->web_contents(); | 134 content::WebContents* web_contents = data_fetcher_->web_contents(); |
| 135 if (!web_contents) | 135 if (!web_contents) |
| 136 return; | 136 return; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( | 190 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( |
| 191 const SkBitmap& bitmap, | 191 const SkBitmap& bitmap, |
| 192 const GURL& url, | 192 const GURL& url, |
| 193 bool* is_generated) { | 193 bool* is_generated) { |
| 194 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 194 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 195 | 195 |
| 196 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, | 196 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, |
| 197 is_generated); | 197 is_generated); |
| 198 } | 198 } |
| OLD | NEW |