Skip to content

Commit 6e9cc34

Browse files
committed
updates to browser os settings page
1 parent 1f0072c commit 6e9cc34

File tree

1 file changed

+13
-37
lines changed

1 file changed

+13
-37
lines changed

patches/nxtscape/browseros-settings.patch

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 135d0931bce5d386837145cfc3fb3054bb13e9ff Mon Sep 17 00:00:00 2001
1+
From 41d77486e0399b493f577cc207750f13ccf24558 Mon Sep 17 00:00:00 2001
22
From: Nikhil Sonti <nikhilsv92@gmail.com>
33
Date: Thu, 24 Jul 2025 16:14:27 -0700
4-
Subject: [PATCH 20/20] BrowserOS settings page
4+
Subject: [PATCH] BrowserOS settings page
55

66
---
77
.../api/settings_private/prefs_util.cc | 4 +
@@ -15,10 +15,10 @@ Subject: [PATCH 20/20] BrowserOS settings page
1515
.../settings/settings_main/settings_main.html | 6 +
1616
.../settings/settings_main/settings_main.ts | 10 +-
1717
.../settings/settings_menu/settings_menu.html | 6 +
18-
.../toolbar/pinned_action_toolbar_button.cc | 48 ++-
18+
.../toolbar/pinned_action_toolbar_button.cc | 24 +-
1919
.../toolbar/pinned_action_toolbar_button.h | 1 +
2020
chrome/common/pref_names.h | 12 +
21-
14 files changed, 672 insertions(+), 11 deletions(-)
21+
14 files changed, 652 insertions(+), 7 deletions(-)
2222
create mode 100644 chrome/browser/resources/settings/browseros_prefs_page/browseros_prefs_page.html
2323
create mode 100644 chrome/browser/resources/settings/browseros_prefs_page/browseros_prefs_page.ts
2424

@@ -778,7 +778,7 @@ index 8f123acf9b322..a1f1454c2bf2a 100644
778778
hidden="[[!pageVisibility.autofill]]"
779779
class="cr-nav-menu-item">
780780
diff --git a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.cc b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.cc
781-
index 68804e8740063..568542f056fbd 100644
781+
index 06259d2817b4e..6d54a267d75b0 100644
782782
--- a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.cc
783783
+++ b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.cc
784784
@@ -45,6 +45,8 @@
@@ -790,40 +790,16 @@ index 68804e8740063..568542f056fbd 100644
790790

791791
DEFINE_UI_CLASS_PROPERTY_TYPE(PinnedToolbarActionFlexPriority)
792792
DEFINE_UI_CLASS_PROPERTY_KEY(
793-
@@ -81,10 +83,28 @@ PinnedActionToolbarButton::PinnedActionToolbarButton(
794-
// Set text from action item if available for BrowserOS actions
795-
if (auto* action_item = container_->GetActionItemFor(action_id)) {
796-
if (browseros::IsBrowserOSAction(action_id)) {
797-
- // Use LabelButton::SetText directly to set permanent text
798-
- views::LabelButton::SetText(action_item->GetText());
799-
- // Ensure the text is visible
800-
- SetTextSubpixelRenderingEnabled(false);
801-
+ // Check if labels should be shown
802-
+ bool show_labels = true;
803-
+ if (browser_ && browser_->profile()) {
804-
+ show_labels = browser_->profile()->GetPrefs()->GetBoolean(
805-
+ prefs::kBrowserOSShowToolbarLabels);
806-
+ LOG(INFO) << "nikhil: PinnedActionToolbarButton::PinnedActionToolbarButton: "
807-
+ << "show_labels = " << show_labels;
808-
+ }
793+
@@ -87,6 +89,8 @@ PinnedActionToolbarButton::PinnedActionToolbarButton(
794+
show_labels = browser_->profile()->GetPrefs()->GetBoolean(
795+
prefs::kBrowserOSShowToolbarLabels);
796+
}
809797
+ else {
810-
+ LOG(INFO) << "nikhil: PinnedActionToolbarButton::PinnedActionToolbarButton: "
811-
+ << "false";
812-
+ }
813-
+
814-
+ if (show_labels) {
815-
+ // Use LabelButton::SetText directly to set permanent text
816-
+ views::LabelButton::SetText(action_item->GetText());
817-
+ // Ensure the text is visible
818-
+ SetTextSubpixelRenderingEnabled(false);
819-
+ } else {
820-
+ // Clear the text if labels are disabled
821-
+ views::LabelButton::SetText(std::u16string());
822798
+ }
823-
}
824-
}
825-
826-
@@ -349,10 +369,22 @@ void PinnedActionToolbarButtonActionViewInterface::ActionItemChangedImpl(
799+
800+
if (show_labels) {
801+
// Use LabelButton::SetText directly to set permanent text
802+
@@ -361,10 +365,22 @@ void PinnedActionToolbarButtonActionViewInterface::ActionItemChangedImpl(
827803

828804
// Update the text from the action item for BrowserOS actions
829805
if (browseros::IsBrowserOSAction(action_view_->GetActionId())) {

0 commit comments

Comments
 (0)