Chromium Code Reviews| 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_dialog_helper.h" | 5 #include "chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 | 78 |
| 79 if (add_shortcut_pending_) | 79 if (add_shortcut_pending_) |
| 80 AddShortcut(info, icon); | 80 AddShortcut(info, icon); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void AddToHomescreenDialogHelper::Destroy(JNIEnv* env, | 83 void AddToHomescreenDialogHelper::Destroy(JNIEnv* env, |
| 84 const JavaParamRef<jobject>& obj) { | 84 const JavaParamRef<jobject>& obj) { |
| 85 delete this; | 85 delete this; |
| 86 } | 86 } |
| 87 | 87 |
| 88 SkBitmap AddToHomescreenDialogHelper::FinalizeLauncherIcon( | 88 SkBitmap AddToHomescreenDialogHelper::FinalizeLauncherIconInBackground( |
| 89 const SkBitmap& bitmap, | 89 const SkBitmap& bitmap, |
|
dominickn
2016/08/08 03:13:42
Nit: I think this indentation is wrong, you may as
| |
| 90 const GURL& url, | 90 const GURL& url, |
| 91 bool* is_generated) { | 91 bool* is_generated) { |
| 92 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 92 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 93 | 93 |
| 94 return ShortcutHelper::FinalizeLauncherIcon(bitmap, url, is_generated); | 94 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, |
| 95 is_generated); | |
| 95 } | 96 } |
| 96 | 97 |
| 97 void AddToHomescreenDialogHelper::AddShortcut( | 98 void AddToHomescreenDialogHelper::AddShortcut( |
| 98 JNIEnv* env, | 99 JNIEnv* env, |
| 99 const JavaParamRef<jobject>& obj, | 100 const JavaParamRef<jobject>& obj, |
| 100 const JavaParamRef<jstring>& j_user_title) { | 101 const JavaParamRef<jstring>& j_user_title) { |
| 101 add_shortcut_pending_ = true; | 102 add_shortcut_pending_ = true; |
| 102 | 103 |
| 103 base::string16 user_title = | 104 base::string16 user_title = |
| 104 base::android::ConvertJavaStringToUTF16(env, j_user_title); | 105 base::android::ConvertJavaStringToUTF16(env, j_user_title); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 content::WebContents* web_contents = data_fetcher_->web_contents(); | 145 content::WebContents* web_contents = data_fetcher_->web_contents(); |
| 145 if (!web_contents) | 146 if (!web_contents) |
| 146 return; | 147 return; |
| 147 | 148 |
| 148 AppBannerSettingsHelper::RecordBannerEvent( | 149 AppBannerSettingsHelper::RecordBannerEvent( |
| 149 web_contents, web_contents->GetURL(), | 150 web_contents, web_contents->GetURL(), |
| 150 data_fetcher_->shortcut_info().url.spec(), | 151 data_fetcher_->shortcut_info().url.spec(), |
| 151 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, | 152 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
| 152 base::Time::Now()); | 153 base::Time::Now()); |
| 153 } | 154 } |
| OLD | NEW |