[gIRA] Return an empty list when off the record. Bug: 1045506 Change-Id: I3e8b192331c848241848e754ffde0309b620efcc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022669 Commit-Queue: Rayan Kanso <rayankans@chromium.org> Commit-Queue: Peter Beverloo <peter@chromium.org> Auto-Submit: Rayan Kanso <rayankans@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Cr-Commit-Position: refs/heads/master@{#735432}
diff --git a/content/browser/installedapp/installed_app_provider_impl.cc b/content/browser/installedapp/installed_app_provider_impl.cc index 2cf1072c..53fd127 100644 --- a/content/browser/installedapp/installed_app_provider_impl.cc +++ b/content/browser/installedapp/installed_app_provider_impl.cc
@@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" #include "content/browser/installedapp/installed_app_provider_impl.h" +#include "build/build_config.h" #include "content/browser/installedapp/installed_app_provider_impl_win.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_process_host.h" #include "content/public/common/content_features.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" @@ -21,6 +23,11 @@ std::vector<blink::mojom::RelatedApplicationPtr> related_apps, const GURL& manifest_url, FilterInstalledAppsCallback callback) { + if (render_frame_host_->GetProcess()->GetBrowserContext()->IsOffTheRecord()) { + std::move(callback).Run(std::vector<blink::mojom::RelatedApplicationPtr>()); + return; + } + bool is_implemented = false; if (base::FeatureList::IsEnabled(features::kInstalledAppProvider)) { #if defined(OS_WIN)