org.chromium.chrome.browser.compositor.bottombar.OverlayPanel Java Examples
The following examples show how to use
org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContextualSearchPanel.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * @return An implementation of {@link ContextualSearchPromoHost}. */ private ContextualSearchPromoHost getContextualSearchPromoHost() { if (mPromoHost == null) { mPromoHost = new ContextualSearchPromoHost() { @Override public void onPromoOptIn(boolean wasMandatory) { if (wasMandatory) { getOverlayPanelContent().showContent(); expandPanel(StateChangeReason.OPTIN); } } @Override public void onPromoOptOut() { closePanel(OverlayPanel.StateChangeReason.OPTOUT, true); } @Override public void onUpdatePromoAppearance() { ContextualSearchPanel.this.updateBarShadow(); } }; } return mPromoHost; }
Example #2
Source File: ContextualSearchPeekPromoControl.java From delion with Apache License 2.0 | 6 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPeekPromoControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_peek_promo_text_view, R.id.contextual_search_peek_promo_text_view, context, container, resourceLoader); final float dpToPx = context.getResources().getDisplayMetrics().density; mDefaultHeightPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_height); mPaddingPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_padding); mRippleMinimumWidthPx = RIPPLE_MINIMUM_WIDTH_DP * dpToPx; mRippleMaximumWidthPx = panel.getMaximumWidthPx(); }
Example #3
Source File: OverlayPanelEventFilter.java From delion with Apache License 2.0 | 6 votes |
/** * Creates a {@link GestureEventFilter} with offset touch events. * @param context The {@link Context} for Android. * @param host The {@link EventFilterHost} for this event filter. * @param panelManager The {@link OverlayPanelManager} responsible for showing panels. */ public OverlayPanelEventFilter(Context context, EventFilterHost host, OverlayPanel panel) { super(context, host, panel, false, false); mGestureDetector = new GestureDetector(context, new InternalGestureDetector()); mPanel = panel; mSwipeRecognizer = new SwipeRecognizerImpl(context); // Store the square of the platform touch slop in pixels to use in the scroll detection. // See {@link OverlayPanelEventFilter#isDistanceGreaterThanTouchSlop}. float touchSlopPx = ViewConfiguration.get(context).getScaledTouchSlop(); mTouchSlopSquarePx = touchSlopPx * touchSlopPx; reset(); }
Example #4
Source File: ContextualSearchPanel.java From 365browser with Apache License 2.0 | 6 votes |
/** * @return An implementation of {@link ContextualSearchPromoHost}. */ private ContextualSearchPromoHost getContextualSearchPromoHost() { if (mPromoHost == null) { mPromoHost = new ContextualSearchPromoHost() { @Override public void onPromoOptIn(boolean wasMandatory) { if (wasMandatory) { getOverlayPanelContent().showContent(); expandPanel(StateChangeReason.OPTIN); } } @Override public void onPromoOptOut() { closePanel(OverlayPanel.StateChangeReason.OPTOUT, true); } @Override public void onUpdatePromoAppearance() { ContextualSearchPanel.this.updateBarShadow(); } }; } return mPromoHost; }
Example #5
Source File: ContextualSearchPanel.java From delion with Apache License 2.0 | 6 votes |
/** * @return An implementation of {@link ContextualSearchPromoHost}. */ private ContextualSearchPromoHost getContextualSearchPromoHost() { if (mPromoHost == null) { mPromoHost = new ContextualSearchPromoHost() { @Override public void onPromoOptIn(boolean wasMandatory) { if (wasMandatory) { getOverlayPanelContent().showContent(); expandPanel(StateChangeReason.OPTIN); } } @Override public void onPromoOptOut() { closePanel(OverlayPanel.StateChangeReason.OPTOUT, true); } @Override public void onUpdatePromoAppearance() { ContextualSearchPanel.this.updateBarShadow(); } }; } return mPromoHost; }
Example #6
Source File: ContextualSearchPeekPromoControl.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPeekPromoControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_peek_promo_text_view, R.id.contextual_search_peek_promo_text_view, context, container, resourceLoader); final float dpToPx = context.getResources().getDisplayMetrics().density; mDefaultHeightPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_height); mPaddingPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_padding); mRippleMinimumWidthPx = RIPPLE_MINIMUM_WIDTH_DP * dpToPx; mRippleMaximumWidthPx = panel.getMaximumWidthPx(); }
Example #7
Source File: ContextualSearchPeekPromoControl.java From 365browser with Apache License 2.0 | 6 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPeekPromoControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_peek_promo_text_view, R.id.contextual_search_peek_promo_text_view, context, container, resourceLoader); final float dpToPx = context.getResources().getDisplayMetrics().density; mDefaultHeightPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_height); mPaddingPx = context.getResources().getDimensionPixelOffset( R.dimen.contextual_search_peek_promo_padding); mRippleMinimumWidthPx = RIPPLE_MINIMUM_WIDTH_DP * dpToPx; mRippleMaximumWidthPx = panel.getMaximumWidthPx(); }
Example #8
Source File: OverlayPanelEventFilter.java From 365browser with Apache License 2.0 | 6 votes |
/** * Creates a {@link GestureEventFilter} with offset touch events. * @param context The {@link Context} for Android. * @param panelManager The {@link OverlayPanelManager} responsible for showing panels. */ public OverlayPanelEventFilter(Context context, OverlayPanel panel) { super(context, panel, false, false); mGestureDetector = new GestureDetector(context, new InternalGestureDetector()); mPanel = panel; mSwipeRecognizer = new SwipeRecognizerImpl(context); // Store the square of the platform touch slop in pixels to use in the scroll detection. // See {@link OverlayPanelEventFilter#isDistanceGreaterThanTouchSlop}. float touchSlopPx = ViewConfiguration.get(context).getScaledTouchSlop(); mTouchSlopSquarePx = touchSlopPx * touchSlopPx; reset(); }
Example #9
Source File: OverlayPanelEventFilter.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Creates a {@link GestureEventFilter} with offset touch events. * @param context The {@link Context} for Android. * @param host The {@link EventFilterHost} for this event filter. * @param panelManager The {@link OverlayPanelManager} responsible for showing panels. */ public OverlayPanelEventFilter(Context context, EventFilterHost host, OverlayPanel panel) { super(context, host, panel, false, false); mGestureDetector = new GestureDetector(context, new InternalGestureDetector()); mPanel = panel; mSwipeRecognizer = new SwipeRecognizerImpl(context); // Store the square of the platform touch slop in pixels to use in the scroll detection. // See {@link OverlayPanelEventFilter#isDistanceGreaterThanTouchSlop}. float touchSlopPx = ViewConfiguration.get(context).getScaledTouchSlop(); mTouchSlopSquarePx = touchSlopPx * touchSlopPx; reset(); }
Example #10
Source File: ContextualSearchPromoControl.java From 365browser with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPromoControl(OverlayPanel panel, ContextualSearchPromoHost host, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_promo_view, R.id.contextual_search_promo, context, container, resourceLoader); mDpToPx = context.getResources().getDisplayMetrics().density; mHost = host; }
Example #11
Source File: ReaderModeSceneLayer.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Update the scene layer to draw an OverlayPanel. * @param resourceManager Manager to get view and image resources. * @param panel The OverlayPanel to render. * @param barTextViewId The ID of the view containing the Reader Mode text. * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}. */ public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId, float barTextOpacity) { // Don't try to update the layer if not initialized or showing. if (resourceManager == null || !panel.isShowing()) return; if (!mIsInitialized) { nativeCreateReaderModeLayer(mNativePtr, resourceManager); // TODO(mdjones): Rename contextual search resources below to be generic to overlay // panels. nativeSetResourceIds(mNativePtr, barTextViewId, R.drawable.contextual_search_bar_background, R.drawable.contextual_search_bar_shadow, R.drawable.infobar_mobile_friendly, R.drawable.btn_close); mIsInitialized = true; } WebContents panelWebContents = panel.getContentViewCore() != null ? panel.getContentViewCore().getWebContents() : null; nativeUpdate(mNativePtr, mDpToPx, panel.getBasePageBrightness(), panel.getBasePageY() * mDpToPx, panelWebContents, panel.getOffsetX() * mDpToPx, panel.getOffsetY() * mDpToPx, panel.getWidth() * mDpToPx, panel.getHeight() * mDpToPx, panel.getBarMarginSide() * mDpToPx, panel.getBarHeight() * mDpToPx, barTextOpacity, panel.isBarBorderVisible(), panel.getBarBorderHeight() * mDpToPx, panel.getBarShadowVisible(), panel.getBarShadowOpacity()); }
Example #12
Source File: ContextualSearchSelectionController.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Notifies that the Contextual Search has ended. * @param reason The reason for ending the Contextual Search. */ void onSearchEnded(OverlayPanel.StateChangeReason reason) { // If the user explicitly closes the panel after establishing a selection with long press, // it should not reappear until a new selection is made. This prevents the panel from // reappearing when a long press selection is modified after the user has taken action to // get rid of the panel. See crbug.com/489461. if (shouldPreventHandlingCurrentSelectionModification(reason)) { preventHandlingCurrentSelectionModification(); } // Long press selections should remain visible after ending a Contextual Search. if (mSelectionType == SelectionType.TAP) { clearSelection(); } }
Example #13
Source File: ContextualSearchSelectionController.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * This method checks whether the selection modification should be handled. This method * is needed to allow modifying selections that are occluded by the Panel. * See crbug.com/489461. * * @param reason The reason the panel is closing. * @return Whether the selection modification should be handled. */ private boolean shouldPreventHandlingCurrentSelectionModification( OverlayPanel.StateChangeReason reason) { return getSelectionType() == SelectionType.LONG_PRESS && (reason == OverlayPanel.StateChangeReason.BACK_PRESS || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL || reason == OverlayPanel.StateChangeReason.SWIPE || reason == OverlayPanel.StateChangeReason.FLING || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON); }
Example #14
Source File: ReaderModeBarControl.java From 365browser with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ReaderModeBarControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.reader_mode_text_view, R.id.reader_mode_text_view, context, container, resourceLoader); invalidate(); }
Example #15
Source File: ContextualSearchTermControl.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchTermControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_term_view, R.id.contextual_search_term_view, context, container, resourceLoader); }
Example #16
Source File: ContextualSearchContextControl.java From 365browser with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchContextControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_context_view, R.id.contextual_search_context_view, context, container, resourceLoader); }
Example #17
Source File: ContextualSearchTermControl.java From 365browser with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchTermControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_term_view, R.id.contextual_search_term_view, context, container, resourceLoader); }
Example #18
Source File: ReaderModeSceneLayer.java From 365browser with Apache License 2.0 | 5 votes |
/** * Update the scene layer to draw an OverlayPanel. * @param resourceManager Manager to get view and image resources. * @param panel The OverlayPanel to render. * @param barTextViewId The ID of the view containing the Reader Mode text. * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}. */ public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId, float barTextOpacity) { // Don't try to update the layer if not initialized or showing. if (resourceManager == null || !panel.isShowing()) return; if (!mIsInitialized) { nativeCreateReaderModeLayer(mNativePtr, resourceManager); // TODO(mdjones): Rename contextual search resources below to be generic to overlay // panels. nativeSetResourceIds(mNativePtr, barTextViewId, R.drawable.contextual_search_bar_background, R.drawable.contextual_search_bar_shadow, R.drawable.infobar_mobile_friendly, R.drawable.btn_close); mIsInitialized = true; } WebContents panelWebContents = panel.getContentViewCore() != null ? panel.getContentViewCore().getWebContents() : null; nativeUpdate(mNativePtr, mDpToPx, panel.getBasePageBrightness(), panel.getBasePageY() * mDpToPx, panelWebContents, panel.getOffsetX() * mDpToPx, panel.getOffsetY() * mDpToPx, panel.getWidth() * mDpToPx, panel.getHeight() * mDpToPx, panel.getBarMarginSide() * mDpToPx, panel.getBarHeight() * mDpToPx, barTextOpacity, panel.isBarBorderVisible(), panel.getBarBorderHeight() * mDpToPx, panel.getBarShadowVisible(), panel.getBarShadowOpacity()); }
Example #19
Source File: ContextualSearchSelectionController.java From 365browser with Apache License 2.0 | 5 votes |
/** * Notifies that the Contextual Search has ended. * @param reason The reason for ending the Contextual Search. */ void onSearchEnded(OverlayPanel.StateChangeReason reason) { // If the user explicitly closes the panel after establishing a selection with long press, // it should not reappear until a new selection is made. This prevents the panel from // reappearing when a long press selection is modified after the user has taken action to // get rid of the panel. See crbug.com/489461. if (shouldPreventHandlingCurrentSelectionModification(reason)) { preventHandlingCurrentSelectionModification(); } // Long press selections should remain visible after ending a Contextual Search. if (mSelectionType == SelectionType.TAP) { clearSelection(); } }
Example #20
Source File: ContextualSearchSelectionController.java From 365browser with Apache License 2.0 | 5 votes |
/** * This method checks whether the selection modification should be handled. This method * is needed to allow modifying selections that are occluded by the Panel. * See crbug.com/489461. * * @param reason The reason the panel is closing. * @return Whether the selection modification should be handled. */ private boolean shouldPreventHandlingCurrentSelectionModification( OverlayPanel.StateChangeReason reason) { return getSelectionType() == SelectionType.LONG_PRESS && (reason == OverlayPanel.StateChangeReason.BACK_PRESS || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL || reason == OverlayPanel.StateChangeReason.SWIPE || reason == OverlayPanel.StateChangeReason.FLING || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON); }
Example #21
Source File: ContextualSearchContextControl.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchContextControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_context_view, R.id.contextual_search_context_view, context, container, resourceLoader); }
Example #22
Source File: ContextualSearchPromoControl.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPromoControl(OverlayPanel panel, ContextualSearchPromoHost host, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_promo_view, R.id.contextual_search_promo, context, container, resourceLoader); mDpToPx = context.getResources().getDisplayMetrics().density; mHost = host; }
Example #23
Source File: ReaderModeBarControl.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ReaderModeBarControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.reader_mode_text_view, R.id.reader_mode_text_view, context, container, resourceLoader); invalidate(); }
Example #24
Source File: ContextualSearchSelectionController.java From delion with Apache License 2.0 | 5 votes |
/** * This method checks whether the selection modification should be handled. This method * is needed to allow modifying selections that are occluded by the Panel. * See crbug.com/489461. * * @param reason The reason the panel is closing. * @return Whether the selection modification should be handled. */ private boolean shouldPreventHandlingCurrentSelectionModification( OverlayPanel.StateChangeReason reason) { return getSelectionType() == SelectionType.LONG_PRESS && (reason == OverlayPanel.StateChangeReason.BACK_PRESS || reason == OverlayPanel.StateChangeReason.BASE_PAGE_SCROLL || reason == OverlayPanel.StateChangeReason.SWIPE || reason == OverlayPanel.StateChangeReason.FLING || reason == OverlayPanel.StateChangeReason.CLOSE_BUTTON); }
Example #25
Source File: ContextualSearchSelectionController.java From delion with Apache License 2.0 | 5 votes |
/** * Notifies that the Contextual Search has ended. * @param reason The reason for ending the Contextual Search. */ void onSearchEnded(OverlayPanel.StateChangeReason reason) { // If the user explicitly closes the panel after establishing a selection with long press, // it should not reappear until a new selection is made. This prevents the panel from // reappearing when a long press selection is modified after the user has taken action to // get rid of the panel. See crbug.com/489461. if (shouldPreventHandlingCurrentSelectionModification(reason)) { preventHandlingCurrentSelectionModification(); } // Long press selections should remain visible after ending a Contextual Search. if (mSelectionType == SelectionType.TAP) { clearSelection(); } }
Example #26
Source File: ReaderModeSceneLayer.java From delion with Apache License 2.0 | 5 votes |
/** * Update the scene layer to draw an OverlayPanel. * @param resourceManager Manager to get view and image resources. * @param panel The OverlayPanel to render. * @param barTextViewId The ID of the view containing the Reader Mode text. * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}. */ public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId, float barTextOpacity) { // Don't try to update the layer if not initialized or showing. if (resourceManager == null || !panel.isShowing()) return; if (!mIsInitialized) { nativeCreateReaderModeLayer(mNativePtr, resourceManager); // TODO(mdjones): Rename contextual search resources below to be generic to overlay // panels. nativeSetResourceIds(mNativePtr, barTextViewId, R.drawable.contextual_search_bar_background, R.drawable.contextual_search_bar_shadow, R.drawable.infobar_mobile_friendly, R.drawable.btn_close); mIsInitialized = true; } nativeUpdate(mNativePtr, mDpToPx, panel.getBasePageBrightness(), panel.getBasePageY() * mDpToPx, panel.getContentViewCore(), panel.getOffsetX() * mDpToPx, panel.getOffsetY() * mDpToPx, panel.getWidth() * mDpToPx, panel.getHeight() * mDpToPx, panel.getBarMarginSide() * mDpToPx, panel.getBarHeight() * mDpToPx, barTextOpacity, panel.isBarBorderVisible(), panel.getBarBorderHeight() * mDpToPx, panel.getBarShadowVisible(), panel.getBarShadowOpacity()); }
Example #27
Source File: ContextualSearchBarControl.java From delion with Apache License 2.0 | 5 votes |
/** * Constructs a new bottom bar control container by inflating views from XML. * * @param panel The panel. * @param context The context used to build this view. * @param container The parent view for the bottom bar views. * @param loader The resource loader that will handle the snapshot capturing. */ public ContextualSearchBarControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader loader) { mOverlayPanel = panel; mContextControl = new ContextualSearchContextControl(panel, context, container, loader); mSearchTermControl = new ContextualSearchTermControl(panel, context, container, loader); mCaptionControl = new ContextualSearchCaptionControl(panel, context, container, loader); }
Example #28
Source File: ContextualSearchTermControl.java From delion with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchTermControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_term_view, R.id.contextual_search_term_view, context, container, resourceLoader); }
Example #29
Source File: ContextualSearchContextControl.java From delion with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchContextControl(OverlayPanel panel, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_context_view, R.id.contextual_search_context_view, context, container, resourceLoader); }
Example #30
Source File: ContextualSearchPromoControl.java From delion with Apache License 2.0 | 5 votes |
/** * @param panel The panel. * @param context The Android Context used to inflate the View. * @param container The container View used to inflate the View. * @param resourceLoader The resource loader that will handle the snapshot capturing. */ public ContextualSearchPromoControl(OverlayPanel panel, ContextualSearchPromoHost host, Context context, ViewGroup container, DynamicResourceLoader resourceLoader) { super(panel, R.layout.contextual_search_promo_view, R.id.contextual_search_promo, context, container, resourceLoader); mDpToPx = context.getResources().getDisplayMetrics().density; mHost = host; }