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/banners/app_banner_manager_android.h" | |
| 6 | |
| 7 #include <memory> | |
| 5 #include <utility> | 8 #include <utility> |
| 6 | 9 |
| 7 #include "chrome/browser/android/banners/app_banner_manager_android.h" | |
| 8 | |
| 9 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 11 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" | 14 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" |
| 14 #include "chrome/browser/android/shortcut_helper.h" | 15 #include "chrome/browser/android/shortcut_helper.h" |
| 15 #include "chrome/browser/android/webapk/chrome_webapk_host.h" | 16 #include "chrome/browser/android/webapk/chrome_webapk_host.h" |
| 16 #include "chrome/browser/android/webapk/webapk_metrics.h" | 17 #include "chrome/browser/android/webapk/webapk_metrics.h" |
| 17 #include "chrome/browser/android/webapk/webapk_web_manifest_checker.h" | 18 #include "chrome/browser/android/webapk/webapk_web_manifest_checker.h" |
| 18 #include "chrome/browser/banners/app_banner_metrics.h" | 19 #include "chrome/browser/banners/app_banner_metrics.h" |
| 19 #include "chrome/browser/manifest/manifest_icon_downloader.h" | 20 #include "chrome/browser/manifest/manifest_icon_downloader.h" |
| 20 #include "chrome/browser/manifest/manifest_icon_selector.h" | 21 #include "chrome/browser/manifest/manifest_icon_selector.h" |
| 21 #include "chrome/common/chrome_constants.h" | |
| 22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/common/frame_navigate_params.h" | 23 #include "content/public/common/frame_navigate_params.h" |
| 24 #include "jni/AppBannerManager_jni.h" | 24 #include "jni/AppBannerManager_jni.h" |
| 25 #include "net/base/url_util.h" | 25 #include "net/base/url_util.h" |
| 26 #include "third_party/skia/include/core/SkBitmap.h" | 26 #include "third_party/skia/include/core/SkBitmap.h" |
| 27 | 27 |
| 28 using base::android::ConvertJavaStringToUTF8; | 28 using base::android::ConvertJavaStringToUTF8; |
| 29 using base::android::ConvertJavaStringToUTF16; | 29 using base::android::ConvertJavaStringToUTF16; |
| 30 using base::android::ConvertUTF8ToJavaString; | 30 using base::android::ConvertUTF8ToJavaString; |
| 31 using base::android::JavaParamRef; | 31 using base::android::JavaParamRef; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 AppBannerManager::RequestAppBanner(validated_url, is_debug_mode); | 121 AppBannerManager::RequestAppBanner(validated_url, is_debug_mode); |
| 122 } | 122 } |
| 123 | 123 |
| 124 std::string AppBannerManagerAndroid::GetAppIdentifier() { | 124 std::string AppBannerManagerAndroid::GetAppIdentifier() { |
| 125 return native_app_data_.is_null() ? AppBannerManager::GetAppIdentifier() | 125 return native_app_data_.is_null() ? AppBannerManager::GetAppIdentifier() |
| 126 : native_app_package_; | 126 : native_app_package_; |
| 127 } | 127 } |
| 128 | 128 |
| 129 std::string AppBannerManagerAndroid::GetBannerType() { | 129 std::string AppBannerManagerAndroid::GetBannerType() { |
| 130 return native_app_data_.is_null() ? AppBannerManager::GetBannerType() | 130 return native_app_data_.is_null() ? AppBannerManager::GetBannerType() |
| 131 : "android"; | 131 : "play"; |
|
pkotwicz1
2016/10/06 15:45:28
Drive by: It is probably worth calling out this ch
dominickn
2016/10/06 22:58:12
This fixes an inconsistency where the AppBannerInf
| |
| 132 } | 132 } |
| 133 | 133 |
| 134 int AppBannerManagerAndroid::GetIdealIconSizeInDp() { | 134 int AppBannerManagerAndroid::GetIdealIconSizeInDp() { |
| 135 return ShortcutHelper::GetIdealHomescreenIconSizeInDp(); | 135 return ShortcutHelper::GetIdealHomescreenIconSizeInDp(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 int AppBannerManagerAndroid::GetMinimumIconSizeInDp() { | 138 int AppBannerManagerAndroid::GetMinimumIconSizeInDp() { |
| 139 return ShortcutHelper::GetMinimumHomescreenIconSizeInDp(); | 139 return ShortcutHelper::GetMinimumHomescreenIconSizeInDp(); |
| 140 } | 140 } |
| 141 | 141 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 } | 315 } |
| 316 | 316 |
| 317 // static | 317 // static |
| 318 void SetTimeDeltaForTesting(JNIEnv* env, | 318 void SetTimeDeltaForTesting(JNIEnv* env, |
| 319 const JavaParamRef<jclass>& clazz, | 319 const JavaParamRef<jclass>& clazz, |
| 320 jint days) { | 320 jint days) { |
| 321 AppBannerManager::SetTimeDeltaForTesting(days); | 321 AppBannerManager::SetTimeDeltaForTesting(days); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace banners | 324 } // namespace banners |
| OLD | NEW |