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

Side by Side Diff: chrome/browser/android/banners/app_banner_infobar_delegate.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 unified diff | Download patch
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/banners/app_banner_infobar_delegate.h" 5 #include "chrome/browser/android/banners/app_banner_infobar_delegate.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/location.h" 9 #include "base/location.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 web_app_data_.start_url.spec(), 150 web_app_data_.start_url.spec(),
151 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, 151 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN,
152 AppBannerManager::GetCurrentTime()); 152 AppBannerManager::GetCurrentTime());
153 153
154 ShortcutInfo info; 154 ShortcutInfo info;
155 info.UpdateFromManifest(web_app_data_); 155 info.UpdateFromManifest(web_app_data_);
156 base::WorkerPool::PostTask( 156 base::WorkerPool::PostTask(
157 FROM_HERE, 157 FROM_HERE,
158 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, 158 base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap,
159 info, 159 info,
160 *app_icon_.get()), 160 *app_icon_.get(),
161 false),
161 true); 162 true);
162 return true; 163 return true;
163 } 164 }
164 165
165 return true; 166 return true;
166 } 167 }
167 168
168 bool AppBannerInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { 169 bool AppBannerInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
169 if (native_app_data_.is_null()) 170 if (native_app_data_.is_null())
170 return false; 171 return false;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 native_app_data_.obj()); 234 native_app_data_.obj());
234 static_cast<AppBannerInfoBar*>(infobar())->OnInstallStateChanged(newState); 235 static_cast<AppBannerInfoBar*>(infobar())->OnInstallStateChanged(newState);
235 } 236 }
236 237
237 238
238 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env) { 239 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env) {
239 return RegisterNativesImpl(env); 240 return RegisterNativesImpl(env);
240 } 241 }
241 242
242 } // namespace banners 243 } // namespace banners
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698