| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
| 6 | 6 |
| 7 import android.animation.Animator; | 7 import android.animation.Animator; |
| 8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
| 9 import android.animation.AnimatorSet; | 9 import android.animation.AnimatorSet; |
| 10 import android.annotation.SuppressLint; | 10 import android.annotation.SuppressLint; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Ensure the the popup is not shown after resuming activity from backgr
ound. | 255 // Ensure the the popup is not shown after resuming activity from backgr
ound. |
| 256 if (hasWindowFocus && mNavigationPopup != null) { | 256 if (hasWindowFocus && mNavigationPopup != null) { |
| 257 mNavigationPopup.dismiss(); | 257 mNavigationPopup.dismiss(); |
| 258 mNavigationPopup = null; | 258 mNavigationPopup = null; |
| 259 } | 259 } |
| 260 super.onWindowFocusChanged(hasWindowFocus); | 260 super.onWindowFocusChanged(hasWindowFocus); |
| 261 } | 261 } |
| 262 | 262 |
| 263 private void displayNavigationPopup(boolean isForward, View anchorView) { | 263 private void displayNavigationPopup(boolean isForward, View anchorView) { |
| 264 Tab tab = getToolbarDataProvider().getTab(); | 264 Tab tab = getToolbarDataProvider().getTab(); |
| 265 if (tab == null || tab.getWebContents() == null) return; | 265 if (tab == null || tab.getNavigationHandler() == null) return; |
| 266 mNavigationPopup = new NavigationPopup(tab.getProfile(), getContext(), | 266 mNavigationPopup = new NavigationPopup( |
| 267 tab.getWebContents().getNavigationController(), isForward); | 267 tab.getProfile(), getContext(), tab.getNavigationHandler(), isFo
rward); |
| 268 | 268 |
| 269 mNavigationPopup.setAnchorView(anchorView); | 269 mNavigationPopup.setAnchorView(anchorView); |
| 270 | 270 |
| 271 int menuWidth = getResources().getDimensionPixelSize(R.dimen.menu_width)
; | 271 int menuWidth = getResources().getDimensionPixelSize(R.dimen.menu_width)
; |
| 272 mNavigationPopup.setWidth(menuWidth); | 272 mNavigationPopup.setWidth(menuWidth); |
| 273 | 273 |
| 274 if (mNavigationPopup.shouldBeShown()) mNavigationPopup.show(); | 274 if (mNavigationPopup.shouldBeShown()) mNavigationPopup.show(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 @Override | 277 @Override |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 589 } |
| 590 | 590 |
| 591 mButtonVisibilityAnimators = null; | 591 mButtonVisibilityAnimators = null; |
| 592 } | 592 } |
| 593 }); | 593 }); |
| 594 | 594 |
| 595 return set; | 595 return set; |
| 596 } | 596 } |
| 597 | 597 |
| 598 } | 598 } |
| OLD | NEW |