Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java

Issue 2952553002: Dismiss menu when infobar's host tab is hidden. (new translate infobar) (Closed)
Patch Set: use container#removeFromParentView Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 */ 254 */
255 @VisibleForTesting 255 @VisibleForTesting
256 public boolean isAnimating() { 256 public boolean isAnimating() {
257 return mLayout.isAnimating(); 257 return mLayout.isAnimating();
258 } 258 }
259 259
260 private void addToParentView() { 260 private void addToParentView() {
261 super.addToParentView(mParentView); 261 super.addToParentView(mParentView);
262 } 262 }
263 263
264 @Override
265 public boolean removeFromParentView() {
266 if (hasInfoBars()) {
267 mInfoBars.get(0).onInfoBarContainerStartedHiding();
mdjones 2017/06/22 19:00:16 Why only index 0?
Marti Wong 2017/06/23 01:39:10 (0) means the top of the infobar stack. only the t
268 }
269 return super.removeFromParentView();
270 }
271
264 /** 272 /**
265 * Adds an InfoBar to the view hierarchy. 273 * Adds an InfoBar to the view hierarchy.
266 * @param infoBar InfoBar to add to the View hierarchy. 274 * @param infoBar InfoBar to add to the View hierarchy.
267 */ 275 */
268 @CalledByNative 276 @CalledByNative
269 private void addInfoBar(InfoBar infoBar) { 277 private void addInfoBar(InfoBar infoBar) {
270 assert !mDestroyed; 278 assert !mDestroyed;
271 if (infoBar == null) { 279 if (infoBar == null) {
272 return; 280 return;
273 } 281 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 452 }
445 453
446 super.onLayout(changed, l, t, r, b); 454 super.onLayout(changed, l, t, r, b);
447 } 455 }
448 456
449 private native long nativeInit(); 457 private native long nativeInit();
450 private native void nativeSetWebContents( 458 private native void nativeSetWebContents(
451 long nativeInfoBarContainerAndroid, WebContents webContents); 459 long nativeInfoBarContainerAndroid, WebContents webContents);
452 private native void nativeDestroy(long nativeInfoBarContainerAndroid); 460 private native void nativeDestroy(long nativeInfoBarContainerAndroid);
453 } 461 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698