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.pageinfo; | 5 package org.chromium.chrome.browser.pageinfo; |
6 | 6 |
7 import android.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.animation.AnimatorSet; | 9 import android.animation.AnimatorSet; |
10 import android.animation.ObjectAnimator; | 10 import android.animation.ObjectAnimator; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 import org.chromium.chrome.browser.preferences.PreferencesLauncher; | 61 import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
62 import org.chromium.chrome.browser.preferences.website.ContentSetting; | 62 import org.chromium.chrome.browser.preferences.website.ContentSetting; |
63 import org.chromium.chrome.browser.preferences.website.ContentSettingsResources; | 63 import org.chromium.chrome.browser.preferences.website.ContentSettingsResources; |
64 import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences; | 64 import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences; |
65 import org.chromium.chrome.browser.preferences.website.WebsitePreferenceBridge; | 65 import org.chromium.chrome.browser.preferences.website.WebsitePreferenceBridge; |
66 import org.chromium.chrome.browser.profiles.Profile; | 66 import org.chromium.chrome.browser.profiles.Profile; |
67 import org.chromium.chrome.browser.ssl.SecurityStateModel; | 67 import org.chromium.chrome.browser.ssl.SecurityStateModel; |
68 import org.chromium.chrome.browser.tab.Tab; | 68 import org.chromium.chrome.browser.tab.Tab; |
69 import org.chromium.chrome.browser.util.UrlUtilities; | 69 import org.chromium.chrome.browser.util.UrlUtilities; |
70 import org.chromium.components.location.LocationUtils; | 70 import org.chromium.components.location.LocationUtils; |
71 import org.chromium.content.browser.ContentViewCore; | |
72 import org.chromium.content_public.browser.WebContents; | 71 import org.chromium.content_public.browser.WebContents; |
73 import org.chromium.content_public.browser.WebContentsObserver; | 72 import org.chromium.content_public.browser.WebContentsObserver; |
74 import org.chromium.ui.base.DeviceFormFactor; | 73 import org.chromium.ui.base.DeviceFormFactor; |
75 import org.chromium.ui.base.WindowAndroid; | 74 import org.chromium.ui.base.WindowAndroid; |
76 import org.chromium.ui.base.WindowAndroid.PermissionCallback; | 75 import org.chromium.ui.base.WindowAndroid.PermissionCallback; |
77 import org.chromium.ui.interpolators.BakedBezierInterpolator; | 76 import org.chromium.ui.interpolators.BakedBezierInterpolator; |
78 import org.chromium.ui.widget.Toast; | 77 import org.chromium.ui.widget.Toast; |
79 | 78 |
80 import java.lang.annotation.Retention; | 79 import java.lang.annotation.Retention; |
81 import java.lang.annotation.RetentionPolicy; | 80 import java.lang.annotation.RetentionPolicy; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 * @param offlinePageCreationDate Date when the offline page was created. | 304 * @param offlinePageCreationDate Date when the offline page was created. |
306 * @param publisher The name of the content publisher, if any
. | 305 * @param publisher The name of the content publisher, if any
. |
307 */ | 306 */ |
308 private WebsiteSettingsPopup(Activity activity, Tab tab, String offlinePageC
reationDate, | 307 private WebsiteSettingsPopup(Activity activity, Tab tab, String offlinePageC
reationDate, |
309 String publisher) { | 308 String publisher) { |
310 mContext = activity; | 309 mContext = activity; |
311 mTab = tab; | 310 mTab = tab; |
312 if (offlinePageCreationDate != null) { | 311 if (offlinePageCreationDate != null) { |
313 mOfflinePageCreationDate = offlinePageCreationDate; | 312 mOfflinePageCreationDate = offlinePageCreationDate; |
314 } | 313 } |
315 mWindowAndroid = ContentViewCore.fromWebContents(mTab.getWebContents()).
getWindowAndroid(); | 314 mWindowAndroid = mTab.getWebContents().getTopLevelNativeWindow(); |
316 mContentPublisher = publisher; | 315 mContentPublisher = publisher; |
317 | 316 |
318 // Find the container and all it's important subviews. | 317 // Find the container and all it's important subviews. |
319 mContainer = (LinearLayout) LayoutInflater.from(mContext).inflate( | 318 mContainer = (LinearLayout) LayoutInflater.from(mContext).inflate( |
320 R.layout.website_settings, null); | 319 R.layout.website_settings, null); |
321 mContainer.setVisibility(View.INVISIBLE); | 320 mContainer.setVisibility(View.INVISIBLE); |
322 mContainer.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { | 321 mContainer.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { |
323 @Override | 322 @Override |
324 public void onLayoutChange( | 323 public void onLayoutChange( |
325 View v, int l, int t, int r, int b, int ol, int ot, int or,
int ob) { | 324 View v, int l, int t, int r, int b, int ol, int ot, int or,
int ob) { |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 new WebsiteSettingsPopup(activity, tab, offlinePageCreationDate, content
Publisher); | 971 new WebsiteSettingsPopup(activity, tab, offlinePageCreationDate, content
Publisher); |
973 } | 972 } |
974 | 973 |
975 private static native long nativeInit(WebsiteSettingsPopup popup, WebContent
s webContents); | 974 private static native long nativeInit(WebsiteSettingsPopup popup, WebContent
s webContents); |
976 | 975 |
977 private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid); | 976 private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid); |
978 | 977 |
979 private native void nativeRecordWebsiteSettingsAction( | 978 private native void nativeRecordWebsiteSettingsAction( |
980 long nativeWebsiteSettingsPopupAndroid, int action); | 979 long nativeWebsiteSettingsPopupAndroid, int action); |
981 } | 980 } |
OLD | NEW |