Commit 8a5eba0a authored by David Jacobo's avatar David Jacobo Committed by Commit Bot

Enforce ARC apps are disabled on incognito mode

ARC apps are added to the context menu to allow the user to handle
certain urls via an installed app.

However these apps shoudln't be added to such UI while in incognito
mode, this CL enforces that.

Bug: b/112107069
Test: Try.
Change-Id: I200e38403f07301fb5d90fd6a381c57a0d150872
Reviewed-on: https://chromium-review.googlesource.com/1168146Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: David Jacobo <djacobo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581793}
parent f63136f8
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/renderer_context_menu/render_view_context_menu_proxy.h" #include "components/renderer_context_menu/render_view_context_menu_proxy.h"
#include "content/public/browser/browser_context.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -45,6 +46,10 @@ OpenWithMenu::OpenWithMenu(content::BrowserContext* context, ...@@ -45,6 +46,10 @@ OpenWithMenu::OpenWithMenu(content::BrowserContext* context,
OpenWithMenu::~OpenWithMenu() = default; OpenWithMenu::~OpenWithMenu() = default;
void OpenWithMenu::InitMenu(const content::ContextMenuParams& params) { void OpenWithMenu::InitMenu(const content::ContextMenuParams& params) {
// Enforcing no items are added to the context menu during incognito mode.
if (context_->IsOffTheRecord())
return;
menu_model_ = LinkHandlerModel::Create(context_, params.link_url); menu_model_ = LinkHandlerModel::Create(context_, params.link_url);
if (!menu_model_) if (!menu_model_)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment