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

Side by Side Diff: chrome/browser/android/preferences/website_preference_bridge.cc

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « chrome/app/delay_load_hook_win.cc ('k') | chrome/browser/autocomplete/builtin_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/preferences/website_preference_bridge.h" 5 #include "chrome/browser/android/preferences/website_preference_bridge.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // TODO(sashab,lgarron): Find out which settings are being saved with the 68 // TODO(sashab,lgarron): Find out which settings are being saved with the
69 // port and omit it if it's the standard port. 69 // port and omit it if it's the standard port.
70 // TODO(mvanouwerkerk): Remove all this logic and take two passes through 70 // TODO(mvanouwerkerk): Remove all this logic and take two passes through
71 // HostContentSettingsMap: once to get all the 'interesting' hosts, and once 71 // HostContentSettingsMap: once to get all the 'interesting' hosts, and once
72 // (on SingleWebsitePreferences) to find permission patterns which match 72 // (on SingleWebsitePreferences) to find permission patterns which match
73 // each of these hosts. 73 // each of these hosts.
74 const char* kHttpPortSuffix = ":80"; 74 const char* kHttpPortSuffix = ":80";
75 const char* kHttpsPortSuffix = ":443"; 75 const char* kHttpsPortSuffix = ":443";
76 ScopedJavaLocalRef<jstring> jorigin; 76 ScopedJavaLocalRef<jstring> jorigin;
77 if (base::StartsWithASCII(origin, url::kHttpsScheme, false) && 77 if (base::StartsWithASCII(origin, url::kHttpsScheme, false) &&
78 EndsWith(origin, kHttpsPortSuffix, false)) { 78 base::EndsWith(origin, kHttpsPortSuffix, false)) {
79 jorigin = ConvertUTF8ToJavaString( 79 jorigin = ConvertUTF8ToJavaString(
80 env, origin.substr(0, origin.size() - strlen(kHttpsPortSuffix))); 80 env, origin.substr(0, origin.size() - strlen(kHttpsPortSuffix)));
81 } else if (base::StartsWithASCII(origin, url::kHttpScheme, false) && 81 } else if (base::StartsWithASCII(origin, url::kHttpScheme, false) &&
82 EndsWith(origin, kHttpPortSuffix, false)) { 82 base::EndsWith(origin, kHttpPortSuffix, false)) {
83 jorigin = ConvertUTF8ToJavaString( 83 jorigin = ConvertUTF8ToJavaString(
84 env, origin.substr(0, origin.size() - strlen(kHttpPortSuffix))); 84 env, origin.substr(0, origin.size() - strlen(kHttpPortSuffix)));
85 } else { 85 } else {
86 jorigin = ConvertUTF8ToJavaString(env, origin); 86 jorigin = ConvertUTF8ToJavaString(env, origin);
87 } 87 }
88 88
89 ScopedJavaLocalRef<jstring> jembedder; 89 ScopedJavaLocalRef<jstring> jembedder;
90 if (embedder != origin) 90 if (embedder != origin)
91 jembedder = ConvertUTF8ToJavaString(env, embedder); 91 jembedder = ConvertUTF8ToJavaString(env, embedder);
92 switch (content_type) { 92 switch (content_type) {
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 GURL url(ConvertJavaStringToUTF8(env, jorigin)); 701 GURL url(ConvertJavaStringToUTF8(env, jorigin));
702 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( 702 scoped_refptr<SiteDataDeleteHelper> site_data_deleter(
703 new SiteDataDeleteHelper(profile, url)); 703 new SiteDataDeleteHelper(profile, url));
704 site_data_deleter->Run(); 704 site_data_deleter->Run();
705 } 705 }
706 706
707 // Register native methods 707 // Register native methods
708 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { 708 bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
709 return RegisterNativesImpl(env); 709 return RegisterNativesImpl(env);
710 } 710 }
OLDNEW
« no previous file with comments | « chrome/app/delay_load_hook_win.cc ('k') | chrome/browser/autocomplete/builtin_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698