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.getBottomSheet () != null) { | |
Theresa
2017/04/15 00:24:02
I need to add an mActivity != null check for the t
| |
421 return true; | |
422 } | |
423 return super.doesMatchFullWidthCriteria(containerWidth); | |
424 } | |
425 | |
418 // ========================================================================= =================== | 426 // ========================================================================= =================== |
419 // Animation Handling | 427 // Animation Handling |
420 // ========================================================================= =================== | 428 // ========================================================================= =================== |
421 | 429 |
422 @Override | 430 @Override |
423 protected void onAnimationFinished() { | 431 protected void onAnimationFinished() { |
424 super.onAnimationFinished(); | 432 super.onAnimationFinished(); |
425 | 433 |
426 if (mShouldPromoteToTabAfterMaximizing && getPanelState() == PanelState. MAXIMIZED) { | 434 if (mShouldPromoteToTabAfterMaximizing && getPanelState() == PanelState. MAXIMIZED) { |
427 mShouldPromoteToTabAfterMaximizing = false; | 435 mShouldPromoteToTabAfterMaximizing = false; |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
877 xPosition = getContentX() + getWidth() - (mEndButtonWidthDp / 2); | 885 xPosition = getContentX() + getWidth() - (mEndButtonWidthDp / 2); |
878 } | 886 } |
879 | 887 |
880 // Determine the y-position for the simulated tap. | 888 // Determine the y-position for the simulated tap. |
881 float yPosition = getOffsetY() + (getHeight() / 2); | 889 float yPosition = getOffsetY() + (getHeight() / 2); |
882 | 890 |
883 // Simulate the tap. | 891 // Simulate the tap. |
884 handleClick(System.currentTimeMillis(), xPosition, yPosition); | 892 handleClick(System.currentTimeMillis(), xPosition, yPosition); |
885 } | 893 } |
886 } | 894 } |
OLD | NEW |