OLD | NEW |
---|---|
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 Loading... | |
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) { |
Yaron
2013/05/17 22:36:16
Nit: "ID" should be "Id" througout
gone
2013/05/20 18:48:10
Usage in the codebase seems really inconsistent :/
Yaron
2013/05/20 20:54:25
Cases with ID are wrong: http://source.android.com
| |
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 Loading... | |
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 } |
OLD | NEW |