Skip to content

Commit

Permalink
Merge pull request #10710 from brave/location_bar_tor
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill authored Nov 1, 2021
2 parents 92376fd + 5e94691 commit bc89417
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 32 deletions.
6 changes: 6 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
Open Private Window with Tor
</message>
<message name="IDS_LOCATION_BAR_OPEN_IN_TOR" desc="Button in location bar to open onion available site in tor window.">
Tor
</message>
<message name="IDS_LOCATION_BAR_OPEN_IN_TOR_TOOLTIP_TEXT" desc="The tooltip text of tor button in location bar.">
Open in Tor
</message>
<message name="IDS_LOCATION_BAR_OPEN_USING_IPFS" desc="Button in location bar to open ipfs available site.">
Expand All @@ -466,6 +469,9 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_LOCATION_BAR_ONION_AVAILABLE" desc="Button in location bar to indicate onion available site to open a new tab in tor window.">
Onion Available
</message>
<message name="IDS_LOCATION_BAR_ONION_AVAILABLE_TOOLTIP_TEXT" desc="The tooltip text for onion available button.">
Open using .onion address
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS" desc="The name of the IPFS context menu item for renderer">
Import to IPFS
</message>
Expand Down
60 changes: 29 additions & 31 deletions app/vector_icons/open_in_tor.icon
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@
// You can obtain one at http://mozilla.org/MPL/2.0/.

CANVAS_DIMENSIONS, 12,
MOVE_TO, 11.5f, 10,
R_CUBIC_TO, -0.28f, 0, -0.5f, -0.22f, -0.5f, -0.5f,
V_LINE_TO, 1,
H_LINE_TO, 2.5f,
CUBIC_TO, 2.22f, 1, 2, 0.78f, 2, 0.5f,
R_CUBIC_TO, 0, -0.28f, 0.22f, -0.5f, 0.5f, -0.5f,
H_LINE_TO, 11,
R_CUBIC_TO, 0.55f, 0, 1, 0.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f, 0.5f, 0, 0, 1, 0, -1,
R_H_LINE_TO, 4,
ARC_TO, 0.5f, 0.5f, 0, 0, 1, 12, 0.5f,
R_V_LINE_TO, 4,
R_ARC_TO, 0.5f, 0.5f, 0, 0, 1, -0.5f, 0.5f,
R_CUBIC_TO, -0.28f, 0, -0.47f, -0.21f, -0.47f, -0.49f,
R_V_LINE_TO, -2.84f,
R_LINE_TO, -3.68f, 3.68f,
ARC_TO, 0.5f, 0.5f, 0, 0, 1, 6.5f, 5,
CLOSE
7 changes: 6 additions & 1 deletion browser/ui/views/location_bar/onion_location_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ class OnionLocationButtonView : public views::LabelButton {
base::Unretained(this)),
l10n_util::GetStringUTF16(IDS_LOCATION_BAR_OPEN_IN_TOR)),
profile_(profile) {
if (profile->IsTor())
SetTooltipText(
l10n_util::GetStringUTF16(IDS_LOCATION_BAR_OPEN_IN_TOR_TOOLTIP_TEXT));
if (profile->IsTor()) {
SetText(l10n_util::GetStringUTF16(IDS_LOCATION_BAR_ONION_AVAILABLE));
SetTooltipText(l10n_util::GetStringUTF16(
IDS_LOCATION_BAR_ONION_AVAILABLE_TOOLTIP_TEXT));
}
// Render vector icon
const gfx::ImageSkia image =
gfx::CreateVectorIcon(kOpenInTorIcon, kIconSize, kIconColor);
Expand Down

0 comments on commit bc89417

Please sign in to comment.