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

Side by Side Diff: chrome/browser/android/shortcut_helper.cc

Issue 1220813010: Add UMA metrics to track the source of homescreen icons on launch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 5 years, 5 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 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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/android/metrics/launch_metrics.cc ('k') | chrome/browser/android/shortcut_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698