Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.app.Application; | 8 import android.app.Application; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| 11 import android.content.res.Resources; | 11 import android.content.res.Resources; |
| 12 import android.graphics.Bitmap; | 12 import android.graphics.Bitmap; |
| 13 import android.graphics.Color; | 13 import android.graphics.Color; |
| 14 import android.graphics.Rect; | 14 import android.graphics.Rect; |
| 15 import android.net.Uri; | 15 import android.net.Uri; |
| 16 import android.os.Bundle; | 16 import android.os.Bundle; |
| 17 import android.os.Handler; | 17 import android.os.Handler; |
| 18 import android.os.Message; | 18 import android.os.Message; |
| 19 import android.provider.Browser; | 19 import android.provider.Browser; |
| 20 import android.text.TextUtils; | 20 import android.text.TextUtils; |
| 21 import android.util.Log; | 21 import android.util.Log; |
| 22 import android.view.ContextThemeWrapper; | 22 import android.view.ContextThemeWrapper; |
| 23 import android.view.View; | 23 import android.view.View; |
| 24 import android.view.View.OnClickListener; | 24 import android.view.View.OnClickListener; |
| 25 import android.view.ViewGroup; | 25 import android.view.ViewGroup; |
| 26 import android.view.ViewGroup.LayoutParams; | |
| 27 import android.view.accessibility.AccessibilityEvent; | 26 import android.view.accessibility.AccessibilityEvent; |
| 28 import android.widget.FrameLayout; | 27 import android.widget.FrameLayout; |
| 28 import android.widget.FrameLayout.LayoutParams; | |
| 29 | 29 |
| 30 import org.chromium.base.ApiCompatibilityUtils; | 30 import org.chromium.base.ApiCompatibilityUtils; |
| 31 import org.chromium.base.ApplicationStatus; | 31 import org.chromium.base.ApplicationStatus; |
| 32 import org.chromium.base.ContextUtils; | 32 import org.chromium.base.ContextUtils; |
| 33 import org.chromium.base.ObserverList; | 33 import org.chromium.base.ObserverList; |
| 34 import org.chromium.base.ObserverList.RewindableIterator; | 34 import org.chromium.base.ObserverList.RewindableIterator; |
| 35 import org.chromium.base.ThreadUtils; | 35 import org.chromium.base.ThreadUtils; |
| 36 import org.chromium.base.TraceEvent; | 36 import org.chromium.base.TraceEvent; |
| 37 import org.chromium.base.VisibleForTesting; | 37 import org.chromium.base.VisibleForTesting; |
| 38 import org.chromium.base.annotations.CalledByNative; | 38 import org.chromium.base.annotations.CalledByNative; |
| (...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2869 if (Float.isNaN(mPreviousFullscreenTopControlsOffsetY) | 2869 if (Float.isNaN(mPreviousFullscreenTopControlsOffsetY) |
| 2870 || Float.isNaN(mPreviousFullscreenContentOffsetY)) { | 2870 || Float.isNaN(mPreviousFullscreenContentOffsetY)) { |
| 2871 mFullscreenManager.setPositionsForTabToNonFullscreen(); | 2871 mFullscreenManager.setPositionsForTabToNonFullscreen(); |
| 2872 } else { | 2872 } else { |
| 2873 mFullscreenManager.setPositionsForTab( | 2873 mFullscreenManager.setPositionsForTab( |
| 2874 mPreviousFullscreenTopControlsOffsetY, mPreviousFullscre enContentOffsetY); | 2874 mPreviousFullscreenTopControlsOffsetY, mPreviousFullscre enContentOffsetY); |
| 2875 } | 2875 } |
| 2876 mFullscreenManager.showControlsTransient(); | 2876 mFullscreenManager.showControlsTransient(); |
| 2877 updateFullscreenEnabledState(); | 2877 updateFullscreenEnabledState(); |
| 2878 } | 2878 } |
| 2879 | |
| 2880 // For blimp, set a top margin equal to the top controls height. | |
| 2881 if (getBlimpContents() != null && mFullscreenManager != null) { | |
|
Khushal
2016/09/08 00:59:59
Can you also do this when we create the BlimpConte
shaktisahu
2016/09/08 02:19:00
The BlimpContents is created inside the Tab.initia
| |
| 2882 ViewGroup blimpView = getBlimpContents().getView(); | |
| 2883 FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) blimpView.g etLayoutParams(); | |
| 2884 if (lp == null) { | |
| 2885 lp = new FrameLayout.LayoutParams( | |
| 2886 LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | |
| 2887 } | |
| 2888 | |
| 2889 lp.topMargin = mFullscreenManager.getTopControlsHeight(); | |
| 2890 blimpView.setLayoutParams(lp); | |
| 2891 } | |
| 2879 } | 2892 } |
| 2880 | 2893 |
| 2881 /** | 2894 /** |
| 2882 * Add a new navigation entry for the current URL and page title. | 2895 * Add a new navigation entry for the current URL and page title. |
| 2883 */ | 2896 */ |
| 2884 void pushNativePageStateToNavigationEntry() { | 2897 void pushNativePageStateToNavigationEntry() { |
| 2885 assert mNativeTabAndroid != 0 && getNativePage() != null; | 2898 assert mNativeTabAndroid != 0 && getNativePage() != null; |
| 2886 nativeSetActiveNavigationEntryTitleForUrl(mNativeTabAndroid, getNativePa ge().getUrl(), | 2899 nativeSetActiveNavigationEntryTitleForUrl(mNativeTabAndroid, getNativePa ge().getUrl(), |
| 2887 getNativePage().getTitle()); | 2900 getNativePage().getTitle()); |
| 2888 } | 2901 } |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3322 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, | 3335 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, |
| 3323 InterceptNavigationDelegate delegate); | 3336 InterceptNavigationDelegate delegate); |
| 3324 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 3337 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
| 3325 TabContentManager tabContentManager); | 3338 TabContentManager tabContentManager); |
| 3326 private native void nativeAttachOverlayWebContents( | 3339 private native void nativeAttachOverlayWebContents( |
| 3327 long nativeTabAndroid, WebContents webContents, boolean visible); | 3340 long nativeTabAndroid, WebContents webContents, boolean visible); |
| 3328 private native void nativeDetachOverlayWebContents( | 3341 private native void nativeDetachOverlayWebContents( |
| 3329 long nativeTabAndroid, WebContents webContents); | 3342 long nativeTabAndroid, WebContents webContents); |
| 3330 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); | 3343 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); |
| 3331 } | 3344 } |
| OLD | NEW |