| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shortcut_helper.h" | 5 #include "chrome/browser/android/shortcut_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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 if (icon_bitmap.getSize()) | 151 if (icon_bitmap.getSize()) |
| 152 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap); | 152 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap); |
| 153 | 153 |
| 154 Java_ShortcutHelper_addShortcut( | 154 Java_ShortcutHelper_addShortcut( |
| 155 env, | 155 env, |
| 156 base::android::GetApplicationContext(), | 156 base::android::GetApplicationContext(), |
| 157 java_url.obj(), | 157 java_url.obj(), |
| 158 java_title.obj(), | 158 java_title.obj(), |
| 159 java_bitmap.obj(), | 159 java_bitmap.obj(), |
| 160 info.display == content::Manifest::DISPLAY_MODE_STANDALONE, | 160 info.display == content::Manifest::DISPLAY_MODE_STANDALONE, |
| 161 info.theme_color, |
| 161 info.orientation, | 162 info.orientation, |
| 162 info.source); | 163 info.source); |
| 163 } | 164 } |
| 164 | 165 |
| 165 void ShortcutHelper::RecordAddToHomescreen() { | 166 void ShortcutHelper::RecordAddToHomescreen() { |
| 166 // Record that the shortcut has been added, so no banners will be shown | 167 // Record that the shortcut has been added, so no banners will be shown |
| 167 // for this app. | 168 // for this app. |
| 168 content::WebContents* web_contents = data_fetcher_->web_contents(); | 169 content::WebContents* web_contents = data_fetcher_->web_contents(); |
| 169 if (!web_contents) | 170 if (!web_contents) |
| 170 return; | 171 return; |
| 171 | 172 |
| 172 AppBannerSettingsHelper::RecordBannerEvent( | 173 AppBannerSettingsHelper::RecordBannerEvent( |
| 173 web_contents, web_contents->GetURL(), | 174 web_contents, web_contents->GetURL(), |
| 174 data_fetcher_->shortcut_info().url.spec(), | 175 data_fetcher_->shortcut_info().url.spec(), |
| 175 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, | 176 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
| 176 base::Time::Now()); | 177 base::Time::Now()); |
| 177 } | 178 } |
| OLD | NEW |