| 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.compositor.bottombar.contextualsearch; | 5 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.graphics.RectF; | 9 import android.graphics.RectF; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 408 |
| 409 @Override | 409 @Override |
| 410 public void setChromeActivity(ChromeActivity activity) { | 410 public void setChromeActivity(ChromeActivity activity) { |
| 411 super.setChromeActivity(activity); | 411 super.setChromeActivity(activity); |
| 412 | 412 |
| 413 if (mActivity.getBottomSheet() == null) return; | 413 if (mActivity.getBottomSheet() == null) return; |
| 414 | 414 |
| 415 addBarHandle(mActivity.getToolbarManager().getToolbar().getHeight()); | 415 addBarHandle(mActivity.getToolbarManager().getToolbar().getHeight()); |
| 416 } | 416 } |
| 417 | 417 |
| 418 @Override |
| 419 protected boolean doesMatchFullWidthCriteria(float containerWidth) { |
| 420 if (!mOverrideIsFullWidthSizePanelForTesting && mActivity != null |
| 421 && mActivity.getBottomSheet() != null) { |
| 422 return true; |
| 423 } |
| 424 return super.doesMatchFullWidthCriteria(containerWidth); |
| 425 } |
| 426 |
| 418 // =========================================================================
=================== | 427 // =========================================================================
=================== |
| 419 // Animation Handling | 428 // Animation Handling |
| 420 // =========================================================================
=================== | 429 // =========================================================================
=================== |
| 421 | 430 |
| 422 @Override | 431 @Override |
| 423 protected void onAnimationFinished() { | 432 protected void onAnimationFinished() { |
| 424 super.onAnimationFinished(); | 433 super.onAnimationFinished(); |
| 425 | 434 |
| 426 if (mShouldPromoteToTabAfterMaximizing && getPanelState() == PanelState.
MAXIMIZED) { | 435 if (mShouldPromoteToTabAfterMaximizing && getPanelState() == PanelState.
MAXIMIZED) { |
| 427 mShouldPromoteToTabAfterMaximizing = false; | 436 mShouldPromoteToTabAfterMaximizing = false; |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 xPosition = getContentX() + getWidth() - (mEndButtonWidthDp / 2); | 886 xPosition = getContentX() + getWidth() - (mEndButtonWidthDp / 2); |
| 878 } | 887 } |
| 879 | 888 |
| 880 // Determine the y-position for the simulated tap. | 889 // Determine the y-position for the simulated tap. |
| 881 float yPosition = getOffsetY() + (getHeight() / 2); | 890 float yPosition = getOffsetY() + (getHeight() / 2); |
| 882 | 891 |
| 883 // Simulate the tap. | 892 // Simulate the tap. |
| 884 handleClick(System.currentTimeMillis(), xPosition, yPosition); | 893 handleClick(System.currentTimeMillis(), xPosition, yPosition); |
| 885 } | 894 } |
| 886 } | 895 } |
| OLD | NEW |