[NextBrowser][DF250404-00578] File scheme url redirected to search 25/322325/4
authorjmroman <jm.roman@samsung.com>
Mon, 7 Apr 2025 14:08:41 +0000 (22:08 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 8 Apr 2025 05:01:32 +0000 (05:01 +0000)
Instead of blocking navigations regarding file URLs, they are now
redirected as query in the search engine.

Change-Id: I9e8c25c420b60c1468a0a7b51b52a8ddbbcb7de3
Signed-off-by: jmroman <jm.roman@samsung.com>
chrome/browser/ui/browser_navigator.cc
components/omnibox/browser/autocomplete_input.cc

index 66ecc8efc187c85d9646534aab1c983d25e7c061..9dc4cff234f12bcf45b054ad8f31d1ee56ae73ac 100644 (file)
@@ -604,14 +604,10 @@ base::WeakPtr<content::NavigationHandle> Navigate(NavigateParams* params) {
     // Block any navigation requests in locked fullscreen mode.
     return nullptr;
   }
-#if defined(SAMSUNG_NEXT_BROWSER)
-  if (params->url.SchemeIsFileSystem() || params->url.SchemeIsFile())
-    return nullptr;
-#endif  // SAMSUNG_NEXT_BROWSER
 
-    // Open System Apps in their standalone window if necessary.
-    // TODO(crbug.com/1096345): Remove this code after we integrate with intent
-    // handling.
+  // Open System Apps in their standalone window if necessary.
+  // TODO(crbug.com/1096345): Remove this code after we integrate with intent
+  // handling.
 #if BUILDFLAG(IS_CHROMEOS_ASH)
   const absl::optional<ash::SystemWebAppType> capturing_system_app_type =
       ash::GetCapturingSystemAppForURL(params->initiating_profile, params->url);
index ce00ce8638fc2111cc074f47835e3b545540fc0d..878449bdb33112af81a55322a77cc31732f231d1 100644 (file)
@@ -298,8 +298,8 @@ metrics::OmniboxInputType AutocompleteInput::Parse(
     // A user might or might not type a scheme when entering a file URL.  In
     // either case, |parsed_scheme_utf8| will tell us that this is a file URL,
     // but |parts->scheme| might be empty, e.g. if the user typed "C:\foo".
-
-#if (BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID))
+#if (BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID) || \
+     defined(SAMSUNG_NEXT_BROWSER))
     // On iOS and Android, which cannot display file:/// URLs, treat this case
     // like a query.
     return metrics::OmniboxInputType::QUERY;