Chromium Code Reviews| 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.tab; | 5 package org.chromium.chrome.browser.tab; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | |
| 7 import android.os.Handler; | 8 import android.os.Handler; |
| 8 import android.os.Message; | 9 import android.os.Message; |
| 9 | 10 |
| 10 import org.chromium.chrome.browser.UrlConstants; | 11 import org.chromium.chrome.browser.UrlConstants; |
| 11 import org.chromium.chrome.browser.device.DeviceClassManager; | 12 import org.chromium.chrome.browser.device.DeviceClassManager; |
| 12 import org.chromium.chrome.browser.util.AccessibilityUtil; | 13 import org.chromium.chrome.browser.util.AccessibilityUtil; |
| 13 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; | 14 import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; |
| 14 import org.chromium.components.security_state.ConnectionSecurityLevel; | 15 import org.chromium.components.security_state.ConnectionSecurityLevel; |
| 15 import org.chromium.content.browser.ContentViewCore; | 16 import org.chromium.content.browser.ContentViewCore; |
| 16 import org.chromium.content_public.browser.WebContents; | 17 import org.chromium.content_public.browser.WebContents; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 32 private boolean mIsFullscreenWaitingForLoad; | 33 private boolean mIsFullscreenWaitingForLoad; |
| 33 | 34 |
| 34 /** | 35 /** |
| 35 * Basic constructor. | 36 * Basic constructor. |
| 36 * @param tab The associated {@link Tab}. | 37 * @param tab The associated {@link Tab}. |
| 37 */ | 38 */ |
| 38 public TabStateBrowserControlsVisibilityDelegate(Tab tab) { | 39 public TabStateBrowserControlsVisibilityDelegate(Tab tab) { |
| 39 mTab = tab; | 40 mTab = tab; |
| 40 | 41 |
| 41 mTab.addObserver(new EmptyTabObserver() { | 42 mTab.addObserver(new EmptyTabObserver() { |
| 43 // TODO(crbug.com/635567): Fix this properly. | |
|
Ted C
2017/04/27 19:02:47
No fix needed, mHandler.removeCallbacksAndMessages
F
2017/04/28 18:25:15
Done.
| |
| 44 @SuppressLint("HandlerLeak") | |
| 42 private Handler mHandler = new Handler() { | 45 private Handler mHandler = new Handler() { |
| 43 @Override | 46 @Override |
| 44 public void handleMessage(Message msg) { | 47 public void handleMessage(Message msg) { |
| 45 if (msg == null) return; | 48 if (msg == null) return; |
| 46 if (msg.what == MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD) { | 49 if (msg.what == MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD) { |
| 47 enableFullscreenAfterLoad(); | 50 enableFullscreenAfterLoad(); |
| 48 } | 51 } |
| 49 } | 52 } |
| 50 }; | 53 }; |
| 51 | 54 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); | 165 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); |
| 163 } | 166 } |
| 164 | 167 |
| 165 /** | 168 /** |
| 166 * Disables the logic that prevents hiding the top controls during page load for testing. | 169 * Disables the logic that prevents hiding the top controls during page load for testing. |
| 167 */ | 170 */ |
| 168 public static void disablePageLoadDelayForTests() { | 171 public static void disablePageLoadDelayForTests() { |
| 169 sDisableLoadingCheck = true; | 172 sDisableLoadingCheck = true; |
| 170 } | 173 } |
| 171 } | 174 } |
| OLD | NEW |