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

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

Issue 1406743002: Switch cases that returns same value should use fall through. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 2 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 | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); 63 return ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
64 } 64 }
65 65
66 bool GetBooleanForContentSetting(ContentSettingsType type) { 66 bool GetBooleanForContentSetting(ContentSettingsType type) {
67 HostContentSettingsMap* content_settings = 67 HostContentSettingsMap* content_settings =
68 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); 68 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
69 switch (content_settings->GetDefaultContentSetting(type, NULL)) { 69 switch (content_settings->GetDefaultContentSetting(type, NULL)) {
70 case CONTENT_SETTING_BLOCK: 70 case CONTENT_SETTING_BLOCK:
71 return false; 71 return false;
72 case CONTENT_SETTING_ALLOW: 72 case CONTENT_SETTING_ALLOW:
73 return true;
74 case CONTENT_SETTING_ASK: 73 case CONTENT_SETTING_ASK:
75 default: 74 default:
76 return true; 75 return true;
77 } 76 }
78 } 77 }
79 78
80 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { 79 bool IsContentSettingManaged(ContentSettingsType content_settings_type) {
81 std::string source; 80 std::string source;
82 HostContentSettingsMap* content_settings = 81 HostContentSettingsMap* content_settings =
83 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); 82 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 ContentSettingsType content_type) { 941 ContentSettingsType content_type) {
943 JNIEnv* env = AttachCurrentThread(); 942 JNIEnv* env = AttachCurrentThread();
944 base::android::ScopedJavaLocalRef<jstring> android_permission = 943 base::android::ScopedJavaLocalRef<jstring> android_permission =
945 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( 944 Java_PrefServiceBridge_getAndroidPermissionForContentSetting(
946 env, content_type); 945 env, content_type);
947 if (android_permission.is_null()) 946 if (android_permission.is_null())
948 return std::string(); 947 return std::string();
949 948
950 return ConvertJavaStringToUTF8(android_permission); 949 return ConvertJavaStringToUTF8(android_permission);
951 } 950 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698