Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ __pycache__/
!src/extensions/strings/BUILD.gn
!src/infra/config/generated/testing/variants.pyl
!src/infra/config/targets/lacros-version-skew-variants.jso
!src/media/BUILD.gn
!src/media/filters/BUILD.gn
!src/mojo/public/tools/mojom/mojom_parser.py
!src/remoting/resources/remoting_strings.grd
Expand Down
420 changes: 264 additions & 156 deletions src/DEPS

Large diffs are not rendered by default.

527 changes: 409 additions & 118 deletions src/base/BUILD.gn

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ if (is_android || is_chromeos) {

# Forced Android versionCode

android_override_version_code = "112"
android_override_version_code = "130"

# Forced Android versionName
android_override_version_name = "0.90"
android_override_version_name = "1.01"

# The path to the keystore to use for signing builds.
android_keystore_path = default_android_keystore_path
Expand Down
4 changes: 3 additions & 1 deletion src/cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ class LayerTreeHostImpl::ImageDecodeCacheHolder {

private:
std::unique_ptr<ImageDecodeCache> image_decode_cache_;
raw_ptr<ImageDecodeCache> image_decode_cache_ptr_ = nullptr;
// RAW_PTR_EXCLUSION: ImageDecodeCache is marked as not supported by raw_ptr.
// See raw_ptr.h for more information.
RAW_PTR_EXCLUSION ImageDecodeCache* image_decode_cache_ptr_ = nullptr;
};

void LayerTreeHostImpl::DidUpdateScrollAnimationCurve() {
Expand Down
1 change: 0 additions & 1 deletion src/chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ if (current_toolchain == default_toolchain) {
"//url:gurl_java",
"//url/mojom:url_mojom_gurl_java",
"//url/mojom:url_mojom_origin_java",

]

deps += feed_deps
Expand Down
1 change: 0 additions & 1 deletion src/chrome/android/chrome_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/bookmarks/ImprovedBookmarkSaveFlowProperties.java",
"java/src/org/chromium/chrome/browser/bookmarks/ImprovedBookmarkSaveFlowView.java",
"java/src/org/chromium/chrome/browser/bookmarks/ImprovedBookmarkSaveFlowViewBinder.java",
"java/src/org/chromium/chrome/browser/bookmarks/PageImageServiceQueue.java",
"java/src/org/chromium/chrome/browser/bookmarks/PendingRunnable.java",
"java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkMetrics.java",
"java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkUtils.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,4 +1356,4 @@ void updateBackgroundColor(PropertyModel propertyModel) {
void setIsIncognitoForTesting(boolean isIncognito) {
mIsIncognito = isIncognito;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.IntDef;
Expand All @@ -26,11 +27,11 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener;

import android.content.res.Configuration;
import org.chromium.base.Callback;
import org.chromium.base.Log;
import org.chromium.base.TraceEvent;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
Expand Down Expand Up @@ -497,7 +498,8 @@ public void onLayoutCompleted(RecyclerView.State state) {
.getDecorView()
.getWindowVisibleDisplayFrame(frame);
updateGridCardLayout(frame.width());
} else if (mMode == TabListMode.STRIP) {
} else if (mMode == TabListMode.STRIP
|| mMode == TabListMode.LIST) {
LinearLayoutManager layoutManager =
new LinearLayoutManager(
context,
Expand All @@ -512,17 +514,6 @@ public void onLayoutCompleted(RecyclerView.State state) {
}
};
mRecyclerView.setLayoutManager(layoutManager);
} else if (mMode == TabListMode.LIST) {
LinearLayoutManager layout =
new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) {
@Override
public void onLayoutCompleted(RecyclerView.State state) {
super.onLayoutCompleted(state);
checkAwaitingLayout();
}
};
layout.setStackFromEnd(true);
mRecyclerView.setLayoutManager(layout);
}
mMediator.setRecyclerViewItemAnimationToggle(mRecyclerView::setDisableItemAnimations);
}
Expand All @@ -545,6 +536,11 @@ public void onLayoutCompleted(RecyclerView.State state) {
}
}

/** Returns the {@link TabListMode} of the coordinator. */
public @TabListMode int getTabListMode() {
return mMode;
}

/**
* @param onLongPressTabItemEventListener to handle long press events on tabs.
*/
Expand Down Expand Up @@ -1006,4 +1002,4 @@ private int getIndexForTabId(int tabId) {
void showQuickDeleteAnimation(Runnable onAnimationEnd, List<Tab> tabs) {
mMediator.showQuickDeleteAnimation(onAnimationEnd, tabs, mRecyclerView);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ public void attachEmptyView() {
FrameLayout.LayoutParams emptyViewParams =
(FrameLayout.LayoutParams) mEmptyView.getLayoutParams();
int toolbarHeightPx = mBrowserControlsStateProvider.getTopControlsHeight();

emptyViewParams.bottomMargin = toolbarHeightPx;

mEmptyView.setLayoutParams(emptyViewParams);
}
setEmptyViewVisibility(View.GONE);
Expand Down
1 change: 0 additions & 1 deletion src/chrome/android/java/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1546,4 +1546,3 @@ by a child template that "extends" this file.
{% block extra_root_definitions %}
{% endblock %}
</manifest>

8 changes: 6 additions & 2 deletions src/chrome/android/java/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ found in the LICENSE file.
dialog is shown on tablet. -->
<style name="Theme.Chromium.SigninAndHistoryOptInActivity"
parent="Theme.Chromium.Activity.Fullscreen">
<item name="android:windowBackground">@color/default_scrim_color</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowEnterAnimation">@null</item>
<item name="android:windowExitAnimation">@null</item>
Expand Down Expand Up @@ -725,7 +725,11 @@ found in the LICENSE file.
<style name="TextAppearance.ShoppingPriceDropText" parent="TextAppearance.TextMedium.Secondary">
<item name="android:textColor">@color/price_drop_annotation_text_green</item>
</style>
<style name="TextAppearance.FolderChildCount" parent="TextAppearance.TextLarge.Primary.OnAccent1Container" tools:ignore="SpUsage">
<style name="TextAppearance.SpecialFolderChildCount" parent="TextAppearance.TextLarge.Primary.OnAccent1Container" tools:ignore="SpUsage">
<!-- The same as the regular style, but using dp instead of sp. -->
<item name="android:textSize">16dp</item>
</style>
<style name="TextAppearance.RegularFolderChildCount" parent="TextAppearance.TextLarge.Primary" tools:ignore="SpUsage">
<!-- The same as the regular style, but using dp instead of sp. -->
<item name="android:textSize">16dp</item>
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,7 @@ public void onCreate() {

if (SplitCompatApplication.isBrowserProcess()) {
Log.e(TAG, "Initializing Chrome browser process");

// Initialize Branch SDK first
try {
Log.e(TAG, "Initializing Branch SDK");

// For Android 9, we need to set the user agent string before initialization
if (android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.P) {
Log.e(TAG, "Setting user agent string for Android 9");

// Set system user agent property to avoid WebView PacProcessor crash on Android 9
System.setProperty("http.agent", "Mozilla/5.0 (Linux; Android 9; Mobile) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36");

// Tell Branch SDK to use synchronous user agent fetching on Android 9
// This avoids the coroutine that causes the crash
Branch.setIsUserAgentSync(true);
}

// Initialize Branch SDK as normal
io.branch.referral.Branch.enableLogging();
io.branch.referral.Branch branch = io.branch.referral.Branch.getAutoInstance(getApplication());
Log.e(TAG, "Branch SDK initialized successfully");

} catch (Exception e) {
Log.e(TAG, "Error initializing Branch SDK: " + e.getMessage(), e);
}


// Check Android version
checkAndroidVersion();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@
import io.branch.referral.Branch;
import io.branch.referral.BranchError;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.ChromeTabbedActivity;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -291,6 +290,7 @@
public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent>
implements MismatchedIndicesHandler {
private static final String TAG = "ChromeTabbedActivity";

private boolean isFirstRun = true;
protected static final String WINDOW_INDEX = "window_index";

Expand Down Expand Up @@ -1650,7 +1650,6 @@ public void initializeState() {
try {
TraceEvent.begin("ChromeTabbedActivity.initializeState");

// Get the default extension from SharedPreferences
super.initializeState();
Log.i(TAG, "#initializeState");
Intent intent = getIntent();
Expand Down Expand Up @@ -1848,27 +1847,26 @@ private boolean hasStartWithNativeBeenCalled() {
/** Create an initial tab for cold start without restored tabs. */
private void createInitialTab() {
Log.i(TAG, "#createInitialTab executed.");

mPendingInitialTabCreation = false;

// If the start surface or grid tab switcher will be shown on start, do not create a new
// tab.
String url = null;
boolean shouldShowOverviewPageOnStart = shouldShowOverviewPageOnStart();
if (!shouldShowOverviewPageOnStart) {
GURL homepageGurl = HomepageManager.getInstance().getHomepageGurl();
if (homepageGurl.isEmpty()) {
GURL homepageGurl = HomepageManager.getInstance().getHomepageGurl();
if (homepageGurl.isEmpty()) {
url = UrlConstants.NTP_URL;
} else {
// Migrate legacy NTP URLs (chrome://newtab) to the newer format
// (chrome-native://newtab)
if (UrlUtilities.isNtpUrl(homepageGurl)) {
url = UrlConstants.NTP_URL;
} else {
// Migrate legacy NTP URLs (chrome://newtab) to the newer format
// (chrome-native://newtab)
if (UrlUtilities.isNtpUrl(homepageGurl)) {
url = UrlConstants.NTP_URL;
} else {
url = homepageGurl.getSpec();
}
url = homepageGurl.getSpec();
}
getTabCreator(false).launchUrl(url, TabLaunchType.FROM_STARTUP);
}
getTabCreator(false).launchUrl(url, TabLaunchType.FROM_STARTUP);

// Check if this is first run using SharedPreferences instead of a local variable
SharedPreferences prefs = getSharedPreferences(
Expand Down Expand Up @@ -1911,7 +1909,6 @@ private void createInitialTab() {
maybeLaunchHistory();
}


private void recordExternalIntentSourceUMA(Intent intent) {
@IntentHandler.ExternalAppId
int externalId = IntentHandler.determineExternalIntentSource(intent);
Expand Down Expand Up @@ -2064,7 +2061,8 @@ private void processUrlViewIntent(
return;
}

if (!IncognitoUtils.isIncognitoModeEnabled()) {
if (!IncognitoUtils.isIncognitoModeEnabled(
getProfileProviderSupplier().get().getOriginalProfile())) {
// The incognito launcher shortcut is manipulated in #onDeferredStartup(),
// so it's possible for a user to invoke the shortcut before it's disabled.
// Quick actions search widget is installed on the home screen and may
Expand Down Expand Up @@ -2212,8 +2210,6 @@ private boolean maybeLaunchDraggedTabInWindow(Intent intent) {
public void performPreInflationStartup() {
super.performPreInflationStartup();



// Android FrameMetrics allow tracking of java views and their deadline misses (frame
// drops/janks).
if (ChromeFeatureList.sCollectAndroidFrameTimelineMetrics.isEnabled()) {
Expand Down Expand Up @@ -2724,7 +2720,8 @@ private void onDeferredStartup() {
return;
}

LauncherShortcutActivity.updateIncognitoShortcut(ChromeTabbedActivity.this);
LauncherShortcutActivity.updateIncognitoShortcut(
ChromeTabbedActivity.this, mTabModelProfileSupplier.get());

ChromeSurveyController.initialize(
mTabModelSelector,
Expand Down Expand Up @@ -2940,9 +2937,10 @@ public boolean onMenuOrKeyboardAction(final int id, boolean fromMenu) {

mLocaleManager.showSearchEnginePromoIfNeeded(this, null);
} else if (id == R.id.new_incognito_tab_menu_id) {
if (IncognitoUtils.isIncognitoModeEnabled()) {
if (!mTabModelSelector.isTabStateInitialized()) return false;
if (!mTabModelSelector.isTabStateInitialized()) return false;

Profile profile = mTabModelSelector.getCurrentModel().getProfile();
if (IncognitoUtils.isIncognitoModeEnabled(profile)) {
getTabModelSelector().getModel(false).commitAllTabClosures();
// This action must be recorded before opening the incognito tab since UMA actions
// are dropped when an incognito tab is open.
Expand All @@ -2951,9 +2949,7 @@ public boolean onMenuOrKeyboardAction(final int id, boolean fromMenu) {
reportNewTabShortcutUsed(true);
if (fromMenu) RecordUserAction.record("MobileMenuNewIncognitoTab.AppMenu");
getTabCreator(true).launchNtp();
Tracker tracker =
TrackerFactory.getTrackerForProfile(
mTabModelSelector.getCurrentModel().getProfile());
Tracker tracker = TrackerFactory.getTrackerForProfile(profile);
tracker.notifyEvent(EventConstants.APP_MENU_NEW_INCOGNITO_TAB_CLICKED);
}
} else if (id == R.id.all_bookmarks_menu_id) {
Expand Down Expand Up @@ -3818,11 +3814,14 @@ private boolean shouldShowOverviewPageOnStart() {
public void onStart() {
try (TraceEvent e = TraceEvent.scoped("ChromeTabbedActivity.onStart")) {
super.onStart();

JSONObject firstReferringParams = Branch.getInstance().getFirstReferringParams();
Log.e(TAG, "First referring params: " + firstReferringParams.toString());
handleBranchDeepLinkParams(firstReferringParams);
}
catch(Exception ex) {
Log.e(TAG, "Exception in onStart", ex);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ public static String extractUtmParameter(Uri uri, String paramName) {
* @param intent The intent to check.
* @return True if the splash screen was shown, false otherwise.
*/
public static boolean checkAndShowCustomSplash(Activity activity, Intent intent) {
if (intent != null && intent.getData() != null) {
Uri uri = intent.getData();
String utmSource = extractUtmParameter(uri, "utm_source");
Log.e("IntentHandler", "UTM source: of the god itself " + (utmSource != null ? utmSource : "null"));
// onIntentReceived(intent);
}
return false;
}

/** Tab ID to use when creating a new Tab. */
private static final String EXTRA_TAB_ID = "com.android.chrome.tab_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.toolbar.ToolbarManager;
import org.chromium.chrome.browser.translate.TranslateUtils;
// import org.chromium.chrome.browser.ui.appmenu.AppMenu;
import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler;
import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler.AppMenuItemType;
import org.chromium.chrome.browser.ui.appmenu.AppMenuItemProperties;
Expand Down Expand Up @@ -374,6 +373,7 @@ ModelList getMenuItemsForMenu(
propertyModel.set(AppMenuItemProperties.SUPPORT_ENTER_ANIMATION, true);
propertyModel.set(AppMenuItemProperties.MENU_ICON_AT_START, isMenuIconAtStart());
propertyModel.set(AppMenuItemProperties.TITLE_CONDENSED, getContentDescription(item));
propertyModel.set(AppMenuItemProperties.MANAGED, isMenuItemManaged(item));
if (item.hasSubMenu()) {
// Only support top level menu items have SUBMENU, and a SUBMENU item cannot have a
// SUBMENU.
Expand Down Expand Up @@ -1099,6 +1099,15 @@ private void maybeInsertReadAloudItem(MenuItem item) {
}
}

/** Return whether the given {@link MenuItem} is managed by policy. */
protected boolean isMenuItemManaged(MenuItem item) {
if (item.getItemId() == R.id.new_incognito_tab_menu_id) {
return IncognitoUtils.isIncognitoModeManaged(
mTabModelSelector.getCurrentModel().getProfile());
}
return false;
}

/** Returns true if a badge (i.e. a red-dot) should be shown on the menu item icon. */
protected boolean shouldShowBadgeOnMenuItemIcon(MenuItem item) {
if (item.getItemId() == R.id.preferences_id) {
Expand Down Expand Up @@ -1407,7 +1416,8 @@ protected void updateManagedByMenuItem(Menu menu, @Nullable Tab currentTab) {

@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public boolean isIncognitoEnabled() {
return IncognitoUtils.isIncognitoModeEnabled();
return IncognitoUtils.isIncognitoModeEnabled(
mTabModelSelector.getCurrentModel().getProfile());
}

static void setPageBookmarkedForTesting(Boolean bookmarked) {
Expand Down
Loading