OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.infobar; | 5 package org.chromium.chrome.browser.infobar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.support.v7.widget.SwitchCompat; | 8 import android.support.v7.widget.SwitchCompat; |
9 import android.text.Spannable; | 9 import android.text.Spannable; |
10 import android.text.SpannableString; | 10 import android.text.SpannableString; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 private boolean needsNeverPanel() { | 234 private boolean needsNeverPanel() { |
235 return (getInfoBarType() == TranslateInfoBar.BEFORE_TRANSLATE_INFOBAR | 235 return (getInfoBarType() == TranslateInfoBar.BEFORE_TRANSLATE_INFOBAR |
236 && mShouldShowNeverBar); | 236 && mShouldShowNeverBar); |
237 } | 237 } |
238 | 238 |
239 private boolean needsAlwaysPanel() { | 239 private boolean needsAlwaysPanel() { |
240 return (getInfoBarType() == TranslateInfoBar.AFTER_TRANSLATE_INFOBAR | 240 return (getInfoBarType() == TranslateInfoBar.AFTER_TRANSLATE_INFOBAR |
241 && mOptions.alwaysTranslateLanguageState() | 241 && mOptions.alwaysTranslateLanguageState() && !DeviceFormFactor.
isTablet()); |
242 && !DeviceFormFactor.isTablet(getContext())); | |
243 } | 242 } |
244 | 243 |
245 /** | 244 /** |
246 * @param newPanel id of the new panel to swap in. Use NO_PANEL to | 245 * @param newPanel id of the new panel to swap in. Use NO_PANEL to |
247 * simply remove the current panel. | 246 * simply remove the current panel. |
248 */ | 247 */ |
249 private void swapPanel(int newPanel) { | 248 private void swapPanel(int newPanel) { |
250 assert (newPanel >= NO_PANEL && newPanel < MAX_PANEL_INDEX); | 249 assert (newPanel >= NO_PANEL && newPanel < MAX_PANEL_INDEX); |
251 mOptionsPanelViewType = newPanel; | 250 mOptionsPanelViewType = newPanel; |
252 replaceView(createView()); | 251 replaceView(createView()); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 replaceView(createView()); | 333 replaceView(createView()); |
335 } else { | 334 } else { |
336 assert false : "Trying to change the InfoBar to a type that is inval
id."; | 335 assert false : "Trying to change the InfoBar to a type that is inval
id."; |
337 } | 336 } |
338 } | 337 } |
339 | 338 |
340 private native void nativeApplyTranslateOptions(long nativeTranslateInfoBar, | 339 private native void nativeApplyTranslateOptions(long nativeTranslateInfoBar, |
341 String sourceLanguageCode, String targetLanguageCode, boolean always
Translate, | 340 String sourceLanguageCode, String targetLanguageCode, boolean always
Translate, |
342 boolean neverTranslateLanguage, boolean neverTranslateSite); | 341 boolean neverTranslateLanguage, boolean neverTranslateSite); |
343 } | 342 } |
OLD | NEW |