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

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

Issue 1230243005: Move JoinString to the base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 if (accept_languages->find(language_region) == std::string::npos) { 819 if (accept_languages->find(language_region) == std::string::npos) {
820 std::vector<std::string> parts; 820 std::vector<std::string> parts;
821 parts.push_back(language_region); 821 parts.push_back(language_region);
822 // If language is not in the accept languages list, also add language code. 822 // If language is not in the accept languages list, also add language code.
823 if (accept_languages->find(language + ",") == std::string::npos && 823 if (accept_languages->find(language + ",") == std::string::npos &&
824 !std::equal(language.rbegin(), language.rend(), 824 !std::equal(language.rbegin(), language.rend(),
825 accept_languages->rbegin())) { 825 accept_languages->rbegin())) {
826 parts.push_back(language); 826 parts.push_back(language);
827 } 827 }
828 parts.push_back(*accept_languages); 828 parts.push_back(*accept_languages);
829 *accept_languages = JoinString(parts, ','); 829 *accept_languages = base::JoinString(parts, ",");
830 } 830 }
831 } 831 }
832 832
833 // static 833 // static
834 std::string PrefServiceBridge::GetAndroidPermissionForContentSetting( 834 std::string PrefServiceBridge::GetAndroidPermissionForContentSetting(
835 ContentSettingsType content_type) { 835 ContentSettingsType content_type) {
836 JNIEnv* env = AttachCurrentThread(); 836 JNIEnv* env = AttachCurrentThread();
837 base::android::ScopedJavaLocalRef<jstring> android_permission = 837 base::android::ScopedJavaLocalRef<jstring> android_permission =
838 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( 838 Java_PrefServiceBridge_getAndroidPermissionForContentSetting(
839 env, content_type); 839 env, content_type);
840 if (android_permission.is_null()) 840 if (android_permission.is_null())
841 return std::string(); 841 return std::string();
842 842
843 return ConvertJavaStringToUTF8(android_permission); 843 return ConvertJavaStringToUTF8(android_permission);
844 } 844 }
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