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

Unified Diff: chrome/browser/ui/android/infobars/app_banner_infobar.cc

Issue 898183002: Trim the URL in the AppBannerInfoBar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bah rebasing Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/app_banner_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/app_banner_infobar.cc b/chrome/browser/ui/android/infobars/app_banner_infobar.cc
index 9e6aeac50f98667da4d3919c68951c2479f4b76e..838b85e1d8e219f7f83502174b52299ba2b0ef50 100644
--- a/chrome/browser/ui/android/infobars/app_banner_infobar.cc
+++ b/chrome/browser/ui/android/infobars/app_banner_infobar.cc
@@ -9,6 +9,7 @@
#include "base/android/scoped_java_ref.h"
#include "chrome/browser/android/banners/app_banner_infobar_delegate.h"
#include "jni/AppBannerInfoBar_jni.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/image/image.h"
@@ -37,8 +38,15 @@ AppBannerInfoBar::CreateRenderInfoBar(JNIEnv* env) {
}
base::android::ScopedJavaLocalRef<jobject> infobar;
+
+ // Trim down the app URL to the domain and registry.
+ std::string trimmed_url =
+ net::registry_controlled_domains::GetDomainAndRegistry(
+ app_url_,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+
base::android::ScopedJavaLocalRef<jstring> app_url =
- base::android::ConvertUTF8ToJavaString(env, app_url_.spec());
+ base::android::ConvertUTF8ToJavaString(env, trimmed_url);
infobar.Reset(Java_AppBannerInfoBar_createWebAppInfoBar(
env,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698