| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.infobar; | 5 package org.chromium.chrome.browser.infobar; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.view.Gravity; | 8 import android.view.Gravity; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 /** | 82 /** |
| 83 * Called when the InfobarContainer is attached to the window. | 83 * Called when the InfobarContainer is attached to the window. |
| 84 * @param hasInfobars True if infobar container has infobars to show. | 84 * @param hasInfobars True if infobar container has infobars to show. |
| 85 */ | 85 */ |
| 86 void onInfoBarContainerAttachedToWindow(boolean hasInfobars); | 86 void onInfoBarContainerAttachedToWindow(boolean hasInfobars); |
| 87 } | 87 } |
| 88 | 88 |
| 89 /** Resets the state of the InfoBarContainer when the user navigates. */ | 89 /** Resets the state of the InfoBarContainer when the user navigates. */ |
| 90 private final TabObserver mTabObserver = new EmptyTabObserver() { | 90 private final TabObserver mTabObserver = new EmptyTabObserver() { |
| 91 @Override | 91 @Override |
| 92 public void onDidNavigateMainFrame(Tab tab, String url, String baseUrl, | 92 public void onDidFinishNavigation(Tab tab, String url, boolean isInMainF
rame, |
| 93 boolean isNavigationToDifferentPage, boolean isFragmentNavigatio
n, | 93 boolean isErrorPage, boolean hasCommitted, boolean isSamePage, |
| 94 int statusCode) { | 94 boolean isFragmentNavigation, Integer pageTransition, int errorC
ode, |
| 95 setIsObscuredByOtherView(false); | 95 int httpStatusCode) { |
| 96 if (hasCommitted && isInMainFrame) { |
| 97 setIsObscuredByOtherView(false); |
| 98 } |
| 96 } | 99 } |
| 97 | 100 |
| 98 @Override | 101 @Override |
| 99 public void onContentChanged(Tab tab) { | 102 public void onContentChanged(Tab tab) { |
| 100 mTabView.removeOnAttachStateChangeListener(mAttachedStateListener); | 103 mTabView.removeOnAttachStateChangeListener(mAttachedStateListener); |
| 101 mTabView = tab.getView(); | 104 mTabView = tab.getView(); |
| 102 mTabView.addOnAttachStateChangeListener(mAttachedStateListener); | 105 mTabView.addOnAttachStateChangeListener(mAttachedStateListener); |
| 103 } | 106 } |
| 104 | 107 |
| 105 @Override | 108 @Override |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 391 } |
| 389 | 392 |
| 390 super.onLayout(changed, l, t, r, b); | 393 super.onLayout(changed, l, t, r, b); |
| 391 } | 394 } |
| 392 | 395 |
| 393 private native long nativeInit(); | 396 private native long nativeInit(); |
| 394 private native void nativeSetWebContents( | 397 private native void nativeSetWebContents( |
| 395 long nativeInfoBarContainerAndroid, WebContents webContents); | 398 long nativeInfoBarContainerAndroid, WebContents webContents); |
| 396 private native void nativeDestroy(long nativeInfoBarContainerAndroid); | 399 private native void nativeDestroy(long nativeInfoBarContainerAndroid); |
| 397 } | 400 } |
| OLD | NEW |