20
20
#include " chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
21
21
#include " components/grit/brave_components_resources.h"
22
22
#include " ui/base/l10n/l10n_util.h"
23
- #include " ui/base/resource/resource_bundle.h"
24
23
#include " ui/base/models/image_model.h"
24
+ #include " ui/base/resource/resource_bundle.h"
25
25
#include " ui/gfx/color_palette.h"
26
26
#include " ui/gfx/geometry/size.h"
27
27
#include " ui/gfx/image/image_skia.h"
@@ -59,8 +59,7 @@ void OnTorProfileCreated(GURL onion_location,
59
59
60
60
// Sets the focus and ink drop highlight path to match the background
61
61
// along with it's corner radius.
62
- class HighlightPathGenerator
63
- : public views::HighlightPathGenerator {
62
+ class HighlightPathGenerator : public views ::HighlightPathGenerator {
64
63
public:
65
64
HighlightPathGenerator () = default ;
66
65
@@ -77,18 +76,18 @@ class HighlightPathGenerator
77
76
};
78
77
79
78
class OnionLocationButtonView : public views ::LabelButton,
80
- public views::ButtonListener {
79
+ public views::ButtonListener {
81
80
public:
82
81
explicit OnionLocationButtonView (Profile* profile)
83
82
: LabelButton(this ,
84
- l10n_util::GetStringUTF16 (IDS_LOCATION_BAR_OPEN_IN_TOR)) {
83
+ l10n_util::GetStringUTF16 (IDS_LOCATION_BAR_OPEN_IN_TOR)) {
85
84
if (brave::IsTorProfile (profile))
86
85
SetText (l10n_util::GetStringUTF16 (IDS_LOCATION_BAR_ONION_AVAILABLE));
87
86
// Render vector icon
88
- const gfx::ImageSkia image = gfx::CreateVectorIcon (
89
- kOpenInTorIcon , kIconSize , kIconColor );
87
+ const gfx::ImageSkia image =
88
+ gfx::CreateVectorIcon ( kOpenInTorIcon , kIconSize , kIconColor );
90
89
SetImageModel (views::Button ::STATE_NORMAL,
91
- ui::ImageModel::FromImageSkia (image));
90
+ ui::ImageModel::FromImageSkia (image));
92
91
// Set style specifics
93
92
SetEnabledTextColors (kTextColor );
94
93
SetHorizontalAlignment (gfx::ALIGN_RIGHT);
@@ -104,17 +103,15 @@ class OnionLocationButtonView : public views::LabelButton,
104
103
this , std::make_unique<HighlightPathGenerator>());
105
104
}
106
105
107
- ~OnionLocationButtonView () override { }
106
+ ~OnionLocationButtonView () override {}
108
107
109
108
// views::ButtonListener
110
109
void ButtonPressed (Button* sender, const ui::Event& event) override {
111
110
profiles::SwitchToTorProfile (
112
111
base::BindRepeating (&OnTorProfileCreated, GURL (onion_location_)));
113
112
}
114
113
115
- void SetOnionLocation (GURL location) {
116
- onion_location_ = location;
117
- }
114
+ void SetOnionLocation (GURL location) { onion_location_ = location; }
118
115
119
116
private:
120
117
// views::View
@@ -125,7 +122,7 @@ class OnionLocationButtonView : public views::LabelButton,
125
122
126
123
void UpdateBorder () {
127
124
SetBackground (
128
- views::CreateRoundedRectBackground (kOpenInTorBg , height () / 2 ));
125
+ views::CreateRoundedRectBackground (kOpenInTorBg , height () / 2 ));
129
126
}
130
127
131
128
GURL onion_location_;
@@ -138,7 +135,6 @@ class OnionLocationButtonView : public views::LabelButton,
138
135
139
136
OnionLocationView::OnionLocationView (Profile* profile) {
140
137
SetBorder (views::CreateEmptyBorder (gfx::Insets (3 , 3 )));
141
- // GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING)));
142
138
SetVisible (false );
143
139
// automatic layout
144
140
auto vertical_container_layout = std::make_unique<views::BoxLayout>(
0 commit comments