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

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

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Rebase. Created 3 years, 10 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/webapk/webapk_installer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 9 #include "base/guid.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 if (data_fetcher_->is_ready()) { 70 if (data_fetcher_->is_ready()) {
71 // If the fetcher isn't ready yet, the shortcut will be added when it is 71 // If the fetcher isn't ready yet, the shortcut will be added when it is
72 // via OnDataAvailable(); 72 // via OnDataAvailable();
73 AddShortcut(data_fetcher_->shortcut_info(), data_fetcher_->primary_icon()); 73 AddShortcut(data_fetcher_->shortcut_info(), data_fetcher_->primary_icon());
74 } 74 }
75 } 75 }
76 76
77 void AddToHomescreenManager::Start(content::WebContents* web_contents) { 77 void AddToHomescreenManager::Start(content::WebContents* web_contents) {
78 bool check_webapk_compatible = false; 78 bool check_webapk_compatible = false;
79 if (ChromeWebApkHost::AreWebApkEnabled() && 79 if (ChromeWebApkHost::CanInstallWebApk() &&
80 InstallableManager::IsContentSecure(web_contents)) { 80 InstallableManager::IsContentSecure(web_contents)) {
81 check_webapk_compatible = true; 81 check_webapk_compatible = true;
82 } else { 82 } else {
83 ShowDialog(); 83 ShowDialog();
84 } 84 }
85 85
86 data_fetcher_ = new AddToHomescreenDataFetcher( 86 data_fetcher_ = new AddToHomescreenDataFetcher(
87 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(), 87 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(),
88 ShortcutHelper::GetMinimumHomescreenIconSizeInPx(), 88 ShortcutHelper::GetMinimumHomescreenIconSizeInPx(),
89 ShortcutHelper::GetIdealSplashImageSizeInPx(), 89 ShortcutHelper::GetIdealSplashImageSizeInPx(),
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( 200 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground(
201 const SkBitmap& bitmap, 201 const SkBitmap& bitmap,
202 const GURL& url, 202 const GURL& url,
203 bool* is_generated) { 203 bool* is_generated) {
204 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 204 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
205 205
206 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, 206 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url,
207 is_generated); 207 is_generated);
208 } 208 }
OLDNEW
« no previous file with comments | « chrome/browser/android/webapk/webapk_installer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698