Open karenkliu opened 4 years ago
cc @simonhong do you know how much effort would it be to have an anchor inside NTP's webUI, which opens up a private/tor window? This issue is on my plans, but I don't know how to do that part.
@cezaraugusto ~~Do you mean adding open private/tor window
entry into context menu on NTP page? If so, we already have code that for it.
BraveRenderViewContextMenu::InitMenu
adds our own entry to context menu.
After checking current active tab page, then we can add that entry if current active tab is NTP.~~
Ah.. I think you want to add these entry to our new custom NTP context menu. If so, I think we should introduce new webui message for requesting this url in new private or tor window. and we can refer the c++ code for opening a link in new private/or window. Below code is what we use so far.
case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
OpenURLWithExtraHeaders(params_.link_url, GURL(),
WindowOpenDisposition::OFF_THE_RECORD,
ui::PAGE_TRANSITION_LINK, "" /* extra_headers */,
true /* started_from_context_menu */);
break;
case IDC_CONTENT_CONTEXT_OPENLINKTOR:
profiles::SwitchToTorProfile(
base::Bind(
OnProfileCreated, params_.link_url,
content::Referrer(
GURL(), network::mojom::ReferrerPolicy::kStrictOrigin)));
break;
Description
Currently the widgets on the new tab page show the default browser right click menu actions on right click:
A lot of these actions are irrelevant and some such as "Inspect" are ones we don't want users to play around with (e.g. changing the Brave Stats labels).
Designs
Make the right click menu specific to each widget.
Show the same menu that you get in the widget dropdown for Brave Stats when the user right clicks anywhere inside the Brave Stats widget:
Show the same menu that you get in the widget dropdown for top sites when the user right clicks anywhere inside the top sites widget:
Right clicking on a top site tile shows relevant actions for the link:
Show the same menu that you get in the widget dropdown for Binance when the user right clicks anywhere inside the Binance widget:
Show the same menu that you get in the widget dropdown for Brave Rewards when the user right clicks anywhere inside the Brave Rewards widget:
Open "Customize Dashboard" panel when user clicks anywhere outside of a widget area:
This interaction will look weird for now but will be fixed once we transition to the new expanded "Customize Dashboard" modal overlay.