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

Unified Diff: ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java

Issue 2752693003: chrome/android: Update toolbar drawing in native. (Closed)
Patch Set: fix math for tablets Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
diff --git a/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java b/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
index 98816856e277c24629ebc0f3c0b003720e052e00..15fd2e65ac435fe249580f2b0cccf01304c3b1d1 100644
--- a/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
+++ b/ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java
@@ -23,8 +23,6 @@ import org.chromium.ui.resources.ResourceManager;
public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListener {
private final View mView;
private final Rect mDirtyRect = new Rect();
- private final Rect mContentPadding = new Rect();
- private final Rect mContentAperture = new Rect();
private Bitmap mBitmap;
private Rect mBitmapSize = new Rect();
@@ -73,13 +71,12 @@ public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListe
return mBitmapSize;
}
+ /**
+ * Override this method to create the native resource type for the generated bitmap.
+ */
@Override
public long createNativeResource() {
- // TODO(khushalsagar): Fix this to create the correct native resource type.
- // See crbug.com/700454.
- computeContentPadding(mContentPadding);
- computeContentAperture(mContentAperture);
- return ResourceManager.createNinePatchBitmapResource(mContentPadding, mContentAperture);
+ return ResourceManager.createBitmapResource();
}
@Override
@@ -143,22 +140,6 @@ public class ViewResourceAdapter implements DynamicResource, OnLayoutChangeListe
}
/**
- * Gives overriding classes the chance to specify a different content padding.
- * @param outContentPadding The resulting content padding.
- */
- protected void computeContentPadding(Rect outContentPadding) {
- outContentPadding.set(0, 0, mView.getWidth(), mView.getHeight());
- }
-
- /**
- * Gives overriding classes the chance to specify a different content aperture.
- * @param outContentAperture The resulting content aperture.
- */
- protected void computeContentAperture(Rect outContentAperture) {
- outContentAperture.set(0, 0, mView.getWidth(), mView.getHeight());
- }
-
- /**
* @return Whether |mBitmap| is corresponding to |mView| or not.
*/
private boolean validateBitmap() {

Powered by Google App Engine
This is Rietveld 408576698