OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.compositor; | 5 package org.chromium.chrome.browser.compositor; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Canvas; | 8 import android.graphics.Canvas; |
9 import android.graphics.Color; | 9 import android.graphics.Color; |
10 import android.graphics.Paint; | 10 import android.graphics.Paint; |
(...skipping 21 matching lines...) Expand all Loading... |
32 import org.chromium.chrome.browser.compositor.Invalidator.Client; | 32 import org.chromium.chrome.browser.compositor.Invalidator.Client; |
33 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; | 33 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; |
34 import org.chromium.chrome.browser.compositor.layouts.LayoutManager; | 34 import org.chromium.chrome.browser.compositor.layouts.LayoutManager; |
35 import org.chromium.chrome.browser.compositor.layouts.LayoutManagerHost; | 35 import org.chromium.chrome.browser.compositor.layouts.LayoutManagerHost; |
36 import org.chromium.chrome.browser.compositor.layouts.LayoutRenderHost; | 36 import org.chromium.chrome.browser.compositor.layouts.LayoutRenderHost; |
37 import org.chromium.chrome.browser.compositor.layouts.components.VirtualView; | 37 import org.chromium.chrome.browser.compositor.layouts.components.VirtualView; |
38 import org.chromium.chrome.browser.compositor.layouts.content.ContentOffsetProvi
der; | 38 import org.chromium.chrome.browser.compositor.layouts.content.ContentOffsetProvi
der; |
39 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; | 39 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; |
40 import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDe
legate; | 40 import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDe
legate; |
41 import org.chromium.chrome.browser.device.DeviceClassManager; | 41 import org.chromium.chrome.browser.device.DeviceClassManager; |
42 import org.chromium.chrome.browser.dom_distiller.ReaderModeManagerDelegate; | |
43 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; | 42 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; |
44 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager.Fullscreen
Listener; | 43 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager.Fullscreen
Listener; |
45 import org.chromium.chrome.browser.tab.EmptyTabObserver; | 44 import org.chromium.chrome.browser.tab.EmptyTabObserver; |
46 import org.chromium.chrome.browser.tab.Tab; | 45 import org.chromium.chrome.browser.tab.Tab; |
47 import org.chromium.chrome.browser.tab.TabObserver; | 46 import org.chromium.chrome.browser.tab.TabObserver; |
48 import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; | 47 import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; |
49 import org.chromium.chrome.browser.tabmodel.TabCreatorManager; | 48 import org.chromium.chrome.browser.tabmodel.TabCreatorManager; |
50 import org.chromium.chrome.browser.tabmodel.TabModelSelector; | 49 import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
51 import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; | 50 import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; |
52 import org.chromium.chrome.browser.util.ColorUtils; | 51 import org.chromium.chrome.browser.util.ColorUtils; |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 | 764 |
766 /** | 765 /** |
767 * Sets the appropriate objects this class should represent. | 766 * Sets the appropriate objects this class should represent. |
768 * @param tabModelSelector The {@link TabModelSelector} this View sho
uld hold and | 767 * @param tabModelSelector The {@link TabModelSelector} this View sho
uld hold and |
769 * represent. | 768 * represent. |
770 * @param tabCreatorManager The {@link TabCreatorManager} for this vie
w. | 769 * @param tabCreatorManager The {@link TabCreatorManager} for this vie
w. |
771 * @param tabContentManager The {@link TabContentManager} for the tabs
. | 770 * @param tabContentManager The {@link TabContentManager} for the tabs
. |
772 * @param androidContentContainer The {@link ViewGroup} the {@link LayoutMan
ager} should bind | 771 * @param androidContentContainer The {@link ViewGroup} the {@link LayoutMan
ager} should bind |
773 * Android content to. | 772 * Android content to. |
774 * @param contextualSearchManager A {@link ContextualSearchManagementDelegat
e} instance. | 773 * @param contextualSearchManager A {@link ContextualSearchManagementDelegat
e} instance. |
775 * @param readerModeManager A {@link ReaderModeManagerDelegate} instan
ce. | |
776 */ | 774 */ |
777 public void onFinishNativeInitialization(TabModelSelector tabModelSelector, | 775 public void onFinishNativeInitialization(TabModelSelector tabModelSelector, |
778 TabCreatorManager tabCreatorManager, TabContentManager tabContentMan
ager, | 776 TabCreatorManager tabCreatorManager, TabContentManager tabContentMan
ager, |
779 ViewGroup androidContentContainer, | 777 ViewGroup androidContentContainer, |
780 ContextualSearchManagementDelegate contextualSearchManager, | 778 ContextualSearchManagementDelegate contextualSearchManager) { |
781 ReaderModeManagerDelegate readerModeManager) { | |
782 assert mLayoutManager != null; | 779 assert mLayoutManager != null; |
783 mLayoutManager.init(tabModelSelector, tabCreatorManager, tabContentManag
er, | 780 mLayoutManager.init(tabModelSelector, tabCreatorManager, tabContentManag
er, |
784 androidContentContainer, contextualSearchManager, readerModeMana
ger, | 781 androidContentContainer, contextualSearchManager, |
785 mCompositorView.getResourceManager().getDynamicResourceLoader())
; | 782 mCompositorView.getResourceManager().getDynamicResourceLoader())
; |
786 | 783 |
787 attachToTabModelSelector(tabModelSelector); | 784 attachToTabModelSelector(tabModelSelector); |
788 | 785 |
789 onContentChanged(); | 786 onContentChanged(); |
790 } | 787 } |
791 | 788 |
792 private void updateContentOverlayVisibility(boolean show) { | 789 private void updateContentOverlayVisibility(boolean show) { |
793 if (mView == null) return; | 790 if (mView == null) return; |
794 ContentViewCore content = getActiveContent(); | 791 ContentViewCore content = getActiveContent(); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 if (mPixelRect.width() == 0) { | 1118 if (mPixelRect.width() == 0) { |
1122 mPixelRect.right = mPixelRect.left + 1; | 1119 mPixelRect.right = mPixelRect.left + 1; |
1123 } | 1120 } |
1124 if (mPixelRect.height() == 0) { | 1121 if (mPixelRect.height() == 0) { |
1125 mPixelRect.bottom = mPixelRect.top + 1; | 1122 mPixelRect.bottom = mPixelRect.top + 1; |
1126 } | 1123 } |
1127 return mPixelRect; | 1124 return mPixelRect; |
1128 } | 1125 } |
1129 } | 1126 } |
1130 } | 1127 } |
OLD | NEW |