Chromium Code Reviews| 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.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 import android.widget.TextView; | 10 import android.widget.TextView; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 154 |
| 155 /** | 155 /** |
| 156 * @return whether the infobar actually needed closing. | 156 * @return whether the infobar actually needed closing. |
| 157 */ | 157 */ |
| 158 @CalledByNative | 158 @CalledByNative |
| 159 private boolean closeInfoBar() { | 159 private boolean closeInfoBar() { |
| 160 if (!mIsDismissed) { | 160 if (!mIsDismissed) { |
| 161 mIsDismissed = true; | 161 mIsDismissed = true; |
| 162 if (!mContainer.hasBeenDestroyed()) { | 162 if (!mContainer.hasBeenDestroyed()) { |
| 163 // If the container was destroyed, it's already been emptied of all its infobars. | 163 // If the container was destroyed, it's already been emptied of all its infobars. |
| 164 onStartedRemoving(); | |
|
mdjones
2017/05/11 17:08:24
I'd prefer this be named "onStartedHiding" despite
Marti Wong
2017/05/12 00:04:50
Done.
| |
| 164 mContainer.removeInfoBar(this); | 165 mContainer.removeInfoBar(this); |
| 165 } | 166 } |
| 166 return true; | 167 return true; |
| 167 } | 168 } |
| 168 return false; | 169 return false; |
| 169 } | 170 } |
| 170 | 171 |
| 172 /** | |
| 173 * Called when infobar is being removed. Give the chance to clean up any ch ild UI that may | |
|
mdjones
2017/05/11 17:08:24
"Called just before the Java infobar has begun hid
Marti Wong
2017/05/12 00:04:50
Done.
| |
| 174 * remain open. | |
| 175 */ | |
| 176 protected void onStartedRemoving() {} | |
| 177 | |
| 178 /** | |
| 179 * Performs some action related to either the primary or secondary button be ing pressed. | |
| 180 * @param isPrimaryButton True if the primary button was clicked, false othe rwise. | |
| 181 */ | |
|
mdjones
2017/05/11 17:08:24
Remove this floating javadoc.
Marti Wong
2017/05/12 00:04:50
Done. sorry for the carelessness.
| |
| 182 | |
| 171 long getNativeInfoBarPtr() { | 183 long getNativeInfoBarPtr() { |
| 172 return mNativeInfoBarPtr; | 184 return mNativeInfoBarPtr; |
| 173 } | 185 } |
| 174 | 186 |
| 175 void setInfoBarContainer(InfoBarContainer container) { | 187 void setInfoBarContainer(InfoBarContainer container) { |
| 176 mContainer = container; | 188 mContainer = container; |
| 177 } | 189 } |
| 178 | 190 |
| 179 @Override | 191 @Override |
| 180 public boolean areControlsEnabled() { | 192 public boolean areControlsEnabled() { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 211 @Override | 223 @Override |
| 212 public void createContent(InfoBarLayout layout) { | 224 public void createContent(InfoBarLayout layout) { |
| 213 } | 225 } |
| 214 | 226 |
| 215 @InfoBarIdentifier | 227 @InfoBarIdentifier |
| 216 private native int nativeGetInfoBarIdentifier(long nativeInfoBarAndroid); | 228 private native int nativeGetInfoBarIdentifier(long nativeInfoBarAndroid); |
| 217 private native void nativeOnLinkClicked(long nativeInfoBarAndroid); | 229 private native void nativeOnLinkClicked(long nativeInfoBarAndroid); |
| 218 private native void nativeOnButtonClicked(long nativeInfoBarAndroid, int act ion); | 230 private native void nativeOnButtonClicked(long nativeInfoBarAndroid, int act ion); |
| 219 private native void nativeOnCloseButtonClicked(long nativeInfoBarAndroid); | 231 private native void nativeOnCloseButtonClicked(long nativeInfoBarAndroid); |
| 220 } | 232 } |
| OLD | NEW |