| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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; |
| 11 import android.graphics.Color; | 11 import android.graphics.Color; |
| 12 import android.provider.Browser; | 12 import android.provider.Browser; |
| 13 import android.text.TextUtils; | 13 import android.text.TextUtils; |
| 14 import android.view.LayoutInflater; | 14 import android.view.LayoutInflater; |
| 15 import android.view.View; | 15 import android.view.View; |
| 16 import android.view.View.OnClickListener; | 16 import android.view.View.OnClickListener; |
| 17 import android.view.ViewGroup; | 17 import android.view.ViewGroup; |
| 18 import android.view.Window; | 18 import android.view.Window; |
| 19 import android.widget.Button; | 19 import android.widget.Button; |
| 20 import android.widget.ImageView; | 20 import android.widget.ImageView; |
| 21 import android.widget.LinearLayout; | 21 import android.widget.LinearLayout; |
| 22 import android.widget.ScrollView; | 22 import android.widget.ScrollView; |
| 23 import android.widget.TextView; | 23 import android.widget.TextView; |
| 24 | 24 |
| 25 import org.chromium.base.ApiCompatibilityUtils; | 25 import org.chromium.base.ApiCompatibilityUtils; |
| 26 import org.chromium.base.CalledByNative; | 26 import org.chromium.base.CalledByNative; |
| 27 import org.chromium.chrome.R; | 27 import org.chromium.chrome.R; |
| 28 import org.chromium.content.browser.WebContentsObserverAndroid; | 28 import org.chromium.content.browser.WebContentsObserver; |
| 29 import org.chromium.content_public.browser.WebContents; | 29 import org.chromium.content_public.browser.WebContents; |
| 30 | 30 |
| 31 import java.net.URISyntaxException; | 31 import java.net.URISyntaxException; |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * Java side of Android implementation of the website settings UI. | 34 * Java side of Android implementation of the website settings UI. |
| 35 */ | 35 */ |
| 36 public class WebsiteSettingsPopupLegacy implements OnClickListener { | 36 public class WebsiteSettingsPopupLegacy implements OnClickListener { |
| 37 private static final String HELP_URL = | 37 private static final String HELP_URL = |
| 38 "http://www.google.com/support/chrome/bin/answer.py?answer=95617"; | 38 "http://www.google.com/support/chrome/bin/answer.py?answer=95617"; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 60 mPaddingThin = (int) context.getResources().getDimension( | 60 mPaddingThin = (int) context.getResources().getDimension( |
| 61 R.dimen.certificate_viewer_padding_thin); | 61 R.dimen.certificate_viewer_padding_thin); |
| 62 mContainer.setPadding(mPaddingWide, mPaddingWide + mPaddingThin, mPaddin
gWide, | 62 mContainer.setPadding(mPaddingWide, mPaddingWide + mPaddingThin, mPaddin
gWide, |
| 63 mPaddingWide); | 63 mPaddingWide); |
| 64 | 64 |
| 65 mDialog = new Dialog(mContext); | 65 mDialog = new Dialog(mContext); |
| 66 mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); | 66 mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); |
| 67 mDialog.setCanceledOnTouchOutside(true); | 67 mDialog.setCanceledOnTouchOutside(true); |
| 68 // This needs to come after other member initialization. | 68 // This needs to come after other member initialization. |
| 69 mNativeWebsiteSettingsPopupLegacy = nativeInit(this, webContents); | 69 mNativeWebsiteSettingsPopupLegacy = nativeInit(this, webContents); |
| 70 final WebContentsObserverAndroid webContentsObserver = | 70 final WebContentsObserver webContentsObserver = |
| 71 new WebContentsObserverAndroid(mWebContents) { | 71 new WebContentsObserver(mWebContents) { |
| 72 @Override | 72 @Override |
| 73 public void navigationEntryCommitted() { | 73 public void navigationEntryCommitted() { |
| 74 // If a navigation is committed (e.g. from in-page redirect), th
e data we're | 74 // If a navigation is committed (e.g. from in-page redirect), th
e data we're |
| 75 // showing is stale so dismiss the dialog. | 75 // showing is stale so dismiss the dialog. |
| 76 mDialog.dismiss(); | 76 mDialog.dismiss(); |
| 77 } | 77 } |
| 78 }; | 78 }; |
| 79 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { | 79 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { |
| 80 @Override | 80 @Override |
| 81 public void onDismiss(DialogInterface dialog) { | 81 public void onDismiss(DialogInterface dialog) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 new WebsiteSettingsPopupLegacy(context, webContents); | 236 new WebsiteSettingsPopupLegacy(context, webContents); |
| 237 } | 237 } |
| 238 | 238 |
| 239 private static native long nativeInit(WebsiteSettingsPopupLegacy popup, | 239 private static native long nativeInit(WebsiteSettingsPopupLegacy popup, |
| 240 WebContents webContents); | 240 WebContents webContents); |
| 241 private native void nativeDestroy(long nativeWebsiteSettingsPopupLegacyAndro
id); | 241 private native void nativeDestroy(long nativeWebsiteSettingsPopupLegacyAndro
id); |
| 242 private native void nativeResetCertDecisions( | 242 private native void nativeResetCertDecisions( |
| 243 long nativeWebsiteSettingsPopupLegacyAndroid, WebContents webContent
s); | 243 long nativeWebsiteSettingsPopupLegacyAndroid, WebContents webContent
s); |
| 244 private native byte[][] nativeGetCertificateChain(WebContents webContents); | 244 private native byte[][] nativeGetCertificateChain(WebContents webContents); |
| 245 } | 245 } |
| OLD | NEW |