| 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.View; | 8 import android.view.View; |
| 9 | 9 |
| 10 import com.google.common.annotations.VisibleForTesting; | |
| 11 | |
| 12 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
| 11 import org.chromium.base.VisibleForTesting; |
| 13 import org.chromium.chrome.R; | 12 import org.chromium.chrome.R; |
| 14 | 13 |
| 15 /** | 14 /** |
| 16 * The base class for all InfoBar classes. | 15 * The base class for all InfoBar classes. |
| 17 * Note that infobars expire by default when a new navigation occurs. | 16 * Note that infobars expire by default when a new navigation occurs. |
| 18 * Make sure to use setExpireOnNavigation(false) if you want an infobar to be st
icky. | 17 * Make sure to use setExpireOnNavigation(false) if you want an infobar to be st
icky. |
| 19 */ | 18 */ |
| 20 public abstract class InfoBar implements InfoBarView { | 19 public abstract class InfoBar implements InfoBarView { |
| 21 private static final String TAG = "InfoBar"; | 20 private static final String TAG = "InfoBar"; |
| 22 | 21 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return mContentView; | 191 return mContentView; |
| 193 } | 192 } |
| 194 | 193 |
| 195 protected InfoBarContainer getInfoBarContainer() { | 194 protected InfoBarContainer getInfoBarContainer() { |
| 196 return mContainer; | 195 return mContainer; |
| 197 } | 196 } |
| 198 | 197 |
| 199 /** | 198 /** |
| 200 * @return The content view for the info bar. | 199 * @return The content view for the info bar. |
| 201 */ | 200 */ |
| 201 @VisibleForTesting |
| 202 public ContentWrapperView getContentWrapper() { | 202 public ContentWrapperView getContentWrapper() { |
| 203 return getContentWrapper(true); | 203 return getContentWrapper(true); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void setInfoBarContainer(InfoBarContainer container) { | 206 void setInfoBarContainer(InfoBarContainer container) { |
| 207 mContainer = container; | 207 mContainer = container; |
| 208 } | 208 } |
| 209 | 209 |
| 210 public boolean areControlsEnabled() { | 210 public boolean areControlsEnabled() { |
| 211 return mControlsEnabled; | 211 return mControlsEnabled; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 @VisibleForTesting | 258 @VisibleForTesting |
| 259 public void setDismissedListener(InfoBarListeners.Dismiss listener) { | 259 public void setDismissedListener(InfoBarListeners.Dismiss listener) { |
| 260 mListener = listener; | 260 mListener = listener; |
| 261 } | 261 } |
| 262 | 262 |
| 263 protected native void nativeOnLinkClicked(long nativeInfoBarAndroid); | 263 protected native void nativeOnLinkClicked(long nativeInfoBarAndroid); |
| 264 protected native void nativeOnButtonClicked( | 264 protected native void nativeOnButtonClicked( |
| 265 long nativeInfoBarAndroid, int action, String actionValue); | 265 long nativeInfoBarAndroid, int action, String actionValue); |
| 266 protected native void nativeOnCloseButtonClicked(long nativeInfoBarAndroid); | 266 protected native void nativeOnCloseButtonClicked(long nativeInfoBarAndroid); |
| 267 } | 267 } |
| OLD | NEW |