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

Unified Diff: chrome/browser/android/shortcut_helper.cc

Issue 934183002: Make the ShortcutHelper toast instead of send the user home for web app banners (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix existing null access, change for comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 9ee1d426ccddfa052c457bbc70a55b42a243ba6e..2c94f34d404d9bdca556ac906cda9ba303d0e84a 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -216,16 +216,17 @@ void ShortcutHelper::AddShortcut(
}
void ShortcutHelper::AddShortcutUsingManifestIcon() {
+ RecordAddToHomescreen();
+
// Stop observing so we don't get destroyed while doing the last steps.
Observe(NULL);
- RecordAddToHomescreen();
-
base::WorkerPool::PostTask(
FROM_HERE,
base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap,
shortcut_info_,
- manifest_icon_),
+ manifest_icon_,
+ true),
true);
Destroy();
@@ -306,12 +307,13 @@ void ShortcutHelper::AddShortcutInBackgroundWithRawBitmap(
&icon_bitmap);
}
- AddShortcutInBackgroundWithSkBitmap(info, icon_bitmap);
+ AddShortcutInBackgroundWithSkBitmap(info, icon_bitmap, true);
}
void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
const ShortcutInfo& info,
- const SkBitmap& icon_bitmap) {
+ const SkBitmap& icon_bitmap,
+ const bool return_to_homescreen) {
DCHECK(base::WorkerPool::RunsTasksOnCurrentThread());
SkColor color = color_utils::CalculateKMeanColorOfBitmap(icon_bitmap);
@@ -339,7 +341,8 @@ void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
g_value,
b_value,
info.display == content::Manifest::DISPLAY_MODE_STANDALONE,
- info.orientation);
+ info.orientation,
+ return_to_homescreen);
}
void ShortcutHelper::RecordAddToHomescreen() {
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698