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 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // scale factor. If none, another pass will be run using kDefaultDensity. | 224 // scale factor. If none, another pass will be run using kDefaultDensity. |
225 if (!url.is_valid()) | 225 if (!url.is_valid()) |
226 url = FindBestMatchingIcon(icons, device_scale_factor); | 226 url = FindBestMatchingIcon(icons, device_scale_factor); |
227 if (!url.is_valid()) | 227 if (!url.is_valid()) |
228 url = FindBestMatchingIcon(icons, Manifest::Icon::kDefaultDensity); | 228 url = FindBestMatchingIcon(icons, Manifest::Icon::kDefaultDensity); |
229 | 229 |
230 return url; | 230 return url; |
231 } | 231 } |
232 | 232 |
233 void ShortcutHelper::OnDidGetManifest(const content::Manifest& manifest) { | 233 void ShortcutHelper::OnDidGetManifest(const content::Manifest& manifest) { |
| 234 if (!manifest.IsEmpty()) { |
| 235 content::RecordAction( |
| 236 base::UserMetricsAction("webapps.AddShortcut.Manifest")); |
| 237 } |
| 238 |
234 // Set the title based on the manifest value, if any. | 239 // Set the title based on the manifest value, if any. |
235 if (!manifest.short_name.is_null()) | 240 if (!manifest.short_name.is_null()) |
236 title_ = manifest.short_name.string(); | 241 title_ = manifest.short_name.string(); |
237 else if (!manifest.name.is_null()) | 242 else if (!manifest.name.is_null()) |
238 title_ = manifest.name.string(); | 243 title_ = manifest.name.string(); |
239 | 244 |
240 // Set the url based on the manifest value, if any. | 245 // Set the url based on the manifest value, if any. |
241 if (manifest.start_url.is_valid()) | 246 if (manifest.start_url.is_valid()) |
242 url_ = manifest.start_url; | 247 url_ = manifest.start_url; |
243 | 248 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 base::android::GetApplicationContext(), | 480 base::android::GetApplicationContext(), |
476 java_url.obj(), | 481 java_url.obj(), |
477 java_title.obj(), | 482 java_title.obj(), |
478 java_bitmap.obj(), | 483 java_bitmap.obj(), |
479 r_value, | 484 r_value, |
480 g_value, | 485 g_value, |
481 b_value, | 486 b_value, |
482 display == content::Manifest::DISPLAY_MODE_STANDALONE, | 487 display == content::Manifest::DISPLAY_MODE_STANDALONE, |
483 orientation); | 488 orientation); |
484 } | 489 } |
OLD | NEW |