| 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.orientation); | 161 info.orientation, |
| 162 info.source); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void ShortcutHelper::RecordAddToHomescreen() { | 165 void ShortcutHelper::RecordAddToHomescreen() { |
| 165 // Record that the shortcut has been added, so no banners will be shown | 166 // Record that the shortcut has been added, so no banners will be shown |
| 166 // for this app. | 167 // for this app. |
| 167 content::WebContents* web_contents = data_fetcher_->web_contents(); | 168 content::WebContents* web_contents = data_fetcher_->web_contents(); |
| 168 if (!web_contents) | 169 if (!web_contents) |
| 169 return; | 170 return; |
| 170 | 171 |
| 171 AppBannerSettingsHelper::RecordBannerEvent( | 172 AppBannerSettingsHelper::RecordBannerEvent( |
| 172 web_contents, web_contents->GetURL(), | 173 web_contents, web_contents->GetURL(), |
| 173 data_fetcher_->shortcut_info().url.spec(), | 174 data_fetcher_->shortcut_info().url.spec(), |
| 174 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, | 175 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
| 175 base::Time::Now()); | 176 base::Time::Now()); |
| 176 } | 177 } |
| OLD | NEW |