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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java

Issue 460453002: Fixed Compilation issues related to API Level of Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unwanted performClick calls. Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.content.browser.input; 5 package org.chromium.content.browser.input;
6 6
7 import android.annotation.SuppressLint;
7 import android.content.Context; 8 import android.content.Context;
8 import android.graphics.Canvas; 9 import android.graphics.Canvas;
9 import android.graphics.drawable.Drawable; 10 import android.graphics.drawable.Drawable;
10 import android.view.MotionEvent; 11 import android.view.MotionEvent;
11 import android.view.View; 12 import android.view.View;
12 import android.widget.PopupWindow; 13 import android.widget.PopupWindow;
13 14
14 import org.chromium.base.CalledByNative; 15 import org.chromium.base.CalledByNative;
15 import org.chromium.base.JNINamespace; 16 import org.chromium.base.JNINamespace;
16 import org.chromium.content.browser.PositionObserver; 17 import org.chromium.content.browser.PositionObserver;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 mContainer.setClippingEnabled(false); 93 mContainer.setClippingEnabled(false);
93 mAlpha = 1.f; 94 mAlpha = 1.f;
94 mParentPositionListener = new PositionObserver.Listener() { 95 mParentPositionListener = new PositionObserver.Listener() {
95 @Override 96 @Override
96 public void onPositionChanged(int x, int y) { 97 public void onPositionChanged(int x, int y) {
97 updateParentPosition(x, y); 98 updateParentPosition(x, y);
98 } 99 }
99 }; 100 };
100 } 101 }
101 102
103 @SuppressLint("ClickableViewAccessibility")
aurimas (slooooooooow) 2014/08/12 02:47:56 This actually does not fix the bug, just adds a su
AKVT 2014/08/12 03:13:39 Actual issue was performClick is not getting calle
102 @Override 104 @Override
103 public boolean onTouchEvent(MotionEvent event) { 105 public boolean onTouchEvent(MotionEvent event) {
104 final PopupTouchHandleDrawableDelegate delegate = mDelegate.get(); 106 final PopupTouchHandleDrawableDelegate delegate = mDelegate.get();
105 if (delegate == null) { 107 if (delegate == null) {
106 // If the delegate is gone, we should immediately dispose of the pop up. 108 // If the delegate is gone, we should immediately dispose of the pop up.
107 hide(); 109 hide();
108 return false; 110 return false;
109 } 111 }
110 112
111 // Convert from PopupWindow local coordinates to 113 // Convert from PopupWindow local coordinates to
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 private boolean intersectsWith(float x, float y, float width, float height) { 290 private boolean intersectsWith(float x, float y, float width, float height) {
289 if (mDrawable == null) return false; 291 if (mDrawable == null) return false;
290 final int drawableWidth = mDrawable.getIntrinsicWidth(); 292 final int drawableWidth = mDrawable.getIntrinsicWidth();
291 final int drawableHeight = mDrawable.getIntrinsicHeight(); 293 final int drawableHeight = mDrawable.getIntrinsicHeight();
292 return !(x >= mPositionX + drawableWidth 294 return !(x >= mPositionX + drawableWidth
293 || y >= mPositionY + drawableHeight 295 || y >= mPositionY + drawableHeight
294 || x + width <= mPositionX 296 || x + width <= mPositionX
295 || y + height <= mPositionY); 297 || y + height <= mPositionY);
296 } 298 }
297 } 299 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698