summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/resources/history/history.js16
-rw-r--r--chrome/browser/resources/history/history_mobile.css22
2 files changed, 20 insertions, 18 deletions
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 4c7566a..15884ee 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -1569,6 +1569,22 @@ function load() {
});
searchField.focus();
}
+
+<if expr="is_ios">
+ function checkKeyboardVisibility() {
+ // Figure out the real height based on the orientation, becauase
+ // screen.width and screen.height don't update after rotation.
+ var screenHeight = window.orientation % 180 ? screen.width : screen.height;
+
+ // Assume that the keyboard is visible if more than 30% of the screen is
+ // taken up by window chrome.
+ var isKeyboardVisible = (window.innerHeight / screenHeight) < 0.7;
+
+ document.body.classList.toggle('ios-keyboard-visible', isKeyboardVisible);
+ }
+ window.addEventListener('orientationchange', checkKeyboardVisibility);
+ window.addEventListener('resize', checkKeyboardVisibility);
+</if> /* is_ios */
}
/**
diff --git a/chrome/browser/resources/history/history_mobile.css b/chrome/browser/resources/history/history_mobile.css
index 79335f8..df6d6e1 100644
--- a/chrome/browser/resources/history/history_mobile.css
+++ b/chrome/browser/resources/history/history_mobile.css
@@ -307,25 +307,11 @@ input {
} /* @media only screen and (max-width:720px) */
<if expr="is_ios">
-/* Ensure that the Clear Browsing Data button is hidden when the keyboard is
- visible. The cutoff values are chosen to be compatible with all known device
- aspect ratios. */
-
-@media only screen and (min-aspect-ratio: 6/5) and (max-aspect-ratio: 3/2) {
- #clear-browsing-data {
- display: none;
- }
- #scrolling-container {
- bottom: 0;
- }
+.ios-keyboard-visible #clear-browsing-data {
+ display: none;
}
-@media only screen and (min-aspect-ratio: 3/1) {
- #clear-browsing-data {
- display: none;
- }
- #scrolling-container {
- bottom: 0;
- }
+.ios-keyboard-visible #scrolling-container {
+ bottom: 0;
}
</if> /* is_ios */