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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java

Issue 14772036: Let Android port access properly sized images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 7 years, 7 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
« no previous file with comments | « chrome/android/java/ResourceId.template ('k') | chrome/browser/android/resource_id.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.Dialog; 7 import android.app.Dialog;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.DialogInterface; 9 import android.content.DialogInterface;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }); 58 });
59 mContainer = new LinearLayout(mContext); 59 mContainer = new LinearLayout(mContext);
60 mContainer.setOrientation(LinearLayout.VERTICAL); 60 mContainer.setOrientation(LinearLayout.VERTICAL);
61 mContentViewCore = contentViewCore; 61 mContentViewCore = contentViewCore;
62 mPadding = (int) context.getResources().getDimension(R.dimen.certificate _viewer_padding); 62 mPadding = (int) context.getResources().getDimension(R.dimen.certificate _viewer_padding);
63 mContainer.setPadding(mPadding, 0, mPadding, 0); 63 mContainer.setPadding(mPadding, 0, mPadding, 0);
64 } 64 }
65 65
66 /** Adds a section, which contains an icon, a headline, and a description. * / 66 /** Adds a section, which contains an icon, a headline, and a description. * /
67 @CalledByNative 67 @CalledByNative
68 private void addSection(Bitmap icon, String headline, String description) { 68 private void addSection(int enumeratedIconId, String headline, String descri ption) {
69 View section = LayoutInflater.from(mContext).inflate(R.layout.website_se ttings, null); 69 View section = LayoutInflater.from(mContext).inflate(R.layout.website_se ttings, null);
70 ImageView i = (ImageView) section.findViewById(R.id.website_settings_ico n); 70 ImageView i = (ImageView) section.findViewById(R.id.website_settings_ico n);
71 i.setImageBitmap(icon); 71 int drawableId = ResourceId.mapToDrawableId(enumeratedIconId);
72 i.setImageResource(drawableId);
73
72 TextView h = (TextView) section.findViewById(R.id.website_settings_headl ine); 74 TextView h = (TextView) section.findViewById(R.id.website_settings_headl ine);
73 h.setText(headline); 75 h.setText(headline);
74 if (TextUtils.isEmpty(headline)) h.setVisibility(View.GONE); 76 if (TextUtils.isEmpty(headline)) h.setVisibility(View.GONE);
75 77
76 TextView d = (TextView) section.findViewById(R.id.website_settings_descr iption); 78 TextView d = (TextView) section.findViewById(R.id.website_settings_descr iption);
77 d.setText(description); 79 d.setText(description);
78 if (TextUtils.isEmpty(description)) d.setVisibility(View.GONE); 80 if (TextUtils.isEmpty(description)) d.setVisibility(View.GONE);
79 81
80 mContainer.addView(section); 82 mContainer.addView(section);
81 } 83 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 146
145 @CalledByNative 147 @CalledByNative
146 private static WebsiteSettingsPopup create(Context context, ContentViewCore contentViewCore, 148 private static WebsiteSettingsPopup create(Context context, ContentViewCore contentViewCore,
147 int nativeWebsiteSettingsPopup) { 149 int nativeWebsiteSettingsPopup) {
148 return new WebsiteSettingsPopup(context, contentViewCore, nativeWebsiteS ettingsPopup); 150 return new WebsiteSettingsPopup(context, contentViewCore, nativeWebsiteS ettingsPopup);
149 } 151 }
150 152
151 private native void nativeDestroy(int nativeWebsiteSettingsPopupAndroid); 153 private native void nativeDestroy(int nativeWebsiteSettingsPopupAndroid);
152 private native byte[][] nativeGetCertificateChain(ContentViewCore contentVie wCore); 154 private native byte[][] nativeGetCertificateChain(ContentViewCore contentVie wCore);
153 } 155 }
OLDNEW
« no previous file with comments | « chrome/android/java/ResourceId.template ('k') | chrome/browser/android/resource_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698