Skip to content

Commit

Permalink
Fixes build error on iOS.
Browse files Browse the repository at this point in the history
Upstream added code for Android (and not in cr129 yet) for iOS, but the
inlcudes aren't guarded for the those platforms. The dependency is
missing in upstream code.

> gn gen /Users/jenkins/jenkins/workspace/brave-core-build-pr-ios_PR-25528/src/out/ios_Debug_simulator --check
 ERROR at //components/omnibox/browser/verbatim_match.cc:15:11: Include not allowed.
 #include "content/public/common/url_constants.h"
           ^------------------------------------
 It is not in any dependency of
   //components/omnibox/browser:browser
 The include file is in the target(s):
   //brave/extensions:common

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/04938340e1a93e5e5588badd5e01600dd3356d52

Cr129:

commit 4d2cab773589a430dfae515994c3e6cad0eb0270
Author: Tomasz Wiszkowski <ender@google.com>
Date:   Tue Sep 10 17:59:43 2024 +0000

    [M129] Disallow VerbatimMatches to open non-navigable URLs by default.

    This change prevents non-navigable URLs from being opened upon paste,
    refine, autocomplete etc., effectively disallowing accidental execution
    of inline javascript: blocks.

    The non-navigable (e.g. executable) URIs will be effectively pushed
    down on the suggestions list, making them still available, but
    moving forward these will require an explicit user action to be
    invoked (i.e. the user now has to intentionally tap these suggestions
    to initiate the corresponding action).

    The change removes redundant test that relies on inline page
    injection. This is already covered by another test:
    http://shortn/_NG1M484b41

    (cherry picked from commit 04938340e1a93e5e5588badd5e01600dd3356d52)

    Bug: b/360642942
  • Loading branch information
mkarolin committed Sep 11, 2024
1 parent 4c48350 commit 97aab4f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/omnibox/browser/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ brave_components_omnibox_browser_deps = [
"//url",
]

# Looks like an upstream bug:
# https://chromium-review.googlesource.com/c/chromium/src/+/5814284/7/component
# s/omnibox/browser/verbatim_match.cc#15. Note, that for iOS we add the header
# content/public/common/url_constants.h to //brave/extensions:common target.
if (is_ios) {
brave_components_omnibox_browser_deps += [ "//brave/extensions:common" ]
} else {
brave_components_omnibox_browser_deps += [ "//content/public/common" ]
}

if (enable_ai_chat) {
brave_components_omnibox_browser_sources += [
"//brave/components/omnibox/browser/leo_action.cc",
Expand Down

0 comments on commit 97aab4f

Please sign in to comment.