OLD | NEW |
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 package org.chromium.chrome.browser.preferences.website; | 5 package org.chromium.chrome.browser.preferences.website; |
6 | 6 |
7 import android.os.Build; | 7 import android.os.Build; |
8 import android.os.Bundle; | 8 import android.os.Bundle; |
9 import android.preference.Preference; | 9 import android.preference.Preference; |
10 import android.preference.Preference.OnPreferenceClickListener; | 10 import android.preference.Preference.OnPreferenceClickListener; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static final String MEDIA_KEY = "media"; | 43 static final String MEDIA_KEY = "media"; |
44 static final String MICROPHONE_KEY = "microphone"; | 44 static final String MICROPHONE_KEY = "microphone"; |
45 static final String NOTIFICATIONS_KEY = "notifications"; | 45 static final String NOTIFICATIONS_KEY = "notifications"; |
46 static final String POPUPS_KEY = "popups"; | 46 static final String POPUPS_KEY = "popups"; |
47 static final String PROTECTED_CONTENT_KEY = "protected_content"; | 47 static final String PROTECTED_CONTENT_KEY = "protected_content"; |
48 static final String STORAGE_KEY = "use_storage"; | 48 static final String STORAGE_KEY = "use_storage"; |
49 static final String TRANSLATE_KEY = "translate"; | 49 static final String TRANSLATE_KEY = "translate"; |
50 static final String USB_KEY = "usb"; | 50 static final String USB_KEY = "usb"; |
51 | 51 |
52 // Whether the Protected Content menu is available for display. | 52 // Whether the Protected Content menu is available for display. |
53 boolean mProtectedContentMenuAvailable = false; | 53 boolean mProtectedContentMenuAvailable; |
54 | 54 |
55 // Whether this class is handling showing the Media sub-menu (and not the ma
in menu). | 55 // Whether this class is handling showing the Media sub-menu (and not the ma
in menu). |
56 boolean mMediaSubMenu = false; | 56 boolean mMediaSubMenu; |
57 | 57 |
58 @Override | 58 @Override |
59 public void onCreate(Bundle savedInstanceState) { | 59 public void onCreate(Bundle savedInstanceState) { |
60 super.onCreate(savedInstanceState); | 60 super.onCreate(savedInstanceState); |
61 addPreferencesFromResource(R.xml.site_settings_preferences); | 61 addPreferencesFromResource(R.xml.site_settings_preferences); |
62 getActivity().setTitle(R.string.prefs_site_settings); | 62 getActivity().setTitle(R.string.prefs_site_settings); |
63 | 63 |
64 mProtectedContentMenuAvailable = Build.VERSION.SDK_INT >= Build.VERSION_
CODES.KITKAT; | 64 mProtectedContentMenuAvailable = Build.VERSION.SDK_INT >= Build.VERSION_
CODES.KITKAT; |
65 | 65 |
66 String category = ""; | 66 String category = ""; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 return false; | 241 return false; |
242 } | 242 } |
243 | 243 |
244 private void setTranslateStateSummary(Preference translatePref) { | 244 private void setTranslateStateSummary(Preference translatePref) { |
245 boolean translateEnabled = PrefServiceBridge.getInstance().isTranslateEn
abled(); | 245 boolean translateEnabled = PrefServiceBridge.getInstance().isTranslateEn
abled(); |
246 translatePref.setSummary(translateEnabled | 246 translatePref.setSummary(translateEnabled |
247 ? R.string.website_settings_category_ask | 247 ? R.string.website_settings_category_ask |
248 : R.string.website_settings_category_blocked); | 248 : R.string.website_settings_category_blocked); |
249 } | 249 } |
250 } | 250 } |
OLD | NEW |