-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5679 from brave/cr84
Upgrade from Chromium 83 to Chromium 84
- Loading branch information
Showing
695 changed files
with
7,072 additions
and
6,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.chromium.chrome.browser.feed; | ||
|
||
import android.app.Activity; | ||
import android.view.View; | ||
import android.widget.FrameLayout; | ||
import android.widget.ScrollView; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import org.chromium.base.ApiCompatibilityUtils; | ||
import org.chromium.base.supplier.Supplier; | ||
import org.chromium.chrome.browser.feed.library.api.host.action.ActionApi; | ||
import org.chromium.chrome.browser.feed.shared.FeedSurfaceDelegate; | ||
import org.chromium.chrome.browser.native_page.NativePageNavigationDelegate; | ||
import org.chromium.chrome.browser.ntp.SnapScrollHelper; | ||
import org.chromium.chrome.browser.ntp.snippets.SectionHeaderView; | ||
import org.chromium.chrome.browser.profiles.Profile; | ||
import org.chromium.chrome.browser.tab.Tab; | ||
import org.chromium.chrome.browser.tabmodel.TabModelSelector; | ||
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; | ||
import org.chromium.chrome.feed.R; | ||
import org.chromium.ui.UiUtils; | ||
|
||
public class BraveFeedSurfaceCoordinator extends FeedSurfaceCoordinator { | ||
private Activity mActivity; | ||
private ScrollView mScrollViewForPolicy; | ||
private View mNtpHeader; | ||
private FrameLayout mRootView; | ||
|
||
public BraveFeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarManager, | ||
TabModelSelector tabModelSelector, Supplier<Tab> tabProvider, | ||
@Nullable SnapScrollHelper snapScrollHelper, @Nullable View ntpHeader, | ||
@Nullable SectionHeaderView sectionHeaderView, ActionApi actionApi, | ||
boolean showDarkBackground, FeedSurfaceDelegate delegate, | ||
@Nullable NativePageNavigationDelegate pageNavigationDelegate, Profile profile) { | ||
super(activity, snackbarManager, tabModelSelector, tabProvider, snapScrollHelper, ntpHeader, | ||
sectionHeaderView, actionApi, showDarkBackground, delegate, pageNavigationDelegate, | ||
profile); | ||
} | ||
|
||
@Override | ||
void createScrollViewForPolicy() { | ||
super.createScrollViewForPolicy(); | ||
|
||
// Remove previous view to recreate it a way we need for our NTP. | ||
UiUtils.removeViewFromParent(mScrollViewForPolicy); | ||
// Here we need to get rid of resizer and call setFillViewport. | ||
mScrollViewForPolicy = new ScrollView(mActivity); | ||
mScrollViewForPolicy.setBackgroundColor( | ||
ApiCompatibilityUtils.getColor(mActivity.getResources(), R.color.default_bg_color)); | ||
mScrollViewForPolicy.setVerticalScrollBarEnabled(false); | ||
|
||
// Make scroll view focusable so that it is the next focusable view when the url bar clears | ||
// focus. | ||
mScrollViewForPolicy.setFocusable(true); | ||
mScrollViewForPolicy.setFocusableInTouchMode(true); | ||
mScrollViewForPolicy.setContentDescription( | ||
mScrollViewForPolicy.getResources().getString(R.string.accessibility_new_tab_page)); | ||
|
||
if (mNtpHeader != null) { | ||
UiUtils.removeViewFromParent(mNtpHeader); | ||
mScrollViewForPolicy.addView(mNtpHeader); | ||
} | ||
mRootView.addView(mScrollViewForPolicy); | ||
mScrollViewForPolicy.setFillViewport(true); | ||
mScrollViewForPolicy.requestFocus(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.