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 @SuppressLint("HandlerLeak") |
42 private Handler mHandler = new Handler() { | 44 private Handler mHandler = new Handler() { |
43 @Override | 45 @Override |
44 public void handleMessage(Message msg) { | 46 public void handleMessage(Message msg) { |
45 if (msg == null) return; | 47 if (msg == null) return; |
46 if (msg.what == MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD) { | 48 if (msg.what == MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD) { |
47 enableFullscreenAfterLoad(); | 49 enableFullscreenAfterLoad(); |
48 } | 50 } |
49 } | 51 } |
50 }; | 52 }; |
51 | 53 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); | 164 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); |
163 } | 165 } |
164 | 166 |
165 /** | 167 /** |
166 * Disables the logic that prevents hiding the top controls during page load
for testing. | 168 * Disables the logic that prevents hiding the top controls during page load
for testing. |
167 */ | 169 */ |
168 public static void disablePageLoadDelayForTests() { | 170 public static void disablePageLoadDelayForTests() { |
169 sDisableLoadingCheck = true; | 171 sDisableLoadingCheck = true; |
170 } | 172 } |
171 } | 173 } |
OLD | NEW |