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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java

Issue 2098683002: Refactor OverlayPanel height calculations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 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
OLDNEW
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.dom_distiller; 5 package org.chromium.chrome.browser.dom_distiller;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.text.TextUtils; 8 import android.text.TextUtils;
9 9
10 import org.chromium.base.CommandLine; 10 import org.chromium.base.CommandLine;
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 mReaderModePanel.closePanel(reason, animate); 396 mReaderModePanel.closePanel(reason, animate);
397 } 397 }
398 398
399 @Override 399 @Override
400 public void recordTimeSpentInReader(long timeMs) { 400 public void recordTimeSpentInReader(long timeMs) {
401 RecordHistogram.recordLongTimesHistogram("DomDistiller.Time.ViewingReade rModePanel", 401 RecordHistogram.recordLongTimesHistogram("DomDistiller.Time.ViewingReade rModePanel",
402 timeMs, TimeUnit.MILLISECONDS); 402 timeMs, TimeUnit.MILLISECONDS);
403 } 403 }
404 404
405 @Override 405 @Override
406 public void onSizeChanged() { 406 public void onLayoutChanged() {
407 if (isKeyboardShowing()) { 407 if (isKeyboardShowing()) {
408 mIsKeyboardShowing = true; 408 mIsKeyboardShowing = true;
409 closeReaderPanel(StateChangeReason.KEYBOARD_SHOWN, false); 409 closeReaderPanel(StateChangeReason.KEYBOARD_SHOWN, false);
410 } else if (mIsKeyboardShowing) { 410 } else if (mIsKeyboardShowing) {
411 mIsKeyboardShowing = false; 411 mIsKeyboardShowing = false;
412 requestReaderPanelShow(StateChangeReason.KEYBOARD_HIDDEN); 412 requestReaderPanelShow(StateChangeReason.KEYBOARD_HIDDEN);
413 } 413 }
414 } 414 }
415 415
416 /** 416 /**
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 621
622 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA BLE_DOM_DISTILLER) 622 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA BLE_DOM_DISTILLER)
623 && !CommandLine.getInstance().hasSwitch( 623 && !CommandLine.getInstance().hasSwitch(
624 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) 624 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR)
625 && !DeviceFormFactor.isTablet(context) 625 && !DeviceFormFactor.isTablet(context)
626 && DomDistillerTabUtils.isDistillerHeuristicsEnabled() 626 && DomDistillerTabUtils.isDistillerHeuristicsEnabled()
627 && !SysUtils.isLowEndDevice(); 627 && !SysUtils.isLowEndDevice();
628 return enabled; 628 return enabled;
629 } 629 }
630 } 630 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698