Skip to content

Commit

Permalink
Upgrade from Chromium 131.0.6778.24 to Chromium 131.0.6778.39 (1.74.x…
Browse files Browse the repository at this point in the history
…). (#26425)

* Upgrade from Chromium 131.0.6778.24 to Chromium 131.0.6778.39

* Update pins list timestamp

* Updated strings for Chromium 131.0.6778.39

* [cr132] `IsURLAllowedInIncognito` dropped `BrowserContext`

After discussion, we decided to eliminate the wallet check from
IsURLAllowedInIncognito instead allowing brave_wallet::IsAllowedForContext to
perform the required check. This does mean that if the "Allow wallet URLs in
private windows" option is not enabled and a user opens a wallet URL in a
private window it will result in a load failure rather than redirect to a normal
window.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/00708f413a9c2b37699a92cfadcdd18d872ffa2a

commit 00708f413a9c2b37699a92cfadcdd18d872ffa2a
Author: Thomas Lukaszewicz <[email protected]>
Date:   Mon Oct 21 19:41:59 2024 +0000

    Eliminate unused BrowserContext* param from IsURLAllowedInIncognito()

    Removes the param from the function and cleans up client code.

    Bug: 368059979

* Disables failing/crashing upstream browser tests.

---------

Co-authored-by: brave-builds <[email protected]>
Co-authored-by: Emerick Rogul <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2024
1 parent a8e7367 commit 6244f6a
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 56 deletions.
53 changes: 34 additions & 19 deletions browser/brave_scheme_load_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,32 @@ class BraveSchemeLoadBrowserTest : public InProcessBrowserTest,
EXPECT_EQ(1, private_browser->tab_strip_model()->count());
}

// Check loading |url| wallet URL in private window results in a load failure
void TestURLIsNotLoadedInPrivateWindowOrRedirected(const std::string& url) {
Browser* private_browser = CreateIncognitoBrowser(nullptr);
TabStripModel* private_model = private_browser->tab_strip_model();

// Check normal & private window have one blank tab.
EXPECT_EQ("about:blank",
private_model->GetActiveWebContents()->GetVisibleURL().spec());
EXPECT_EQ(1, private_model->count());
EXPECT_EQ("about:blank", active_contents()->GetVisibleURL().spec());
EXPECT_EQ(1, browser()->tab_strip_model()->count());

// Unable to navigate expected url.
EXPECT_FALSE(content::NavigateToURL(private_model->GetActiveWebContents(),
GURL(url)));
auto* entry = private_model->GetActiveWebContents()
->GetController()
.GetLastCommittedEntry();
EXPECT_EQ(entry->GetPageType(), content::PageType::PAGE_TYPE_ERROR);
EXPECT_STREQ("about:blank",
base::UTF16ToUTF8(
browser()->location_bar_model()->GetFormattedFullURL())
.c_str());
EXPECT_EQ(1, browser()->tab_strip_model()->count());
}

void TestURLIsLoadedInPrivateWindow(const std::string& url) {
Browser* private_browser = CreateIncognitoBrowser();
TabStripModel* private_model = private_browser->tab_strip_model();
Expand Down Expand Up @@ -301,23 +327,16 @@ IN_PROC_BROWSER_TEST_F(BraveSchemeLoadBrowserTest,
// window. chrome scheme is used because brave scheme is already replaced with
// chrome when IsURLAllowedInIncognito() is called. Verify brave scheme url
// with TestURLIsNotLoadedInPrivateWindow().
EXPECT_FALSE(
IsURLAllowedInIncognito(GURL("chrome://rewards"), browser()->profile()));
EXPECT_TRUE(
IsURLAllowedInIncognito(GURL("http://rewards"), browser()->profile()));
EXPECT_FALSE(IsURLAllowedInIncognito(GURL("chrome://rewards")));
EXPECT_TRUE(IsURLAllowedInIncognito(GURL("http://rewards")));
TestURLIsNotLoadedInPrivateWindow("brave://rewards");
}

IN_PROC_BROWSER_TEST_F(BraveSchemeLoadBrowserTest,
WalletPageIsNotAllowedInPrivateWindow) {
EXPECT_FALSE(
IsURLAllowedInIncognito(GURL("chrome://wallet"), browser()->profile()));
EXPECT_TRUE(
IsURLAllowedInIncognito(GURL("http://wallet"), browser()->profile()));
TestURLIsNotLoadedInPrivateWindow("brave://wallet");
EXPECT_TRUE(IsURLAllowedInIncognito(GURL("http://wallet")));
TestURLIsNotLoadedInPrivateWindowOrRedirected("brave://wallet");
prefs()->SetBoolean(kBraveWalletPrivateWindowsEnabled, true);
EXPECT_TRUE(
IsURLAllowedInIncognito(GURL("brave://wallet"), browser()->profile()));
TestURLIsLoadedInPrivateWindow("chrome://wallet/crypto/onboarding/welcome");
}

Expand All @@ -328,19 +347,15 @@ IN_PROC_BROWSER_TEST_F(BraveSchemeLoadBrowserTest,

IN_PROC_BROWSER_TEST_F(BraveSchemeLoadBrowserTest,
BraveSyncPageIsNotAllowedInPrivateWindow) {
EXPECT_FALSE(
IsURLAllowedInIncognito(GURL("chrome://sync"), browser()->profile()));
EXPECT_TRUE(
IsURLAllowedInIncognito(GURL("http://sync"), browser()->profile()));
EXPECT_FALSE(IsURLAllowedInIncognito(GURL("chrome://sync")));
EXPECT_TRUE(IsURLAllowedInIncognito(GURL("http://sync")));
TestURLIsNotLoadedInPrivateWindow("brave://sync");
}

IN_PROC_BROWSER_TEST_F(BraveSchemeLoadBrowserTest,
BraveWelcomePageIsNotAllowedInPrivateWindow) {
EXPECT_FALSE(
IsURLAllowedInIncognito(GURL("chrome://welcome"), browser()->profile()));
EXPECT_TRUE(
IsURLAllowedInIncognito(GURL("http://welcome"), browser()->profile()));
EXPECT_FALSE(IsURLAllowedInIncognito(GURL("chrome://welcome")));
EXPECT_TRUE(IsURLAllowedInIncognito(GURL("http://welcome")));
TestURLIsNotLoadedInPrivateWindow("brave://welcome");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ bool BraveRenderViewContextMenu::IsCommandIdEnabled(int id) const {
}

return params_.link_url.is_valid() &&
IsURLAllowedInIncognito(params_.link_url, browser_context_) &&
IsURLAllowedInIncognito(params_.link_url) &&
!GetProfile()->IsTor();
#else
return false;
Expand Down
17 changes: 3 additions & 14 deletions chromium_src/chrome/browser/ui/browser_navigator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

#include <string_view>

#include "brave/components/brave_wallet/browser/pref_names.h"
#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_navigator_params.h"
// Needed to prevent overriding url_typed_with_http_scheme
#include "chrome/browser/ui/location_bar/location_bar.h"
#include "chrome/common/webui_url_constants.h"
#include "components/prefs/pref_service.h"
#include "components/user_prefs/user_prefs.h"
#include "url/gurl.h"

namespace {
Expand All @@ -26,9 +23,7 @@ void UpdateBraveScheme(NavigateParams* params) {
}
}

bool IsURLAllowedInIncognitoBraveImpl(
const GURL& url,
content::BrowserContext* browser_context) {
bool IsURLAllowedInIncognitoBraveImpl(const GURL& url) {
std::string scheme = url.scheme();
std::string_view host = url.host_piece();
if (scheme != content::kChromeUIScheme) {
Expand All @@ -41,12 +36,6 @@ bool IsURLAllowedInIncognitoBraveImpl(
return false;
}

if (host == kWalletPageHost || host == kWalletPanelHost) {
return browser_context &&
user_prefs::UserPrefs::Get(browser_context)
->GetBoolean(kBraveWalletPrivateWindowsEnabled);
}

return true;
}

Expand All @@ -60,8 +49,8 @@ bool IsURLAllowedInIncognitoBraveImpl(
url_typed_with_http_scheme; \
force_no_https_upgrade = false

#define BRAVE_IS_URL_ALLOWED_IN_INCOGNITO \
if (!IsURLAllowedInIncognitoBraveImpl(url, browser_context)) \
#define BRAVE_IS_URL_ALLOWED_IN_INCOGNITO \
if (!IsURLAllowedInIncognitoBraveImpl(url)) \
return false;
#define BRAVE_ADJUST_NAVIGATE_PARAMS_FOR_URL UpdateBraveScheme(params);
#include "src/chrome/browser/ui/browser_navigator.cc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ bool ParseCertificatesFile(std::string_view certs_input,
Pinsets* pinsets,
base::Time* timestamp) {
constexpr std::string_view brave_certs = R"brave_certs(
# Last updated: Thu Oct 31 12:22:52 UTC 2024
# Last updated: Wed Nov 6 23:38:42 UTC 2024
PinsListTimestamp
1730377372
1730936322
# =====BEGIN BRAVE ROOTS ASC=====
#From https://www.amazontrust.com/repository/
Expand Down
13 changes: 11 additions & 2 deletions components/history_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
<message name="IDS_HISTORY_SEARCH_RESULTS" desc="Used when plural/multiple results are found.">
search results
</message>
<message name="IDS_HISTORY_SEARCH_EXACT_MATCH_RESULT" desc="Used when a single exact match result is found." translateable="false">
exact match
</message>
<message name="IDS_HISTORY_SEARCH_EXACT_MATCH_RESULTS" desc="Used when plural/multiple exact match results is found." translateable="false">
exact matches
</message>
<if expr="not use_titlecase">
<message name="IDS_HISTORY_SHOW_HISTORY" desc="The show history menu in the app menu">
&amp;History
Expand Down Expand Up @@ -141,7 +147,7 @@
Get answers from your history, powered by AI
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWERS_PROMO_BODY" desc="On the history page, the body text of the promo for history search powered by AI with answerer." translateable="false">
You can now also ask questions like "what was that square pizza place in Chicago?" or "what ingredients were in that eggplant pasta recipe?". Using question words like "what", "when", or "where" will help Brave give you better answers. You can also describe what you're looking for such as "comfortable walking shoes". As you visit more sites on this device, you'll see more results powered by AI.
You can ask questions like "what ingredients were in that pasta recipe?" Using question words like "what" or "where" helps Brave give you better answers. Or describe what you're looking for in a few words. As you visit more sites, you'll see more AI-powered results.
</message>
<message name="IDS_HISTORY_EMBEDDIGNS_PROMO_SETTINGS_LINK_TEXT" desc="On the history page, the text of the link to edit the user's history search setting." translateable="false">
Manage your history search setting
Expand Down Expand Up @@ -213,14 +219,17 @@
Summary
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWER_LOADING_HEADING" desc="Heading for answer section in history search results when the answer is loading." translateable="false">
Generating summary based on your browsing history
Searching for a summary...
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWER_SOURCE_VISIT_DATE_LABEL" desc="Label for visited date for answer section in history search results." translateable="false">
Visited <ph name="DATE"><ex>Oct 4, 2024</ex>$1</ph>
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWERER_ERROR_UNANSWERABLE" desc="Error message for when history embeddings answerer determines a question cannot be answered." translateable="false">
Sorry, I can't help you with that.
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWERER_ERROR_MODEL_UNAVAILABLE" desc="Error message for when the files necessary for the history embeddings answerer to generate answers to questions are not yet available. User should be encouraged to try again later" translateable="false">
Preparing AI-powered summary...check back in a few minutes.
</message>
<message name="IDS_HISTORY_EMBEDDINGS_ANSWERER_ERROR_TRY_AGAIN" desc="Error message for when history embeddings answerer fails and the user can try again later." translateable="false">
Something went wrong. Please try again later.
</message>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"projects": {
"chrome": {
"dir": "src",
"tag": "131.0.6778.24",
"tag": "131.0.6778.39",
"repository": {
"url": "https://github.com/brave/chromium"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index db228a497bd288bad6c4b28259ee9f9070607e2e..59956927f079c514f70495322b8ae443491faccf 100644
index 31f179bf8f410adfffaa540f4b0f0b84c8a32fea..b4e769b8ab905560c84f27f72152859f9dd94a14 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -2413,6 +2413,7 @@ void RenderViewContextMenu::AppendSearchProvider() {
@@ -2414,6 +2414,7 @@ void RenderViewContextMenu::AppendSearchProvider() {
if (!selection_navigation_url_.is_valid()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h
index 0266119ae401068dbfbb7905a5a087c52b249dd7..63bd71b579e61bf5b9b164c0db6d0a8bb04eef78 100644
index 0bb9353cb7da0a6603984809247075e6168c8e20..82d856b538096ee631bed6a169883118b2563827 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -198,6 +198,7 @@ class RenderViewContextMenu
Expand Down
6 changes: 3 additions & 3 deletions patches/chrome-browser-ui-browser.cc.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index e87612be406274364fd125e7e89e803aa21702d8..bb8d0e5261d708475ed6c492eaa7fb7fd1c370d0 100644
index df205a82b34c48aba5ffc1b27f834613343cfaa1..c39800cb0a6f9446fdcf58bc61b9af595687a0f6 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -529,6 +529,7 @@ Browser* Browser::Create(const CreateParams& params) {
@@ -527,6 +527,7 @@ Browser* Browser::Create(const CreateParams& params) {
// not possible, e.g. using the wrong profile or during shutdown. The caller
// should handle this; see e.g. crbug.com/1141608 and crbug.com/1261628.
CHECK_EQ(CreationStatus::kOk, GetCreationStatusForProfile(params.profile));
+ BRAVE_BROWSER_CREATE
return new Browser(params);
}

@@ -539,7 +540,7 @@ Browser::Browser(const CreateParams& params)
@@ -537,7 +538,7 @@ Browser::Browser(const CreateParams& params)
window_(nullptr),
tab_strip_model_delegate_(
std::make_unique<chrome::BrowserTabStripModelDelegate>(this)),
Expand Down
10 changes: 5 additions & 5 deletions patches/chrome-browser-ui-browser_navigator.cc.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 70d7f4fbda71c935f08bd90346849d931f5f6821..675200b674cef638e8f627256c084682dadc66c3 100644
index f180b15994c6c680d9b7f82eff484b97a8b78b1f..847abbf29e567c8ac1f2abbe60a78c06b3e845d1 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -627,6 +627,7 @@ base::WeakPtr<content::NavigationHandle> Navigate(NavigateParams* params) {
@@ -661,6 +661,7 @@ base::WeakPtr<content::NavigationHandle> Navigate(NavigateParams* params) {
return nullptr;
}
}
+ BRAVE_ADJUST_NAVIGATE_PARAMS_FOR_URL

// Open System Apps in their standalone window if necessary.
// TODO(crbug.com/40136163): Remove this code after we integrate with intent
@@ -1044,6 +1045,7 @@ bool IsURLAllowedInIncognito(const GURL& url,
return stripped_url.is_valid() &&
IsURLAllowedInIncognito(stripped_url, browser_context);
@@ -1043,6 +1044,7 @@ bool IsURLAllowedInIncognito(const GURL& url) {
}
return stripped_url.is_valid() && IsURLAllowedInIncognito(stripped_url);
}
+ BRAVE_IS_URL_ALLOWED_IN_INCOGNITO

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/ui/webui/history/history_ui.cc b/chrome/browser/ui/webui/history/history_ui.cc
index 0dfc36945e1c2da433d47c794b00131650337b93..0a4939829469111fc8f17bc83d7edf373a99643a 100644
index 7a01cb4254b2ee1536e6e06c46d73bf676ec5057..f12a45a4f58ca217d16d13c44bbc4a2d0c229ad5 100644
--- a/chrome/browser/ui/webui/history/history_ui.cc
+++ b/chrome/browser/ui/webui/history/history_ui.cc
@@ -90,6 +90,7 @@ content::WebUIDataSource* CreateAndAddHistoryUIHTMLSource(Profile* profile) {
Expand Down
2 changes: 1 addition & 1 deletion patches/chrome-test-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index b6735af2c2be3866405ee173a04a920fc5104410..d9da0c0cab9bd9bc2132e271cf095f9ba8cf5ed1 100644
index fc8f3418dd4d025c868d695eb63f9adc8e041246..6335658afccb129a043f351f5d655d3236a15be9 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -581,6 +581,7 @@ static_library("test_support") {
Expand Down
2 changes: 1 addition & 1 deletion patches/ios-chrome-browser-flags-about_flags.mm.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm
index 17e7dc7507bf2294fc77c9ba2fa15363bf6bf29e..85a27a2d4d40bb1b8fbcbac7abe7f9be2f05de30 100644
index 58561d0af3fd4b484f50d6e4a71a4439e42c8be8..de9c075c1d63234874d9ae53ea7e6f8221f014d0 100644
--- a/ios/chrome/browser/flags/about_flags.mm
+++ b/ios/chrome/browser/flags/about_flags.mm
@@ -1124,6 +1124,7 @@ const FeatureEntry::FeatureVariation kSendTabIOSPushNotificationsVariations[] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 07f855c52c5c0fd4eb63171ed861b34d6de2e387..b2da10cf5bdaa9a48afc737968248a1762e1f020 100644
index 021b4d87e7db2799bc31e60c48df4c1ab163be32..b30a151ec48edaa29b631e6c1c26e93c967a9872 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1952,6 +1952,7 @@
Expand Down Expand Up @@ -35,7 +35,7 @@ index 07f855c52c5c0fd4eb63171ed861b34d6de2e387..b2da10cf5bdaa9a48afc737968248a17
},
// Killswitch. Remove after 1 or 2 stable releases.
{
@@ -3836,6 +3839,7 @@
@@ -3837,6 +3840,7 @@
{
name: "Serial",
status: {"Android": "", "default": "stable"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/third_party/crashpad/crashpad/util/net/http_transport_win.cc b/third_party/crashpad/crashpad/util/net/http_transport_win.cc
index df444d86a1ed6872a13fd4f132f656e70857ff8a..9ba68bc385520d6ad2b9be7f728dc3672c3eb4ff 100644
index 13856dae8281f65b92274be161ce23ec63ee120c..15bf84060f0d62f575ad7796e681d11a6b5d32db 100644
--- a/third_party/crashpad/crashpad/util/net/http_transport_win.cc
+++ b/third_party/crashpad/crashpad/util/net/http_transport_win.cc
@@ -159,6 +159,8 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
Expand Down
1 change: 1 addition & 0 deletions test/filters/browser_tests.filter
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
-PrerenderDownloadTest.*
-PrerenderFileSystemAccessBrowserTest.*
-PrerenderMainFrameNavigationBrowserTest.*
-PrerenderNewTabPageBrowserTest.*
-PrerenderOmniboxSearchSuggestionBrowserTest.*
-PrerenderOmniboxSearchSuggestionExpiryBrowserTest.*
-PrerenderOmniboxSearchSuggestionReloadBrowserTest.BackNavigationHitsHttpCache
Expand Down

0 comments on commit 6244f6a

Please sign in to comment.