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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows 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
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | chrome/browser/chrome_content_browser_client.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/pref_service_bridge.h" 5 #include "chrome/browser/android/preferences/pref_service_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 if (accept_languages->find(language_region) == std::string::npos) { 828 if (accept_languages->find(language_region) == std::string::npos) {
829 std::vector<std::string> parts; 829 std::vector<std::string> parts;
830 parts.push_back(language_region); 830 parts.push_back(language_region);
831 // If language is not in the accept languages list, also add language code. 831 // If language is not in the accept languages list, also add language code.
832 if (accept_languages->find(language + ",") == std::string::npos && 832 if (accept_languages->find(language + ",") == std::string::npos &&
833 !std::equal(language.rbegin(), language.rend(), 833 !std::equal(language.rbegin(), language.rend(),
834 accept_languages->rbegin())) { 834 accept_languages->rbegin())) {
835 parts.push_back(language); 835 parts.push_back(language);
836 } 836 }
837 parts.push_back(*accept_languages); 837 parts.push_back(*accept_languages);
838 *accept_languages = JoinString(parts, ','); 838 *accept_languages = base::JoinString(parts, ",");
839 } 839 }
840 } 840 }
841 841
842 // static 842 // static
843 std::string PrefServiceBridge::GetAndroidPermissionForContentSetting( 843 std::string PrefServiceBridge::GetAndroidPermissionForContentSetting(
844 ContentSettingsType content_type) { 844 ContentSettingsType content_type) {
845 JNIEnv* env = AttachCurrentThread(); 845 JNIEnv* env = AttachCurrentThread();
846 base::android::ScopedJavaLocalRef<jstring> android_permission = 846 base::android::ScopedJavaLocalRef<jstring> android_permission =
847 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( 847 Java_PrefServiceBridge_getAndroidPermissionForContentSetting(
848 env, content_type); 848 env, content_type);
849 if (android_permission.is_null()) 849 if (android_permission.is_null())
850 return std::string(); 850 return std::string();
851 851
852 return ConvertJavaStringToUTF8(android_permission); 852 return ConvertJavaStringToUTF8(android_permission);
853 } 853 }
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698