| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
| 10 import android.graphics.Color; | 10 import android.graphics.Color; |
| 11 import android.view.ContextMenu; | 11 import android.view.ContextMenu; |
| 12 import android.view.View; | 12 import android.view.View; |
| 13 | 13 |
| 14 import org.chromium.base.CalledByNative; | 14 import org.chromium.base.CalledByNative; |
| 15 import org.chromium.base.ObserverList; | 15 import org.chromium.base.ObserverList; |
| 16 import org.chromium.base.TraceEvent; | 16 import org.chromium.base.TraceEvent; |
| 17 import org.chromium.chrome.browser.banners.AppBannerManager; | 17 import org.chromium.chrome.browser.banners.AppBannerManager; |
| 18 import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItemDelegate; | 18 import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItemDelegate; |
| 19 import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator; | 19 import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator; |
| 20 import org.chromium.chrome.browser.contextmenu.ContextMenuParams; | 20 import org.chromium.chrome.browser.contextmenu.ContextMenuParams; |
| 21 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; | 21 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; |
| 22 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulatorWrapper; | 22 import org.chromium.chrome.browser.contextmenu.ContextMenuPopulatorWrapper; |
| 23 import org.chromium.chrome.browser.contextmenu.EmptyChromeContextMenuItemDelegat
e; | 23 import org.chromium.chrome.browser.contextmenu.EmptyChromeContextMenuItemDelegat
e; |
| 24 import org.chromium.chrome.browser.dom_distiller.FeedbackReporter; |
| 24 import org.chromium.chrome.browser.infobar.AutoLoginProcessor; | 25 import org.chromium.chrome.browser.infobar.AutoLoginProcessor; |
| 25 import org.chromium.chrome.browser.infobar.InfoBarContainer; | 26 import org.chromium.chrome.browser.infobar.InfoBarContainer; |
| 26 import org.chromium.chrome.browser.profiles.Profile; | 27 import org.chromium.chrome.browser.profiles.Profile; |
| 27 import org.chromium.chrome.browser.ui.toolbar.ToolbarModelSecurityLevel; | 28 import org.chromium.chrome.browser.ui.toolbar.ToolbarModelSecurityLevel; |
| 28 import org.chromium.content.browser.ContentView; | 29 import org.chromium.content.browser.ContentView; |
| 29 import org.chromium.content.browser.ContentViewClient; | 30 import org.chromium.content.browser.ContentViewClient; |
| 30 import org.chromium.content.browser.ContentViewCore; | 31 import org.chromium.content.browser.ContentViewCore; |
| 31 import org.chromium.content.browser.LoadUrlParams; | 32 import org.chromium.content.browser.LoadUrlParams; |
| 32 import org.chromium.content.browser.NavigationClient; | 33 import org.chromium.content.browser.NavigationClient; |
| 33 import org.chromium.content.browser.NavigationHistory; | 34 import org.chromium.content.browser.NavigationHistory; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 /** | 122 /** |
| 122 * A list of Tab observers. These are used to broadcast Tab events to liste
ners. | 123 * A list of Tab observers. These are used to broadcast Tab events to liste
ners. |
| 123 */ | 124 */ |
| 124 private final ObserverList<TabObserver> mObservers = new ObserverList<TabObs
erver>(); | 125 private final ObserverList<TabObserver> mObservers = new ObserverList<TabObs
erver>(); |
| 125 | 126 |
| 126 // Content layer Observers and Delegates | 127 // Content layer Observers and Delegates |
| 127 private ContentViewClient mContentViewClient; | 128 private ContentViewClient mContentViewClient; |
| 128 private WebContentsObserverAndroid mWebContentsObserver; | 129 private WebContentsObserverAndroid mWebContentsObserver; |
| 129 private VoiceSearchTabHelper mVoiceSearchTabHelper; | 130 private VoiceSearchTabHelper mVoiceSearchTabHelper; |
| 130 private TabChromeWebContentsDelegateAndroid mWebContentsDelegate; | 131 private TabChromeWebContentsDelegateAndroid mWebContentsDelegate; |
| 132 private FeedbackReporter mFeedbackReporter; |
| 131 | 133 |
| 132 /** | 134 /** |
| 133 * A default {@link ChromeContextMenuItemDelegate} that supports some of the
context menu | 135 * A default {@link ChromeContextMenuItemDelegate} that supports some of the
context menu |
| 134 * functionality. | 136 * functionality. |
| 135 */ | 137 */ |
| 136 protected class TabChromeContextMenuItemDelegate | 138 protected class TabChromeContextMenuItemDelegate |
| 137 extends EmptyChromeContextMenuItemDelegate { | 139 extends EmptyChromeContextMenuItemDelegate { |
| 138 private final Clipboard mClipboard; | 140 private final Clipboard mClipboard; |
| 139 | 141 |
| 140 /** | 142 /** |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 (Activity) mContext, createAutoLoginProcessor(), getId(), ge
tContentView(), | 768 (Activity) mContext, createAutoLoginProcessor(), getId(), ge
tContentView(), |
| 767 webContents); | 769 webContents); |
| 768 } else { | 770 } else { |
| 769 mInfoBarContainer.onParentViewChanged(getId(), getContentView()); | 771 mInfoBarContainer.onParentViewChanged(getId(), getContentView()); |
| 770 } | 772 } |
| 771 | 773 |
| 772 if (AppBannerManager.isEnabled() && mAppBannerManager == null) { | 774 if (AppBannerManager.isEnabled() && mAppBannerManager == null) { |
| 773 mAppBannerManager = new AppBannerManager(this); | 775 mAppBannerManager = new AppBannerManager(this); |
| 774 } | 776 } |
| 775 | 777 |
| 778 if (FeedbackReporter.isEnabled() && mFeedbackReporter == null) { |
| 779 mFeedbackReporter = new FeedbackReporter(this); |
| 780 } |
| 781 |
| 776 for (TabObserver observer : mObservers) observer.onContentChanged(this); | 782 for (TabObserver observer : mObservers) observer.onContentChanged(this); |
| 777 } | 783 } |
| 778 | 784 |
| 779 /** | 785 /** |
| 780 * Cleans up all internal state, destroying any {@link NativePage} or {@link
ContentView} | 786 * Cleans up all internal state, destroying any {@link NativePage} or {@link
ContentView} |
| 781 * currently associated with this {@link Tab}. This also destroys the nativ
e counterpart | 787 * currently associated with this {@link Tab}. This also destroys the nativ
e counterpart |
| 782 * to this class, which means that all subclasses should erase their native
pointers after | 788 * to this class, which means that all subclasses should erase their native
pointers after |
| 783 * this method is called. Once this call is made this {@link Tab} should no
longer be used. | 789 * this method is called. Once this call is made this {@link Tab} should no
longer be used. |
| 784 */ | 790 */ |
| 785 public void destroy() { | 791 public void destroy() { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean
deleteNative); | 1053 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean
deleteNative); |
| 1048 private native WebContents nativeGetWebContents(long nativeTabAndroid); | 1054 private native WebContents nativeGetWebContents(long nativeTabAndroid); |
| 1049 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); | 1055 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); |
| 1050 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e
xtraHeaders, | 1056 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e
xtraHeaders, |
| 1051 byte[] postData, int transition, String referrerUrl, int referrerPol
icy); | 1057 byte[] postData, int transition, String referrerUrl, int referrerPol
icy); |
| 1052 private native int nativeGetSecurityLevel(long nativeTabAndroid); | 1058 private native int nativeGetSecurityLevel(long nativeTabAndroid); |
| 1053 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab
Android, String url, | 1059 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab
Android, String url, |
| 1054 String title); | 1060 String title); |
| 1055 private native boolean nativePrint(long nativeTabAndroid); | 1061 private native boolean nativePrint(long nativeTabAndroid); |
| 1056 } | 1062 } |
| OLD | NEW |