mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8dd21a0ac | |||
| b0aeb4e2e4 | |||
| 07851e4fb2 | |||
| 1dc7d3de8e | |||
| 1a13e62f85 | |||
| 1495af694d | |||
| 2c244e1567 | |||
| e2abb5fbf6 | |||
| 072a95d7b1 | |||
| 4419d8f3ec | |||
| e6405c42c6 | |||
| ae89e3813b | |||
| 1d34cd53d2 | |||
| 20715be7e3 | |||
| e1a3c2d801 |
+9
-3
@@ -53,8 +53,14 @@ validate_with_source_task:
|
||||
./utils/downloads.py unpack -i deps.ini -c chromium_download_cache chromium_src
|
||||
validate_patches_script:
|
||||
- ./devutils/validate_patches.py -l chromium_src -v
|
||||
validate_lists_script:
|
||||
# NOTE: This check is prone to false positives, but not false negatives.
|
||||
- ./devutils/check_files_exist.py chromium_src pruning.list domain_substitution.list
|
||||
validate_lists_script: |
|
||||
set -e
|
||||
./devutils/update_lists.py \
|
||||
--tree chromium_src \
|
||||
--pruning pruning.list.gen \
|
||||
--domain-substitution domain_substitution.list.gen \
|
||||
--no-error-unused
|
||||
diff pruning.list pruning.list.gen
|
||||
diff domain_substitution.list domain_substitution.list.gen
|
||||
|
||||
# vim: set expandtab shiftwidth=4 softtabstop=4:
|
||||
|
||||
@@ -71,6 +71,17 @@ PRUNING_EXCLUDE_PATTERNS = [
|
||||
'third_party/perfetto/src/trace_processor/importers/proto/atoms.descriptor',
|
||||
# Exclusion for zoneinfo64
|
||||
'third_party/rust/chromium_crates_io/vendor/zoneinfo64-v0_2/src/data/zoneinfo64.res',
|
||||
# Exclusions for uBlock Origin
|
||||
'third_party/ublock/js/wasm/biditrie.wasm',
|
||||
'third_party/ublock/js/wasm/hntrie.wasm',
|
||||
'third_party/ublock/lib/lz4/lz4-block-codec.wasm',
|
||||
'third_party/ublock/lib/publicsuffixlist/wasm/publicsuffixlist.wasm',
|
||||
'third_party/ublock/web_accessible_resources/noop-1s.mp4',
|
||||
# Exclusions for Helium onboarding
|
||||
'components/helium_onboarding/node_modules/@esbuild/*/bin/esbuild',
|
||||
'components/helium_onboarding/node_modules/@esbuild/*/esbuild.exe',
|
||||
'components/helium_onboarding/node_modules/@rollup/*/rollup.*.node',
|
||||
'components/helium_onboarding/node_modules/fsevents/fsevents.node',
|
||||
# Exclusions for safe file extensions
|
||||
'*.avif',
|
||||
'*.ttf',
|
||||
@@ -129,6 +140,9 @@ DOMAIN_EXCLUDE_PREFIXES = [
|
||||
'chrome/common/extensions/api/_api_features.json',
|
||||
'extensions/common/extension_urls.cc',
|
||||
'extensions/browser/updater/safe_manifest_parser.cc',
|
||||
# Helium components
|
||||
'third_party/ublock/',
|
||||
'components/helium_onboarding/',
|
||||
]
|
||||
|
||||
# pylint: enable=line-too-long
|
||||
|
||||
@@ -530,15 +530,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--- a/chrome/browser/importer/importer_uma.cc
|
||||
+++ b/chrome/browser/importer/importer_uma.cc
|
||||
@@ -35,6 +35,7 @@ enum ImporterTypeMetrics {
|
||||
|
||||
void LogImporterUseToMetrics(const std::string& metric_postfix,
|
||||
user_data_importer::ImporterType type) {
|
||||
+ return;
|
||||
ImporterTypeMetrics metrics_type = IMPORTER_METRICS_UNKNOWN;
|
||||
switch (type) {
|
||||
case user_data_importer::TYPE_UNKNOWN:
|
||||
@@ -59,6 +60,9 @@ void LogImporterUseToMetrics(const std::
|
||||
@@ -59,6 +59,9 @@ void LogImporterUseToMetrics(const std::
|
||||
case user_data_importer::TYPE_BOOKMARKS_FILE:
|
||||
metrics_type = IMPORTER_METRICS_BOOKMARKS_FILE;
|
||||
break;
|
||||
|
||||
@@ -28,20 +28,22 @@
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -16,6 +16,12 @@
|
||||
@@ -16,6 +16,14 @@
|
||||
|
||||
namespace helium {
|
||||
|
||||
+#if BUILDFLAG(IS_MAC)
|
||||
+#if defined(ARCH_CPU_ARM_FAMILY)
|
||||
+constexpr std::string cpu_arch = "arm64";
|
||||
+#else
|
||||
+constexpr std::string cpu_arch = "x86_64";
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
|
||||
if (user_url_.empty()) {
|
||||
return std::nullopt;
|
||||
@@ -73,6 +79,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
@@ -73,6 +81,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
}
|
||||
|
||||
@@ -53,7 +55,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -98,6 +109,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
@@ -98,6 +111,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
return GetServicesBaseURL(prefs).Resolve("/dict/");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,35 +30,56 @@
|
||||
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPEN_IN_READING_MODE,
|
||||
IDS_CONTENT_CONTEXT_READING_MODE);
|
||||
}
|
||||
@@ -3739,10 +3732,12 @@ void RenderViewContextMenu::ExecuteComma
|
||||
@@ -3738,30 +3731,9 @@ void RenderViewContextMenu::ExecuteComma
|
||||
}
|
||||
}
|
||||
|
||||
void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
|
||||
+ return;
|
||||
AddSpellCheckServiceItem(&menu_model_, is_checked);
|
||||
}
|
||||
-void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
|
||||
- AddSpellCheckServiceItem(&menu_model_, is_checked);
|
||||
-}
|
||||
+void RenderViewContextMenu::AddSpellCheckServiceItem(bool) {}
|
||||
|
||||
void RenderViewContextMenu::AddAccessibilityLabelsServiceItem(bool is_checked) {
|
||||
+ return;
|
||||
if (is_checked) {
|
||||
menu_model_.AddCheckItemWithStringId(
|
||||
IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
|
||||
@@ -4133,6 +4128,8 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
-void RenderViewContextMenu::AddAccessibilityLabelsServiceItem(bool is_checked) {
|
||||
- if (is_checked) {
|
||||
- menu_model_.AddCheckItemWithStringId(
|
||||
- IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
|
||||
- IDS_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_MENU_OPTION);
|
||||
- } else {
|
||||
- // Add the submenu if the whole feature is not enabled.
|
||||
- accessibility_labels_submenu_model_.AddItemWithStringId(
|
||||
- IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
|
||||
- IDS_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_SEND);
|
||||
- accessibility_labels_submenu_model_.AddItemWithStringId(
|
||||
- IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE_ONCE,
|
||||
- IDS_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_SEND_ONCE);
|
||||
- menu_model_.AddSubMenu(
|
||||
- IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS,
|
||||
- l10n_util::GetStringUTF16(
|
||||
- IDS_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_MENU_OPTION),
|
||||
- &accessibility_labels_submenu_model_);
|
||||
- }
|
||||
-}
|
||||
+void RenderViewContextMenu::AddAccessibilityLabelsServiceItem(bool) {}
|
||||
|
||||
// static
|
||||
void RenderViewContextMenu::RegisterMenuShownCallbackForTesting(
|
||||
@@ -4133,7 +4105,7 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
bool RenderViewContextMenu::AppendQRCodeGeneratorItem(bool for_image,
|
||||
bool draw_icon,
|
||||
bool add_separator) {
|
||||
+ return false;
|
||||
+
|
||||
if (!IsQRCodeGeneratorEnabled()) {
|
||||
- if (!IsQRCodeGeneratorEnabled()) {
|
||||
+ if ((true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/browser_tab_strip_model_delegate.cc
|
||||
+++ b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
|
||||
@@ -306,6 +306,7 @@ void BrowserTabStripModelDelegate::AddTo
|
||||
@@ -306,7 +306,7 @@ void BrowserTabStripModelDelegate::AddTo
|
||||
}
|
||||
|
||||
bool BrowserTabStripModelDelegate::SupportsReadLater() {
|
||||
- return !browser_->profile()->IsGuestSession() && !IsForWebApp();
|
||||
+ return false;
|
||||
return !browser_->profile()->IsGuestSession() && !IsForWebApp();
|
||||
}
|
||||
|
||||
bool BrowserTabStripModelDelegate::IsForWebApp() {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -84,6 +85,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -86,6 +87,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
@@ -128,6 +135,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -130,6 +137,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,29 @@
|
||||
--- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
|
||||
+++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
|
||||
@@ -1294,6 +1294,9 @@ void FedCmAccountSelectionView::ShouldSh
|
||||
@@ -1294,24 +1294,8 @@ void FedCmAccountSelectionView::ShouldSh
|
||||
}
|
||||
|
||||
if (dialog_type_ == DialogType::BUBBLE) {
|
||||
- // Hide the bubble dialog if it can't fit.
|
||||
- if (!CanFitInWebContents()) {
|
||||
- should_show = false;
|
||||
- }
|
||||
-
|
||||
- // Or if a popup is showing.
|
||||
- if (popup_window_) {
|
||||
- should_show = false;
|
||||
- }
|
||||
-
|
||||
- // Or if we want to hide until Show*() is called.
|
||||
- if (hide_dialog_widget_after_idp_login_popup_) {
|
||||
- should_show = false;
|
||||
- }
|
||||
-
|
||||
- if (!tab_->CanShowModalUI()) {
|
||||
- should_show = false;
|
||||
- }
|
||||
+ should_show = false;
|
||||
+ return;
|
||||
+
|
||||
// Hide the bubble dialog if it can't fit.
|
||||
if (!CanFitInWebContents()) {
|
||||
should_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
--- a/components/live_caption/caption_util.cc
|
||||
+++ b/components/live_caption/caption_util.cc
|
||||
@@ -125,6 +125,7 @@ std::optional<ui::CaptionStyle> GetCapti
|
||||
@@ -125,11 +125,7 @@ std::optional<ui::CaptionStyle> GetCapti
|
||||
}
|
||||
|
||||
bool IsLiveCaptionFeatureSupported() {
|
||||
+ return false;
|
||||
#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_ANDROID)
|
||||
return speech::IsOnDeviceSpeechRecognitionSupported();
|
||||
#else
|
||||
-#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_ANDROID)
|
||||
- return speech::IsOnDeviceSpeechRecognitionSupported();
|
||||
-#else
|
||||
return false;
|
||||
-#endif // !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_ANDROID)
|
||||
}
|
||||
|
||||
bool IsHeadlessCaptionFeatureSupported() {
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
--- a/chrome/browser/user_education/user_education_service_factory.cc
|
||||
+++ b/chrome/browser/user_education/user_education_service_factory.cc
|
||||
@@ -112,6 +112,7 @@ UserEducationServiceFactory::BuildServic
|
||||
@@ -120,8 +120,7 @@ bool UserEducationServiceFactory::Profil
|
||||
// In order to do user education, the browser must have a UI and not be an
|
||||
// "off-the-record" or in a demo or guest mode.
|
||||
|
||||
- if (profile->IsIncognitoProfile() || profile->IsGuestSession() ||
|
||||
- profiles::IsDemoSession() || profiles::IsChromeAppKioskSession()) {
|
||||
+ if ((true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
bool UserEducationServiceFactory::ProfileAllowsUserEducation(Profile* profile) {
|
||||
+ return false;
|
||||
#if BUILDFLAG(CHROME_FOR_TESTING)
|
||||
// IPH is always disabled in Chrome for Testing.
|
||||
return false;
|
||||
--- a/components/user_education/common/tutorial/tutorial_registry.cc
|
||||
+++ b/components/user_education/common/tutorial/tutorial_registry.cc
|
||||
@@ -25,7 +25,6 @@ bool TutorialRegistry::IsTutorialRegiste
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
} // namespace
|
||||
|
||||
TabGroupModelFactory::TabGroupModelFactory() {
|
||||
@@ -2485,6 +2537,21 @@ bool TabStripModel::IsContextMenuCommand
|
||||
@@ -2494,6 +2546,21 @@ bool TabStripModel::IsContextMenuCommand
|
||||
case CommandReload:
|
||||
return delegate_->CanReload();
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
case CommandCloseOtherTabs:
|
||||
case CommandCloseTabsToRight: {
|
||||
return !GetIndicesClosedByCommand(context_index, command_id).empty();
|
||||
@@ -2651,6 +2718,27 @@ void TabStripModel::ExecuteContextMenuCo
|
||||
@@ -2660,6 +2727,27 @@ void TabStripModel::ExecuteContextMenuCo
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -133,7 +133,7 @@
|
||||
@@ -129,7 +129,7 @@
|
||||
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
|
||||
{"increase-incognito-storage-quota",
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1305,6 +1305,10 @@ inline constexpr char
|
||||
@@ -1305,6 +1305,11 @@ inline constexpr char
|
||||
"restricted_managed_guest_session_extension_cleanup_exempt_list";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
+// A boolean pref set to true if new tabs should be created to the next of current active one,
|
||||
+// instead of tab strip end.
|
||||
+inline constexpr char kNewTabNextToActive[] = "helium.browser.new_tab_next_to_active";
|
||||
+// A boolean pref set to true if new tabs should be created to the next of
|
||||
+// current active one, instead of tab strip end.
|
||||
+inline constexpr char kNewTabNextToActive[] =
|
||||
+ "helium.browser.new_tab_next_to_active";
|
||||
+
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
// visible on the toolbar.
|
||||
@@ -39,13 +40,22 @@
|
||||
#include "components/reading_list/core/reading_list_model.h"
|
||||
#include "components/split_tabs/split_tab_id.h"
|
||||
#include "components/split_tabs/split_tab_visual_data.h"
|
||||
@@ -1733,7 +1735,11 @@ void TabStripModel::AddTab(std::unique_p
|
||||
@@ -1733,7 +1735,20 @@ void TabStripModel::AddTab(std::unique_p
|
||||
// For all other types, respect what was passed to us, normalizing -1s and
|
||||
// values that are too large.
|
||||
if (index < 0 || index > count()) {
|
||||
- index = count();
|
||||
+ if (count() >= 1 && profile_->GetPrefs()->GetBoolean(prefs::kNewTabNextToActive)) {
|
||||
+ index = active_index() + 1;
|
||||
+ const bool new_tab_next_to_active =
|
||||
+ profile_->GetPrefs()->GetBoolean(prefs::kNewTabNextToActive);
|
||||
+ const auto opener_group = GetTabGroupForTab(active_index());
|
||||
+
|
||||
+ if (count() >= 1 && new_tab_next_to_active) {
|
||||
+ if (group_model_ && opener_group && !(add_types & ADD_ACTIVE)) {
|
||||
+ index = static_cast<int>(
|
||||
+ group_model_->GetTabGroup(*opener_group)->ListTabs().end());
|
||||
+ } else {
|
||||
+ index = active_index() + 1;
|
||||
+ }
|
||||
+ } else {
|
||||
+ index = count();
|
||||
+ }
|
||||
|
||||
@@ -16,24 +16,36 @@
|
||||
const char kChromeWebstoreApiURL[] = "trk:07:https://chromewebstore.googleapis.com/";
|
||||
|
||||
const char kAppMenuUtmSource[] = "ext_app_menu";
|
||||
@@ -77,6 +77,7 @@ GURL GetNewWebstoreLaunchURL() {
|
||||
@@ -77,7 +77,7 @@ GURL GetNewWebstoreLaunchURL() {
|
||||
}
|
||||
|
||||
GURL AppendUtmSource(const GURL& url, std::string_view utm_source_value) {
|
||||
- return net::AppendQueryParameter(url, "utm_source", utm_source_value);
|
||||
+ return url;
|
||||
return net::AppendQueryParameter(url, "utm_source", utm_source_value);
|
||||
}
|
||||
|
||||
@@ -90,6 +91,8 @@ std::string GetWebstoreItemDetailURLPref
|
||||
GURL GetWebstoreExtensionsCategoryURL() {
|
||||
@@ -90,18 +90,7 @@ std::string GetWebstoreItemDetailURLPref
|
||||
}
|
||||
|
||||
GURL GetWebstoreItemSnippetURL(const extensions::ExtensionId& extension_id) {
|
||||
- if (g_item_snippet_url_for_test_) {
|
||||
- // Return `<base URL><extension_id>`. There is no suffix if the URL is
|
||||
- // overridden by a test.
|
||||
- return GURL(base::StringPrintf("%s%s",
|
||||
- g_item_snippet_url_for_test_->spec().c_str(),
|
||||
- extension_id.c_str()));
|
||||
- }
|
||||
-
|
||||
- // Return `<base URL><extension_id><suffix>`.
|
||||
- return GURL(kChromeWebstoreApiURL)
|
||||
- .Resolve(base::StringPrintf("v2/items/%s:fetchItemSnippet",
|
||||
- extension_id.c_str()));
|
||||
+ return GURL(kChromeWebstoreUpdateURL);
|
||||
+
|
||||
if (g_item_snippet_url_for_test_) {
|
||||
// Return `<base URL><extension_id>`. There is no suffix if the URL is
|
||||
// overridden by a test.
|
||||
@@ -119,9 +122,6 @@ GURL GetDefaultWebstoreUpdateUrl() {
|
||||
}
|
||||
|
||||
GURL GetWebstoreBlockStatusURL() {
|
||||
@@ -119,9 +108,6 @@ GURL GetDefaultWebstoreUpdateUrl() {
|
||||
}
|
||||
|
||||
GURL GetWebstoreUpdateUrl() {
|
||||
|
||||
@@ -34,16 +34,32 @@
|
||||
"saveGuestChoiceText", IDS_SEARCH_ENGINE_CHOICE_GUEST_SESSION_CHECKBOX);
|
||||
--- a/components/regional_capabilities/regional_capabilities_service.cc
|
||||
+++ b/components/regional_capabilities/regional_capabilities_service.cc
|
||||
@@ -218,6 +218,8 @@ std::pair<CountryId, LoadedCountrySource
|
||||
@@ -218,23 +218,7 @@ std::pair<CountryId, LoadedCountrySource
|
||||
// Pass `out_scope_check_outcome` to collect information about the outcome of
|
||||
// the program checks.
|
||||
Program CountryIdToProgram(const CountryId& country_id) {
|
||||
- static constexpr Program kCountryDerivedPrograms[] = {
|
||||
-#if BUILDFLAG(IS_IOS)
|
||||
- // Only iOS can derive Taiyaki scope directly from the country.
|
||||
- Program::kTaiyaki,
|
||||
-#endif
|
||||
-
|
||||
- Program::kWaffle,
|
||||
- };
|
||||
-
|
||||
- for (Program program : kCountryDerivedPrograms) {
|
||||
- if (IsInProgramRegion(program, country_id) &&
|
||||
- IsClientCompatibleWithProgram(program)) {
|
||||
- return program;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return Program::kDefault;
|
||||
+ return Program::kWaffle;
|
||||
+
|
||||
static constexpr Program kCountryDerivedPrograms[] = {
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
// Only iOS can derive Taiyaki scope directly from the country.
|
||||
@@ -345,14 +347,13 @@ RegionalCapabilitiesService::GetRegional
|
||||
}
|
||||
|
||||
std::optional<ProgramAndLocationMatch> GetProgramAndLocationMatch(
|
||||
@@ -345,14 +329,13 @@ RegionalCapabilitiesService::GetRegional
|
||||
}
|
||||
|
||||
bool RegionalCapabilitiesService::IsInSearchEngineChoiceScreenRegion() {
|
||||
@@ -60,14 +76,22 @@
|
||||
}
|
||||
|
||||
bool RegionalCapabilitiesService::
|
||||
@@ -458,6 +459,7 @@ RegionalCapabilitiesService::GetChoiceSc
|
||||
@@ -458,14 +441,7 @@ RegionalCapabilitiesService::GetChoiceSc
|
||||
}
|
||||
|
||||
bool RegionalCapabilitiesService::IsInEeaCountry() {
|
||||
- // Feature behaviour was directly based on the current country, as a
|
||||
- // decentralised way to express a concept we are now framing as "program
|
||||
- // settings". Here we check for the program reference directly as command line
|
||||
- // overrides may be setting a program with a separate country engine list
|
||||
- // override.
|
||||
- // TODO(crbug.com/328040066): Introduce granular program settings APIs and
|
||||
- // deprecate `IsInEeaCountry()` in favour of these.
|
||||
- return GetActiveProgramSettings().program == Program::kWaffle;
|
||||
+ return true;
|
||||
// Feature behaviour was directly based on the current country, as a
|
||||
// decentralised way to express a concept we are now framing as "program
|
||||
// settings". Here we check for the program reference directly as command line
|
||||
}
|
||||
|
||||
RegionalCapabilitiesService::Client&
|
||||
--- a/components/search_engine_choice_strings.grdp
|
||||
+++ b/components/search_engine_choice_strings.grdp
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
@@ -504,7 +504,7 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/browser_list.h"
|
||||
@@ -77,8 +76,6 @@ std::string_view GetMetricsSuffixForComm
|
||||
@@ -77,24 +76,9 @@ std::string_view GetMetricsSuffixForComm
|
||||
return "CloseEndTab";
|
||||
case SplitTabMenuModel::CommandId::kExitSplit:
|
||||
return "ExitSplit";
|
||||
@@ -513,7 +513,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,16 +150,6 @@ SplitTabMenuModel::SplitTabMenuModel(Tab
|
||||
-BrowserWindowInterface* GetBrowserWithTabStripModel(
|
||||
- TabStripModel* tab_strip_model) {
|
||||
- BrowserWindowInterface* result = nullptr;
|
||||
- ForEachCurrentBrowserWindowInterfaceOrderedByActivation(
|
||||
- [tab_strip_model, &result](BrowserWindowInterface* browser) {
|
||||
- if (browser->GetTabStripModel() == tab_strip_model) {
|
||||
- result = browser;
|
||||
- }
|
||||
- return !result;
|
||||
- });
|
||||
- return result;
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
|
||||
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(SplitTabMenuModel,
|
||||
@@ -153,16 +137,6 @@ SplitTabMenuModel::SplitTabMenuModel(Tab
|
||||
SetElementIdentifierAt(
|
||||
GetIndexOfCommandId(GetCommandIdInt(CommandId::kExitSplit)).value(),
|
||||
kExitSplitMenuItem);
|
||||
@@ -530,7 +546,7 @@
|
||||
}
|
||||
|
||||
SplitTabMenuModel::~SplitTabMenuModel() = default;
|
||||
@@ -244,9 +231,6 @@ void SplitTabMenuModel::ExecuteCommand(i
|
||||
@@ -244,9 +218,6 @@ void SplitTabMenuModel::ExecuteCommand(i
|
||||
case CommandId::kExitSplit:
|
||||
tab_strip_model_->RemoveSplit(split_id);
|
||||
break;
|
||||
@@ -540,7 +556,7 @@
|
||||
}
|
||||
|
||||
base::UmaHistogramEnumeration(
|
||||
@@ -294,11 +278,3 @@ void SplitTabMenuModel::CloseTabAtIndex(
|
||||
@@ -294,11 +265,3 @@ void SplitTabMenuModel::CloseTabAtIndex(
|
||||
index, TabCloseTypes::CLOSE_USER_GESTURE |
|
||||
TabCloseTypes::CLOSE_CREATE_HISTORICAL_TAB);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1309,6 +1309,10 @@ inline constexpr char
|
||||
// instead of tab strip end.
|
||||
inline constexpr char kNewTabNextToActive[] = "helium.browser.new_tab_next_to_active";
|
||||
@@ -1310,6 +1310,10 @@ inline constexpr char
|
||||
inline constexpr char kNewTabNextToActive[] =
|
||||
"helium.browser.new_tab_next_to_active";
|
||||
|
||||
+// A boolean pref set to true if MRU (Most Recently Used) order should be used when
|
||||
+// cycling through tabs with Ctrl+Tab.
|
||||
+// A boolean pref set to true if MRU (Most Recently Used) order should be used
|
||||
+// when cycling through tabs with Ctrl+Tab.
|
||||
+inline constexpr char kTabCyclingMRU[] = "helium.browser.mru_tab_cycling";
|
||||
+
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
@@ -24,7 +24,7 @@
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
@@ -1832,11 +1832,11 @@ void TabStripModel::CloseSelectedTabs()
|
||||
@@ -1841,11 +1841,11 @@ void TabStripModel::CloseSelectedTabs()
|
||||
}
|
||||
|
||||
void TabStripModel::SelectNextTab(TabStripUserGestureDetails detail) {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
void TabStripModel::SelectLastTab(TabStripUserGestureDetails detail) {
|
||||
@@ -3994,6 +3994,18 @@ TabStripSelectionChange TabStripModel::S
|
||||
@@ -4003,6 +4003,18 @@ TabStripSelectionChange TabStripModel::S
|
||||
return selection;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -84,6 +84,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -86,6 +86,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -123,6 +128,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -125,6 +130,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,45 @@
|
||||
--- a/chrome/browser/search/search.cc
|
||||
+++ b/chrome/browser/search/search.cc
|
||||
@@ -173,37 +173,9 @@ struct NewTabURLDetails {
|
||||
@@ -94,17 +94,6 @@ enum NewTabURLState {
|
||||
NEW_TAB_URL_MAX
|
||||
};
|
||||
|
||||
-const TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) {
|
||||
- if (profile) {
|
||||
- TemplateURLService* template_url_service =
|
||||
- TemplateURLServiceFactory::GetForProfile(profile);
|
||||
- if (template_url_service) {
|
||||
- return template_url_service->GetDefaultSearchProvider();
|
||||
- }
|
||||
- }
|
||||
- return nullptr;
|
||||
-}
|
||||
-
|
||||
bool IsMatchingServiceWorker(const GURL& my_url, const GURL& document_url) {
|
||||
// The origin should match.
|
||||
if (!MatchesOrigin(my_url, document_url)) {
|
||||
@@ -141,20 +130,6 @@ bool IsNTPOrRelatedURLHelper(const GURL&
|
||||
IsMatchingServiceWorker(url, new_tab_url));
|
||||
}
|
||||
|
||||
-bool IsURLAllowedForSupervisedUser(const GURL& url, Profile& profile) {
|
||||
- if (!profile.IsChild()) {
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- supervised_user::SupervisedUserUrlFilteringService* url_filtering_service =
|
||||
- supervised_user::SupervisedUserUrlFilteringServiceFactory::GetForProfile(
|
||||
- &profile);
|
||||
- if (url_filtering_service->GetFilteringBehavior(url).IsBlocked()) {
|
||||
- return false;
|
||||
- }
|
||||
- return true;
|
||||
-}
|
||||
-
|
||||
// Used to look up the URL to use for the New Tab page. Also tracks how we
|
||||
// arrived at that URL so it can be logged with UMA.
|
||||
struct NewTabURLDetails {
|
||||
@@ -173,37 +148,9 @@ struct NewTabURLDetails {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
const GURL local_url;
|
||||
#else
|
||||
|
||||
@@ -10,7 +10,19 @@
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_QRCODE_GENERATOR,
|
||||
IDS_APP_MENU_CREATE_QR_CODE,
|
||||
kQrCodeChromeRefreshIcon);
|
||||
@@ -924,23 +921,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
@@ -786,11 +783,6 @@ SaveAndShareSubMenuModel::SaveAndShareSu
|
||||
}
|
||||
}
|
||||
|
||||
-bool ArePromotionsEnabled() {
|
||||
- PrefService* local_state = g_browser_process->local_state();
|
||||
- return local_state && local_state->GetBoolean(prefs::kPromotionsEnabled);
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -924,23 +916,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_NAME_WINDOW, IDS_NAME_WINDOW,
|
||||
kNameWindowIcon);
|
||||
|
||||
@@ -34,7 +46,7 @@
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_PERFORMANCE, IDS_SHOW_PERFORMANCE,
|
||||
@@ -1808,22 +1788,8 @@ void AppMenuModel::Build() {
|
||||
@@ -1808,22 +1783,8 @@ void AppMenuModel::Build() {
|
||||
// Build (and, by extension, Init) should only be called once.
|
||||
DCHECK_EQ(0u, GetItemCount());
|
||||
|
||||
@@ -59,7 +71,7 @@
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
@@ -1860,32 +1826,6 @@ void AppMenuModel::Build() {
|
||||
@@ -1860,32 +1821,6 @@ void AppMenuModel::Build() {
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
|
||||
@@ -92,7 +104,7 @@
|
||||
if (!browser_->profile()->IsOffTheRecord()) {
|
||||
auto recent_tabs_sub_menu =
|
||||
std::make_unique<RecentTabsSubMenuModel>(provider_, browser_);
|
||||
@@ -1907,7 +1847,7 @@ void AppMenuModel::Build() {
|
||||
@@ -1907,7 +1842,7 @@ void AppMenuModel::Build() {
|
||||
std::make_unique<BookmarkSubMenuModel>(this, browser_);
|
||||
|
||||
AddSubMenuWithStringIdAndVectorIcon(
|
||||
@@ -101,7 +113,7 @@
|
||||
bookmark_sub_menu_model_.get(), kBookmarksListsMenuIcon);
|
||||
SetElementIdentifierAt(GetIndexOfCommandId(IDC_BOOKMARKS_MENU).value(),
|
||||
kBookmarksMenuItem);
|
||||
@@ -1924,23 +1864,10 @@ void AppMenuModel::Build() {
|
||||
@@ -1924,23 +1859,10 @@ void AppMenuModel::Build() {
|
||||
kTabGroupsMenuItem);
|
||||
}
|
||||
|
||||
@@ -129,7 +141,7 @@
|
||||
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_CLEAR_BROWSING_DATA,
|
||||
IDS_CLEAR_BROWSING_DATA,
|
||||
@@ -1987,9 +1914,6 @@ void AppMenuModel::Build() {
|
||||
@@ -1987,9 +1909,6 @@ void AppMenuModel::Build() {
|
||||
lens::features::kLensOverlay));
|
||||
}
|
||||
|
||||
@@ -139,7 +151,7 @@
|
||||
CreateFindAndEditSubMenu();
|
||||
|
||||
sub_menus_.push_back(
|
||||
@@ -2038,6 +1962,12 @@ void AppMenuModel::Build() {
|
||||
@@ -2038,6 +1957,12 @@ void AppMenuModel::Build() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -152,7 +164,7 @@
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_OPTIONS, IDS_SETTINGS,
|
||||
kSettingsMenuIcon);
|
||||
|
||||
@@ -2134,34 +2064,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
|
||||
@@ -2134,34 +2059,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
--- a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
|
||||
@@ -855,6 +855,7 @@ bool TabGroupEditorBubbleView::IsGroupSh
|
||||
@@ -135,9 +135,6 @@ constexpr int kSeparatorPadding = 8;
|
||||
constexpr int kDialogWidth = 240;
|
||||
// The default size of icons that are displayed in the tab group editor bubble.
|
||||
static constexpr int kDefaultIconSize = 20;
|
||||
-// The maximum number of times we will show the footer section with the learn
|
||||
-// more link.
|
||||
-constexpr int kFooterDisplayLimit = 5;
|
||||
|
||||
int GetHorizontalSpacing() {
|
||||
return ChromeLayoutProvider::Get()->GetDistanceMetric(
|
||||
@@ -855,10 +852,7 @@ bool TabGroupEditorBubbleView::IsGroupSh
|
||||
}
|
||||
|
||||
bool TabGroupEditorBubbleView::ShouldShowSavedFooter() const {
|
||||
- PrefService* pref_service = browser_->profile()->GetPrefs();
|
||||
- return (CanSaveGroups() && pref_service &&
|
||||
- saved_tab_group_prefs::GetLearnMoreFooterShownCount(pref_service) <
|
||||
- kFooterDisplayLimit);
|
||||
+ return false;
|
||||
PrefService* pref_service = browser_->profile()->GetPrefs();
|
||||
return (CanSaveGroups() && pref_service &&
|
||||
saved_tab_group_prefs::GetLearnMoreFooterShownCount(pref_service) <
|
||||
}
|
||||
|
||||
void TabGroupEditorBubbleView::NewTabInGroupPressed() {
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
--- a/ui/native_theme/features/native_theme_features.cc
|
||||
+++ b/ui/native_theme/features/native_theme_features.cc
|
||||
@@ -19,7 +19,13 @@ constexpr base::FeatureState kOverlayScr
|
||||
// Enables or disables overlay scrollbars in Blink (i.e. web content) on Aura
|
||||
// or Linux. The status of native UI overlay scrollbars is determined in
|
||||
// PlatformStyle::CreateScrollBar. Does nothing on Mac.
|
||||
-BASE_FEATURE(kOverlayScrollbar, kOverlayScrollbarFeatureState);
|
||||
+BASE_FEATURE(kOverlayScrollbar,
|
||||
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT
|
||||
+#else
|
||||
+ kOverlayScrollbarFeatureState
|
||||
+#endif
|
||||
+);
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
// Disable to keep scrollbars visible forever once shown, and immediately
|
||||
// update scrollbar states instead of animating. This is used to ensure
|
||||
namespace features {
|
||||
|
||||
-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_IOS)
|
||||
+#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_IOS) \
|
||||
+ || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
||||
constexpr base::FeatureState kOverlayScrollbarFeatureState =
|
||||
base::FEATURE_ENABLED_BY_DEFAULT;
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view.h
|
||||
@@ -147,6 +147,11 @@ class BrowserFrameView : public views::F
|
||||
// frame. Mainly used by special browsers such as PWAs.
|
||||
virtual void UpdateThrobber(bool running) = 0;
|
||||
|
||||
+ // Sets the rendering opacity of caption buttons (0 = invisible, 1 = fully
|
||||
+ // visible). Used by zen mode to fade buttons with the toolbar while keeping
|
||||
+ // them in the layout for exclusion area calculations.
|
||||
+ virtual void SetCaptionButtonsOpacity(float opacity) {}
|
||||
+
|
||||
// Signals that the frame's minimum size may have changed. This prompts the
|
||||
// widget to update its size constraints by re-querying `GetMinimumSize()`.
|
||||
// This is typically called when child views (e.g. tab strip, toolbar,
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_mac.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_mac.h
|
||||
@@ -59,6 +59,7 @@ class BrowserFrameViewMac : public Brows
|
||||
int NonClientHitTest(const gfx::Point& point) override;
|
||||
void UpdateMinimumSize() override;
|
||||
void WindowControlsOverlayEnabledChanged() override;
|
||||
+ void SetCaptionButtonsOpacity(float opacity) override;
|
||||
|
||||
// views::View:
|
||||
gfx::Size GetMinimumSize() const override;
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
|
||||
@@ -301,6 +301,18 @@ views::LayoutAlignment BrowserFrameViewM
|
||||
}
|
||||
}
|
||||
|
||||
+void BrowserFrameViewMac::SetCaptionButtonsOpacity(float opacity) {
|
||||
+ NSWindow* window = GetWidget()->GetNativeWindow().GetNativeNSWindow();
|
||||
+ if (!window) {
|
||||
+ return;
|
||||
+ }
|
||||
+ for (NSWindowButton button :
|
||||
+ {NSWindowCloseButton, NSWindowMiniaturizeButton, NSWindowZoomButton}) {
|
||||
+ NSButton* button_view = [window standardWindowButton:button];
|
||||
+ [button_view setAlphaValue:opacity];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// BrowserFrameViewMac, views::FrameView implementation:
|
||||
|
||||
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
||||
@@ -526,6 +526,27 @@ bool OpaqueBrowserFrameView::ShouldShowC
|
||||
return GetShowWindowTitleBar();
|
||||
}
|
||||
|
||||
+void OpaqueBrowserFrameView::SetCaptionButtonsOpacity(float opacity) {
|
||||
+ auto apply = [opacity](views::Button* view) {
|
||||
+ if (!view) {
|
||||
+ return;
|
||||
+ }
|
||||
+ if (opacity < 1.0f) {
|
||||
+ if (!view->layer()) {
|
||||
+ view->SetPaintToLayer();
|
||||
+ view->layer()->SetFillsBoundsOpaquely(false);
|
||||
+ }
|
||||
+ view->layer()->SetOpacity(opacity);
|
||||
+ } else if (view->layer()) {
|
||||
+ view->DestroyLayer();
|
||||
+ }
|
||||
+ };
|
||||
+ apply(minimize_button_);
|
||||
+ apply(maximize_button_);
|
||||
+ apply(restore_button_);
|
||||
+ apply(close_button_);
|
||||
+}
|
||||
+
|
||||
bool OpaqueBrowserFrameView::IsRegularOrGuestSession() const {
|
||||
return GetBrowserView()->GetRegularOrGuestSession();
|
||||
}
|
||||
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
|
||||
@@ -63,6 +63,7 @@ class OpaqueBrowserFrameView : public Br
|
||||
int GetTopInset(bool restored) const override;
|
||||
void UpdateThrobber(bool running) override;
|
||||
void WindowControlsOverlayEnabledChanged() override;
|
||||
+ void SetCaptionButtonsOpacity(float opacity) override;
|
||||
gfx::Size GetMinimumSize() const override;
|
||||
void PaintAsActiveChanged() override;
|
||||
void OnThemeChanged() override;
|
||||
@@ -0,0 +1,205 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -310,6 +310,12 @@
|
||||
<message name="IDS_SETTINGS_MINIMAL_LOCATION_BAR" desc="Label for the toggle that enables the minimal address bar.">
|
||||
Minimal address bar
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_ZEN_MODE" desc="Label for the toggle that enables zen mode, hiding browser chrome until hover.">
|
||||
+ Zen mode (experimental)
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_ZEN_MODE_DESCRIPTION" desc="Description for the zen mode toggle in appearance settings.">
|
||||
+ Hide toolbar and tab strip until hovering near their edges
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
|
||||
Show home button
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -512,6 +512,8 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
+ {"browserZenMode", IDS_SETTINGS_BROWSER_ZEN_MODE},
|
||||
+ {"browserZenModeDescription", IDS_SETTINGS_BROWSER_ZEN_MODE_DESCRIPTION},
|
||||
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
|
||||
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
|
||||
{"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
|
||||
@@ -577,6 +579,8 @@ void AddAppearanceStrings(content::WebUI
|
||||
base::FeatureList::IsEnabled(features::kTabHoverCardImages));
|
||||
html_source->AddBoolean("showVerticalTabsEnabled",
|
||||
tabs::IsVerticalTabsFeatureEnabled());
|
||||
+ html_source->AddBoolean("showZenModeEnabled",
|
||||
+ features::IsHeliumZenModeFeatureEnabled());
|
||||
|
||||
html_source->AddBoolean(
|
||||
"tabSearchIsRightAlignedAtStartup",
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -206,6 +206,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumMinimalLocationBar] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumZenMode] = settings_api::PrefType::kBoolean;
|
||||
|
||||
// Miscellaneous
|
||||
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
@@ -124,6 +124,12 @@
|
||||
pref="{{prefs.helium.browser.minimal_location_bar}}"
|
||||
label="$i18n{minimalLocationBar}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button
|
||||
+ hidden="[[!showZenModeEnabled_]]"
|
||||
+ pref="{{prefs.helium.browser.zen_mode}}"
|
||||
+ label="$i18n{browserZenMode}"
|
||||
+ sub-label="$i18n{browserZenModeDescription}">
|
||||
+ </settings-toggle-button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
@@ -250,6 +250,13 @@ export class SettingsAppearancePageEleme
|
||||
},
|
||||
},
|
||||
|
||||
+ showZenModeEnabled_: {
|
||||
+ type: Boolean,
|
||||
+ value() {
|
||||
+ return loadTimeData.getBoolean('showZenModeEnabled');
|
||||
+ },
|
||||
+ },
|
||||
+
|
||||
showTabSearchPositionRestartButton_: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
@@ -315,6 +322,7 @@ export class SettingsAppearancePageEleme
|
||||
// </if>
|
||||
|
||||
declare private showVerticalTabsEnabled_: boolean;
|
||||
+ declare private showZenModeEnabled_: boolean;
|
||||
declare private showTabSearchPositionRestartButton_: boolean;
|
||||
declare private showManagedThemeDialog_: boolean;
|
||||
declare private sidePanelOptions_: DropdownMenuOptionList;
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -25,6 +25,13 @@ bool HeliumUseCompactLocationWidth() {
|
||||
return base::FeatureList::IsEnabled(kHeliumCompactLocationWidth);
|
||||
}
|
||||
|
||||
+// Zen mode: hides browser chrome and reveals it on hover near edges.
|
||||
+BASE_FEATURE(kHeliumZenMode, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+bool IsHeliumZenModeFeatureEnabled() {
|
||||
+ return base::FeatureList::IsEnabled(kHeliumZenMode);
|
||||
+}
|
||||
+
|
||||
// Enables the use of WGC for the Eye Dropper screen capture.
|
||||
BASE_FEATURE(kAllowEyeDropperWGCScreenCapture,
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
--- a/chrome/browser/ui/ui_features.h
|
||||
+++ b/chrome/browser/ui/ui_features.h
|
||||
@@ -23,6 +23,9 @@ namespace features {
|
||||
BASE_DECLARE_FEATURE(kHeliumCompactLocationWidth);
|
||||
bool HeliumUseCompactLocationWidth();
|
||||
|
||||
+BASE_DECLARE_FEATURE(kHeliumZenMode);
|
||||
+bool IsHeliumZenModeFeatureEnabled();
|
||||
+
|
||||
BASE_DECLARE_FEATURE(kAllowEyeDropperWGCScreenCapture);
|
||||
|
||||
BASE_DECLARE_FEATURE(kBrowserWidgetCacheThemeService);
|
||||
--- a/chrome/browser/helium_flag_choices.h
|
||||
+++ b/chrome/browser/helium_flag_choices.h
|
||||
@@ -37,7 +37,7 @@ namespace helium {
|
||||
constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
|
||||
constexpr const char kHeliumCompactLocationWidthCommandLine[] =
|
||||
"helium-compact-location-width";
|
||||
-
|
||||
+ constexpr const char kHeliumZenModeCommandLine[] = "helium-zen-mode";
|
||||
} // namespace helium
|
||||
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_CHOICES_H_ */
|
||||
--- a/chrome/browser/helium_flag_entries.h
|
||||
+++ b/chrome/browser/helium_flag_entries.h
|
||||
@@ -41,4 +41,9 @@
|
||||
"Automatic address bar width in compact layout",
|
||||
"Allows the location bar to automatically reduce its width in the compact browser layout. The omnibox may be uncomfortable to use. Helium flag.",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kHeliumCompactLocationWidth)},
|
||||
+ {helium::kHeliumZenModeCommandLine,
|
||||
+ "Zen Mode",
|
||||
+ "Hides browser chrome (toolbar, tab strip, bookmarks bar) and reveals it "
|
||||
+ "on hover near the window edges. Helium flag.",
|
||||
+ kOsDesktop, FEATURE_VALUE_TYPE(features::kHeliumZenMode)},
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/chrome/browser/ui/helium/helium_layout_state_controller.cc
|
||||
+++ b/chrome/browser/ui/helium/helium_layout_state_controller.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
#include "chrome/browser/ui/tabs/features.h"
|
||||
+#include "chrome/browser/ui/ui_features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
|
||||
@@ -19,8 +20,8 @@ HeliumLayoutStateController::HeliumLayou
|
||||
*this) {
|
||||
pref_change_registrar_.Init(pref_service_);
|
||||
|
||||
- pref_change_registrar_.Add(
|
||||
- prefs::kHeliumLayout,
|
||||
+ pref_change_registrar_.AddMultiple(
|
||||
+ {prefs::kHeliumLayout, prefs::kHeliumZenMode},
|
||||
base::BindRepeating(&HeliumLayoutStateController::NotifyStateChanged,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
@@ -49,6 +50,11 @@ bool HeliumLayoutStateController::IsDyna
|
||||
return GetBrowserLayout() == HeliumLayoutType::kDynamic;
|
||||
}
|
||||
|
||||
+bool HeliumLayoutStateController::IsZenModeEnabled() const {
|
||||
+ return features::IsHeliumZenModeFeatureEnabled() &&
|
||||
+ pref_service_->GetBoolean(prefs::kHeliumZenMode);
|
||||
+}
|
||||
+
|
||||
void HeliumLayoutStateController::SetBrowserLayout(HeliumLayoutType layout) {
|
||||
pref_service_->SetInteger(prefs::kHeliumLayout, std::to_underlying(layout));
|
||||
}
|
||||
--- a/chrome/browser/ui/helium/helium_layout_state_controller.h
|
||||
+++ b/chrome/browser/ui/helium/helium_layout_state_controller.h
|
||||
@@ -39,6 +39,7 @@ class HeliumLayoutStateController {
|
||||
bool IsCompactLayout() const;
|
||||
bool IsVerticalLayout() const;
|
||||
bool IsDynamicLayout() const;
|
||||
+ bool IsZenModeEnabled() const;
|
||||
|
||||
void SetBrowserLayout(HeliumLayoutType layout);
|
||||
HeliumLayoutType GetBrowserLayout() const;
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_prefs.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_prefs.cc
|
||||
@@ -36,6 +36,8 @@ void RegisterProfilePrefs(user_prefs::Pr
|
||||
registry->RegisterIntegerPref(prefs::kHeliumLayout,
|
||||
std::to_underlying(HeliumLayoutType::kClassic));
|
||||
registry->RegisterBooleanPref(prefs::kHeliumVerticalRightAligned, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumZenMode, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumZenModeSidebarPinned, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumVerticalCollapsed, false);
|
||||
registry->RegisterIntegerPref(prefs::kHeliumVerticalUncollapsedWidth,
|
||||
kVerticalTabStripDefaultUncollapsedWidth);
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1321,6 +1321,13 @@ inline constexpr char kHeliumLayout[] =
|
||||
inline constexpr char kHeliumVerticalRightAligned[] =
|
||||
"helium.browser.vertical_right_aligned";
|
||||
|
||||
+// A boolean pref set to true if zen mode is enabled.
|
||||
+inline constexpr char kHeliumZenMode[] = "helium.browser.zen_mode";
|
||||
+
|
||||
+// A boolean pref set to true if the VTS is pinned (non-floating) in zen mode.
|
||||
+inline constexpr char kHeliumZenModeSidebarPinned[] =
|
||||
+ "helium.browser.zen_mode_sidebar_pinned";
|
||||
+
|
||||
// A boolean pref set to true if vertical tabs are collapsed.
|
||||
inline constexpr char kHeliumVerticalCollapsed[] =
|
||||
"helium.browser.vertical_collapsed";
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,15 @@
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -1316,6 +1316,8 @@ AppMenuButton* ToolbarView::GetAppMenuBu
|
||||
@@ -1316,8 +1316,7 @@ AppMenuButton* ToolbarView::GetAppMenuBu
|
||||
}
|
||||
|
||||
gfx::Rect ToolbarView::GetFindBarBoundingBox(int contents_bottom) {
|
||||
+ return gfx::Rect();
|
||||
+
|
||||
if (!browser_->SupportsWindowFeature(
|
||||
Browser::WindowFeature::kFeatureLocationBar)) {
|
||||
- if (!browser_->SupportsWindowFeature(
|
||||
- Browser::WindowFeature::kFeatureLocationBar)) {
|
||||
+ if ((true)) {
|
||||
return gfx::Rect();
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
||||
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
||||
@@ -514,7 +514,6 @@ void LocationBarView::Init() {
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
--- a/chrome/browser/ui/toasts/toast_view.cc
|
||||
+++ b/chrome/browser/ui/toasts/toast_view.cc
|
||||
@@ -49,9 +49,8 @@ constexpr float kAnimationHeightScale =
|
||||
@@ -44,14 +44,12 @@
|
||||
namespace {
|
||||
constexpr int kAnimationEntryDuration = 300;
|
||||
constexpr int kAnimationExitDuration = 150;
|
||||
-constexpr int kAnimationHeightOffset = 50;
|
||||
constexpr float kAnimationHeightScale = 0.5;
|
||||
|
||||
gfx::Transform GetScaleTransformation(gfx::Rect bounds) {
|
||||
gfx::Transform transform;
|
||||
@@ -12,7 +17,7 @@
|
||||
return transform;
|
||||
}
|
||||
|
||||
@@ -118,8 +117,7 @@ ToastView::ToastView(
|
||||
@@ -118,8 +116,7 @@ ToastView::ToastView(
|
||||
SetBackgroundColor(ui::kColorToastBackgroundProminent);
|
||||
SetShowCloseButton(false);
|
||||
DialogDelegate::SetButtons(static_cast<int>(ui::mojom::DialogButton::kNone));
|
||||
@@ -22,7 +27,7 @@
|
||||
SetProperty(views::kElementIdentifierKey, kToastElementId);
|
||||
set_close_on_deactivate(false);
|
||||
SetProperty(views::kElementIdentifierKey, kToastViewId);
|
||||
@@ -328,7 +326,7 @@ void ToastView::AnimateIn() {
|
||||
@@ -328,7 +325,7 @@ void ToastView::AnimateIn() {
|
||||
|
||||
target_widget_bounds_ = GetWidget()->GetWindowBoundsInScreen();
|
||||
starting_widget_bounds_ =
|
||||
@@ -31,7 +36,7 @@
|
||||
height_animation_tween_ = gfx::Tween::ACCEL_5_70_DECEL_90;
|
||||
height_animation_.SetDuration(base::Milliseconds(kAnimationEntryDuration));
|
||||
height_animation_.Start();
|
||||
@@ -410,13 +408,11 @@ gfx::Rect ToastView::GetBubbleBounds() {
|
||||
@@ -410,13 +407,11 @@ gfx::Rect ToastView::GetBubbleBounds() {
|
||||
const int width =
|
||||
std::min(preferred_size.width(),
|
||||
std::max(anchor_bounds.width() - 2 * minimum_margin, 0));
|
||||
@@ -47,7 +52,7 @@
|
||||
return gfx::Rect(x, y, width, preferred_size.height());
|
||||
}
|
||||
|
||||
@@ -448,7 +444,7 @@ void ToastView::AnimateOut(base::OnceClo
|
||||
@@ -448,7 +443,7 @@ void ToastView::AnimateOut(base::OnceClo
|
||||
if (show_height_animation) {
|
||||
starting_widget_bounds_ = GetWidget()->GetWindowBoundsInScreen();
|
||||
target_widget_bounds_ =
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
case BROWSER_APP_MENU_CHIP_PADDING:
|
||||
if (touch_ui) {
|
||||
@@ -208,11 +211,19 @@ gfx::Insets GetLayoutInsets(LayoutInset
|
||||
@@ -208,11 +211,13 @@ gfx::Insets GetLayoutInsets(LayoutInset
|
||||
if (touch_ui) {
|
||||
return GetLayoutInsets(TOOLBAR_BUTTON);
|
||||
} else {
|
||||
@@ -144,12 +144,6 @@
|
||||
- case TOOLBAR_INTERIOR_MARGIN:
|
||||
- return touch_ui ? gfx::Insets::VH(4, 0) : gfx::Insets::VH(6, 5);
|
||||
+ case TOOLBAR_INTERIOR_MARGIN: {
|
||||
+ const int vert = GetLayoutConstant(LayoutConstant::kHeliumBasePadding);
|
||||
+ const int horiz = vert * 2;
|
||||
+ return gfx::Insets::TLBR(0, horiz, vert, horiz);
|
||||
+ }
|
||||
+
|
||||
+ case FULL_TOOLBAR_INTERIOR_MARGIN: {
|
||||
+ const int base = GetLayoutConstant(LayoutConstant::kHeliumBasePadding);
|
||||
+ return gfx::Insets::VH(base, base * 2);
|
||||
+ }
|
||||
@@ -168,13 +162,3 @@
|
||||
// The size of the avatar icon in the profile row of the app menu.
|
||||
kAppMenuProfileRowAvatarIconSize,
|
||||
|
||||
@@ -282,6 +285,9 @@ enum LayoutInset {
|
||||
// The padding between the edges of the toolbar and its content.
|
||||
TOOLBAR_INTERIOR_MARGIN,
|
||||
|
||||
+ // The untrimmed padding for toolbar, used in Compact and Vertical layouts.
|
||||
+ FULL_TOOLBAR_INTERIOR_MARGIN,
|
||||
+
|
||||
// The padding between the edges of the toolbar and its content when the webui
|
||||
// tab strip is enabled. Special handling is needed as when the browser is
|
||||
// maximized and the tabstrip is collapsed the toolbar will sit flush with the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1328,6 +1328,11 @@ inline constexpr char kHeliumVerticalCol
|
||||
@@ -1329,6 +1329,11 @@ inline constexpr char kHeliumVerticalCol
|
||||
inline constexpr char kHeliumVerticalUncollapsedWidth[] =
|
||||
"helium.browser.vertical_uncollapsed_width";
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
constexpr int kBrowserAppMenuRefreshExpandedMargin = 5;
|
||||
constexpr int kBrowserAppMenuRefreshCollapsedMargin = 2;
|
||||
|
||||
+constexpr int kCenteredLocationBarMaxWidth = 800;
|
||||
+constexpr int kCenteredLocationBarMaxWidth = 700;
|
||||
+
|
||||
+struct CenteredLocationBarStep {
|
||||
+ int min_toolbar_width;
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
void ToolbarView::OnThemeChanged() {
|
||||
@@ -1491,6 +1519,48 @@ void ToolbarView::OnShowMediaButtonChang
|
||||
@@ -1488,6 +1516,48 @@ void ToolbarView::OnShowMediaButtonChang
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
+}
|
||||
+
|
||||
+void ToolbarView::MaybeCenterLocationBar() {
|
||||
+ if (ShouldDisplayToolbarTabStrip() || display_mode_ != DisplayMode::kNormal ||
|
||||
+ if (display_mode_ != DisplayMode::kNormal ||
|
||||
+ !location_bar_is_centered_.GetValue()) {
|
||||
+ return;
|
||||
+ }
|
||||
@@ -117,17 +117,17 @@
|
||||
+ }
|
||||
+
|
||||
+ gfx::Rect bounds = location_bar_view_->bounds();
|
||||
+ const int centered_width = std::clamp(
|
||||
+ bounds.width() - width_reduction,
|
||||
+ location_bar_view_->GetMinimumSize().width(),
|
||||
+ kCenteredLocationBarMaxWidth);
|
||||
+ const int centered_width =
|
||||
+ std::clamp(bounds.width() - width_reduction,
|
||||
+ location_bar_view_->GetMinimumSize().width(),
|
||||
+ kCenteredLocationBarMaxWidth);
|
||||
+
|
||||
+ // Keep the location bar centered within the full toolbar when that position
|
||||
+ // still fits. If surrounding controls push it out, center the location bar
|
||||
+ // within the available slot instead to avoid a one-sided gap.
|
||||
+ // Center against the full width of the toolbar's parent. If that position
|
||||
+ // does not fit in the slot assigned by layout, fall back to centering within
|
||||
+ // the slot instead.
|
||||
+ int centered_x = bounds.x() + (bounds.width() - centered_width) / 2;
|
||||
+ if (centered_width <= bounds.width()) {
|
||||
+ const int ideal_centered_x = (toolbar_width - centered_width) / 2;
|
||||
+ if (parent() && centered_width <= bounds.width()) {
|
||||
+ const int ideal_centered_x = (parent()->width() - centered_width) / 2 - x();
|
||||
+ const int min_centered_x = bounds.x();
|
||||
+ const int max_centered_x = bounds.right() - centered_width;
|
||||
+ if (ideal_centered_x >= min_centered_x &&
|
||||
@@ -147,7 +147,7 @@
|
||||
// Update the internal margins for touch layout.
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -301,6 +301,9 @@
|
||||
@@ -304,6 +304,9 @@
|
||||
<message name="IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN" desc="Label for the toggle that displays vertical tabs on the right side of the browser window.">
|
||||
Show vertical tabs on right side
|
||||
</message>
|
||||
@@ -159,7 +159,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -511,6 +511,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -512,6 +512,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
@@ -169,8 +169,8 @@
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -203,6 +203,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kNumber;
|
||||
@@ -202,6 +202,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
(*s_allowlist)[::prefs::kHeliumLayout] = settings_api::PrefType::kNumber;
|
||||
(*s_allowlist)[::prefs::kHeliumVerticalRightAligned] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumCenteredLocationBar] =
|
||||
@@ -180,7 +180,7 @@
|
||||
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
@@ -474,6 +474,10 @@ export class SettingsAppearancePageEleme
|
||||
@@ -479,6 +479,10 @@ export class SettingsAppearancePageEleme
|
||||
return this.showVerticalTabsEnabled_ && layout === BrowserLayout.VERTICAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -18,6 +18,14 @@
|
||||
@@ -18,6 +18,13 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+// Automatic location bar width in compact layout
|
||||
+BASE_FEATURE(kHeliumCompactLocationWidth,
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kHeliumCompactLocationWidth, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+bool HeliumUseCompactLocationWidth() {
|
||||
+ return base::FeatureList::IsEnabled(kHeliumCompactLocationWidth);
|
||||
@@ -69,17 +68,16 @@
|
||||
// Returns whether or not strokes should be drawn around and under the tabs.
|
||||
bool ShouldDrawTabStrokes() const;
|
||||
|
||||
@@ -946,6 +950,9 @@ class BrowserView : public BrowserWindow
|
||||
@@ -946,6 +950,8 @@ class BrowserView : public BrowserWindow
|
||||
void OnVerticalTabStripModeChanged(
|
||||
tabs::VerticalTabStripStateController* controller);
|
||||
|
||||
+ void OnToolbarTabStripStateChanged(
|
||||
+ HeliumLayoutStateController* controller);
|
||||
+ void OnToolbarTabStripStateChanged(HeliumLayoutStateController* controller);
|
||||
+
|
||||
void OnProjectsPanelStateChanged(ProjectsPanelStateController* controller);
|
||||
|
||||
// Make sure the WebUI tab strip exists if it should.
|
||||
@@ -1450,6 +1457,8 @@ class BrowserView : public BrowserWindow
|
||||
@@ -1450,6 +1456,8 @@ class BrowserView : public BrowserWindow
|
||||
|
||||
PrefChangeRegistrar registrar_;
|
||||
|
||||
@@ -100,20 +98,19 @@
|
||||
}
|
||||
|
||||
bool BrowserView::ShouldDrawVerticalTabStrip() const {
|
||||
@@ -1496,6 +1497,12 @@ bool BrowserView::ShouldDrawWebAppFrameT
|
||||
@@ -1496,6 +1497,11 @@ bool BrowserView::ShouldDrawWebAppFrameT
|
||||
GetFrameView()->ShouldShowWebAppFrameToolbar();
|
||||
}
|
||||
|
||||
+bool BrowserView::ShouldDrawToolbarTabStrip() const {
|
||||
+ auto* controller = HeliumLayoutStateController::From(browser_);
|
||||
+ return controller && controller->ShouldDisplayToolbarTabStrip() &&
|
||||
+ GetIsNormalType();
|
||||
+ return controller && controller->IsCompactLayout() && GetIsNormalType();
|
||||
+}
|
||||
+
|
||||
bool BrowserView::IsVerticalTabStripCollapsed() const {
|
||||
if (auto* const controller =
|
||||
tabs::VerticalTabStripStateController::From(browser_)) {
|
||||
@@ -1615,6 +1622,32 @@ void BrowserView::OnVerticalTabStripMode
|
||||
@@ -1615,6 +1621,31 @@ void BrowserView::OnVerticalTabStripMode
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
||||
@@ -123,8 +120,7 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (controller && controller->ShouldDisplayToolbarTabStrip() &&
|
||||
+ GetIsNormalType()) {
|
||||
+ if (controller && controller->IsCompactLayout() && GetIsNormalType()) {
|
||||
+ toolbar_->AttachTabStripRegionView(horizontal_tab_strip_region_view_);
|
||||
+ } else if (horizontal_tab_strip_region_view_->parent() != this) {
|
||||
+ if (horizontal_tab_strip_region_insertion_index_) {
|
||||
@@ -146,7 +142,7 @@
|
||||
void BrowserView::OnProjectsPanelStateChanged(
|
||||
ProjectsPanelStateController* controller) {
|
||||
projects_panel_container_->OnProjectsPanelStateChanged(controller);
|
||||
@@ -4059,9 +4092,10 @@ void BrowserView::ReparentTabStripAndWeb
|
||||
@@ -4059,9 +4090,10 @@ void BrowserView::ReparentTabStripAndWeb
|
||||
// The TabStrip must be placed in the same position before the reparenting
|
||||
// to maintain the correct Z-order to ensure it can receive mouse events.
|
||||
// See crbug.com/454852658.
|
||||
@@ -160,7 +156,7 @@
|
||||
|
||||
// Reparent PWA views that were moved for immersive and ChromeOS tablet
|
||||
// mode.
|
||||
@@ -5152,6 +5186,16 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5152,6 +5184,16 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
toolbar_->Init();
|
||||
|
||||
@@ -179,15 +175,7 @@
|
||||
// TODO(pbos): Investigate whether the side panels should be creatable when
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "chrome/browser/ui/global_error/global_error_service.h"
|
||||
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
|
||||
#include "chrome/browser/ui/global_media_controls/media_toolbar_button_controller.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/intent_picker_tab_helper.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/omnibox/omnibox_view.h"
|
||||
@@ -64,6 +65,7 @@
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "chrome/browser/ui/views/extensions/extensions_toolbar_desktop.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
#include "chrome/browser/ui/views/frame/custom_corners_background.h"
|
||||
@@ -195,41 +183,20 @@
|
||||
#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h"
|
||||
#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h"
|
||||
#include "chrome/browser/ui/views/location_bar/intent_chip_button.h"
|
||||
@@ -155,6 +157,12 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActi
|
||||
@@ -156,6 +157,7 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActi
|
||||
|
||||
namespace {
|
||||
|
||||
+constexpr int kPreferredCompactWidth = 350;
|
||||
+constexpr int kToolbarFlexOrderOffset = 1000;
|
||||
+constexpr int kLocationBarFlexOrder = kToolbarFlexOrderOffset + 1;
|
||||
+constexpr int kToolbarActionsFlexOrder = kToolbarFlexOrderOffset + 2;
|
||||
+constexpr int kExtensionsFlexOrder = kToolbarFlexOrderOffset + 3;
|
||||
+
|
||||
// Gets the display mode for a given browser.
|
||||
ToolbarView::DisplayMode GetDisplayMode(Browser* browser) {
|
||||
// Checked in this order because even tabbed PWAs use the CUSTOM_TAB
|
||||
@@ -598,10 +606,15 @@ void ToolbarView::Init() {
|
||||
|
||||
InitLayout();
|
||||
|
||||
+ auto flex_preferred = views::FlexSpecification(
|
||||
+ views::MinimumFlexSizeRule::kPreferred,
|
||||
+ views::MaximumFlexSizeRule::kPreferred);
|
||||
+
|
||||
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
|
||||
home_, avatar_}) {
|
||||
if (button) {
|
||||
button->set_tag(GetViewCommandMap().at(button->GetID()));
|
||||
+ button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -876,6 +889,22 @@ bool ToolbarView::IsRectInWindowCaption(
|
||||
constexpr int kToolbarFlexOrderOffset = 1000;
|
||||
constexpr int kLocationBarFlexOrder = kToolbarFlexOrderOffset + 1;
|
||||
constexpr int kToolbarActionsFlexOrder = kToolbarFlexOrderOffset + 2;
|
||||
@@ -887,6 +889,22 @@ bool ToolbarView::IsRectInWindowCaption(
|
||||
return gfx::ToEnclosingRect(rect_in_target_coords_f);
|
||||
};
|
||||
|
||||
+ // Check the tab strip region first if compact layout is enabled.
|
||||
+ if (ShouldDisplayToolbarTabStrip() && tab_strip_region_view_) {
|
||||
+ if (IsCompactLayout() && tab_strip_region_view_) {
|
||||
+ const gfx::Rect tab_strip_rect = get_target_rect(tab_strip_region_view_);
|
||||
+ if (tab_strip_region_view_->GetLocalBounds().Intersects(tab_strip_rect)) {
|
||||
+ // Check if the rect is actually on the tab strip region view.
|
||||
@@ -247,61 +214,11 @@
|
||||
// Check each child view to see if the rect intersects with
|
||||
// any clickable elements. If it does, check if the click is actually on that
|
||||
// element. False if on a clickable element, true if not on a clickable element.
|
||||
@@ -1152,22 +1181,6 @@ views::View* ToolbarView::GetDefaultFocu
|
||||
void ToolbarView::InitLayout() {
|
||||
const int default_margin =
|
||||
GetLayoutConstant(LayoutConstant::kToolbarIconDefaultMargin);
|
||||
- // TODO(dfried): rename this constant.
|
||||
- const int location_bar_margin =
|
||||
- GetLayoutConstant(LayoutConstant::kToolbarStandardSpacing);
|
||||
-
|
||||
- // Shift previously flex-able elements' order by `kOrderOffset`.
|
||||
- // This will cause them to be the first ones to drop out or shrink to minimum.
|
||||
- // Order 1 - kOrderOffset will be assigned to new flex-able elements.
|
||||
- constexpr int kOrderOffset = 1000;
|
||||
- constexpr int kLocationBarFlexOrder = kOrderOffset + 1;
|
||||
- constexpr int kToolbarActionsFlexOrder = kOrderOffset + 2;
|
||||
- constexpr int kExtensionsFlexOrder = kOrderOffset + 3;
|
||||
-
|
||||
- const views::FlexSpecification location_bar_flex_rule =
|
||||
- views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum,
|
||||
- views::MaximumFlexSizeRule::kUnbounded)
|
||||
- .WithOrder(kLocationBarFlexOrder);
|
||||
|
||||
layout_manager_ = SetLayoutManager(std::make_unique<views::FlexLayout>());
|
||||
|
||||
@@ -1176,12 +1189,7 @@ void ToolbarView::InitLayout() {
|
||||
.SetCollapseMargins(true)
|
||||
.SetDefault(views::kMarginsKey, gfx::Insets::VH(0, default_margin));
|
||||
|
||||
- if (location_bar_view_) {
|
||||
- location_bar_view_->SetProperty(views::kFlexBehaviorKey,
|
||||
- location_bar_flex_rule);
|
||||
- location_bar_view_->SetProperty(views::kMarginsKey,
|
||||
- gfx::Insets::VH(0, location_bar_margin));
|
||||
- }
|
||||
+ UpdateToolbarLayout();
|
||||
|
||||
if (extensions_container_) {
|
||||
const views::FlexSpecification extensions_flex_rule =
|
||||
@@ -1231,6 +1239,11 @@ void ToolbarView::LayoutCommon() {
|
||||
? LayoutInset::WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN
|
||||
: LayoutInset::TOOLBAR_INTERIOR_MARGIN);
|
||||
|
||||
+ if (ShouldDisplayToolbarTabStrip()) {
|
||||
+ interior_margin = GetLayoutInsets(
|
||||
+ LayoutInset::FULL_TOOLBAR_INTERIOR_MARGIN);
|
||||
+ }
|
||||
+
|
||||
if (!browser_view_->webui_tab_strip()) {
|
||||
if (app_menu_button_->IsLabelPresentAndVisible()) {
|
||||
// The interior margin in an expanded state should be more than in a
|
||||
@@ -1276,6 +1289,99 @@ void ToolbarView::LayoutCommon() {
|
||||
@@ -1264,6 +1282,30 @@ void ToolbarView::LayoutCommon() {
|
||||
// Cast button visibility is controlled externally.
|
||||
}
|
||||
|
||||
+void ToolbarView::AttachTabStripRegionView(
|
||||
+ HorizontalTabStripRegionView* view) {
|
||||
+void ToolbarView::AttachTabStripRegionView(HorizontalTabStripRegionView* view) {
|
||||
+ if (!view) {
|
||||
+ return;
|
||||
+ }
|
||||
@@ -311,12 +228,10 @@
|
||||
+ if (views::View* parent = tab_strip_region_view_->parent()) {
|
||||
+ std::unique_ptr<views::View> owned_view =
|
||||
+ parent->RemoveChildViewT(tab_strip_region_view_);
|
||||
+ auto location_bar_index = location_bar_view_
|
||||
+ ? GetIndexOf(location_bar_view_)
|
||||
+ : std::nullopt;
|
||||
+ auto location_bar_index =
|
||||
+ location_bar_view_ ? GetIndexOf(location_bar_view_) : std::nullopt;
|
||||
+ const size_t insertion_index =
|
||||
+ location_bar_index ? *location_bar_index + 1
|
||||
+ : children().size();
|
||||
+ location_bar_index ? *location_bar_index + 1 : children().size();
|
||||
+ AddChildViewAt(std::move(owned_view), insertion_index);
|
||||
+ }
|
||||
+
|
||||
@@ -327,75 +242,30 @@
|
||||
+ InvalidateLayout();
|
||||
+}
|
||||
+
|
||||
+void ToolbarView::UpdateToolbarLayout() {
|
||||
+ if (!location_bar_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const auto flex_preferred = views::FlexSpecification(
|
||||
+ views::MinimumFlexSizeRule::kPreferred,
|
||||
+ views::MaximumFlexSizeRule::kPreferred);
|
||||
+ const int location_bar_margin =
|
||||
+ GetLayoutConstant(LayoutConstant::kToolbarStandardSpacing);
|
||||
void ToolbarView::UpdateToolbarLayout() {
|
||||
if (!location_bar_) {
|
||||
return;
|
||||
@@ -1274,7 +1316,10 @@ void ToolbarView::UpdateToolbarLayout()
|
||||
views::MaximumFlexSizeRule::kPreferred);
|
||||
const int location_bar_margin =
|
||||
GetLayoutConstant(LayoutConstant::kToolbarStandardSpacing);
|
||||
- const auto min_location_bar_flex = views::MinimumFlexSizeRule::kPreferred;
|
||||
+ const auto min_location_bar_flex =
|
||||
+ features::HeliumUseCompactLocationWidth()
|
||||
+ ? views::MinimumFlexSizeRule::kScaleToMinimum
|
||||
+ : views::MinimumFlexSizeRule::kPreferred;
|
||||
+ const views::FlexSpecification location_bar_flex_rule =
|
||||
+ views::FlexSpecification(min_location_bar_flex,
|
||||
+ views::MaximumFlexSizeRule::kUnbounded)
|
||||
+ .WithOrder(kLocationBarFlexOrder);
|
||||
+
|
||||
+ const bool use_toolbar_tab_strip = ShouldDisplayToolbarTabStrip();
|
||||
+ const auto make_flex_rule = [&](auto* layout_manager, int order) {
|
||||
+ return use_toolbar_tab_strip
|
||||
+ ? flex_preferred
|
||||
+ : views::FlexSpecification(layout_manager->GetDefaultFlexRule())
|
||||
+ .WithOrder(order);
|
||||
+ };
|
||||
+
|
||||
+ location_bar_view_->SetProperty(views::kFlexBehaviorKey,
|
||||
+ location_bar_flex_rule);
|
||||
+ if (use_toolbar_tab_strip) {
|
||||
+ location_bar_view_->SetPreferredSize(gfx::Size(kPreferredCompactWidth, 0));
|
||||
+ location_bar_view_->SetProperty(
|
||||
+ views::kMarginsKey, gfx::Insets::TLBR(0, location_bar_margin, 0, 0));
|
||||
+ } else {
|
||||
+ location_bar_view_->SetPreferredSize(std::nullopt);
|
||||
+ location_bar_view_->SetProperty(views::kMarginsKey,
|
||||
+ gfx::Insets::VH(0, location_bar_margin));
|
||||
+ }
|
||||
+
|
||||
+ // Pinned actions (including downloads) and extensions
|
||||
+ // should not shrink in compact layout.
|
||||
+ if (pinned_toolbar_actions_container_) {
|
||||
+ pinned_toolbar_actions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey,
|
||||
+ make_flex_rule(
|
||||
+ pinned_toolbar_actions_container_->GetAnimatingLayoutManager(),
|
||||
+ kToolbarActionsFlexOrder));
|
||||
+ }
|
||||
+
|
||||
+ if (extensions_container_) {
|
||||
+ extensions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey,
|
||||
+ make_flex_rule(
|
||||
+ extensions_container_->GetAnimatingLayoutManager(),
|
||||
+ kExtensionsFlexOrder));
|
||||
+ }
|
||||
+
|
||||
+ InvalidateLayout();
|
||||
+}
|
||||
+
|
||||
+bool ToolbarView::ShouldDisplayToolbarTabStrip() const {
|
||||
+ auto* controller = HeliumLayoutStateController::From(
|
||||
+ browser_view_->browser());
|
||||
+ return controller && controller->ShouldDisplayToolbarTabStrip();
|
||||
+}
|
||||
+
|
||||
// AppMenuIconController::Delegate:
|
||||
void ToolbarView::UpdateTypeAndSeverity(
|
||||
AppMenuIconController::TypeAndSeverity type_and_severity) {
|
||||
const views::FlexSpecification location_bar_flex_rule =
|
||||
views::FlexSpecification(min_location_bar_flex,
|
||||
views::MaximumFlexSizeRule::kUnbounded)
|
||||
@@ -1571,7 +1616,7 @@ void ToolbarView::OnLocationBarCenteredC
|
||||
}
|
||||
|
||||
void ToolbarView::MaybeCenterLocationBar() {
|
||||
- if (display_mode_ != DisplayMode::kNormal ||
|
||||
+ if (IsCompactLayout() || display_mode_ != DisplayMode::kNormal ||
|
||||
!location_bar_is_centered_.GetValue()) {
|
||||
return;
|
||||
}
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
@@ -61,6 +61,7 @@ class AvatarToolbarButtonBrowserTest;
|
||||
@@ -406,29 +276,17 @@
|
||||
|
||||
namespace views {
|
||||
class FlexLayout;
|
||||
@@ -152,6 +153,12 @@ class ToolbarView : public views::Access
|
||||
// Shows a bookmark bubble and anchors it appropriately.
|
||||
void ShowBookmarkBubble(const GURL& url, bool already_bookmarked);
|
||||
@@ -155,6 +156,9 @@ class ToolbarView : public views::Access
|
||||
// Updates the toolbar for the current browser layout.
|
||||
void UpdateToolbarLayout();
|
||||
|
||||
+ // Attaches the tab strip region view when compact layout is enabled.
|
||||
+ void AttachTabStripRegionView(HorizontalTabStripRegionView* view);
|
||||
+
|
||||
+ // Updates the toolbar for the current browser layout.
|
||||
+ void UpdateToolbarLayout();
|
||||
+
|
||||
// Accessors.
|
||||
Browser* browser() const { return browser_; }
|
||||
views::Button* GetChromeLabsButton() const;
|
||||
@@ -237,6 +244,8 @@ class ToolbarView : public views::Access
|
||||
// Logic that must be done on initialization and then on layout.
|
||||
void LayoutCommon();
|
||||
|
||||
+ bool ShouldDisplayToolbarTabStrip() const;
|
||||
+
|
||||
// AppMenuIconController::Delegate:
|
||||
void UpdateTypeAndSeverity(
|
||||
AppMenuIconController::TypeAndSeverity type_and_severity) override;
|
||||
@@ -345,6 +354,7 @@ class ToolbarView : public views::Access
|
||||
@@ -351,6 +355,7 @@ class ToolbarView : public views::Access
|
||||
raw_ptr<BrowserAppMenuButton> app_menu_button_ = nullptr;
|
||||
raw_ptr<views::View> new_tab_button_ = nullptr;
|
||||
raw_ptr<PinnedActionToolbarButton> tab_search_button_ = nullptr;
|
||||
@@ -462,7 +320,7 @@
|
||||
+ /*is_section_end=*/true)});
|
||||
+
|
||||
+ auto* controller = HeliumLayoutStateController::From(browser);
|
||||
+ bool is_compact = controller && controller->ShouldDisplayToolbarTabStrip();
|
||||
+ bool is_compact = controller && controller->IsCompactLayout();
|
||||
+ if (!is_compact) {
|
||||
+ elements.push_back(ToolbarController::ResponsiveElementInfo(
|
||||
+ ToolbarController::ElementIdInfo(
|
||||
@@ -476,20 +334,9 @@
|
||||
return elements;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
@@ -107,7 +107,7 @@ class BrowserViewTabbedLayoutImpl : publ
|
||||
const BrowserLayoutParams& params) const;
|
||||
|
||||
// Returns the type of tabstrip present.
|
||||
- enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal };
|
||||
+ enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal, kToolbar };
|
||||
TabStripType GetTabStripType() const;
|
||||
|
||||
// Returns whether the shadow overlay (with its attendant margin) around the
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
@@ -156,6 +156,9 @@ BrowserViewTabbedLayoutImpl::GetMinimumT
|
||||
@@ -166,6 +166,9 @@ BrowserViewTabbedLayoutImpl::GetMinimumT
|
||||
}
|
||||
return std::make_pair(result, gfx::Size());
|
||||
}
|
||||
@@ -499,7 +346,7 @@
|
||||
case TabStripType::kWebUi:
|
||||
// WebUI tabstrip is lazily-created.
|
||||
return std::make_pair(gfx::Size(),
|
||||
@@ -406,6 +409,9 @@ BrowserViewTabbedLayoutImpl::GetTabStrip
|
||||
@@ -419,6 +422,9 @@ BrowserViewTabbedLayoutImpl::GetTabStrip
|
||||
#endif
|
||||
return TabStripType::kVertical;
|
||||
}
|
||||
@@ -509,19 +356,6 @@
|
||||
return delegate().ShouldDrawTabStrip() ? TabStripType::kHorizontal
|
||||
: TabStripType::kNone;
|
||||
}
|
||||
@@ -976,9 +982,11 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
if (IsParentedTo(views().toolbar, views().top_container)) {
|
||||
gfx::Rect toolbar_bounds;
|
||||
if (toolbar_visible) {
|
||||
+ // Visually clamp two conflicting margins: window controls & toolbar
|
||||
+ const int exclusion = tab_strip_type == TabStripType::kToolbar ? 10 : 0;
|
||||
toolbar_bounds =
|
||||
needs_exclusion
|
||||
- ? GetBoundsWithExclusion(params, views().toolbar)
|
||||
+ ? GetBoundsWithExclusion(params, views().toolbar, exclusion)
|
||||
: gfx::Rect(params.visual_client_area.x(),
|
||||
params.visual_client_area.y(),
|
||||
params.visual_client_area.width(),
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h
|
||||
@@ -29,6 +29,7 @@ class BrowserViewLayoutDelegate {
|
||||
@@ -555,54 +389,14 @@
|
||||
bool IsVerticalTabStripCollapsed() const override;
|
||||
bool IsVerticalTabStripRightAligned() const override;
|
||||
bool ShouldDrawWebAppFrameToolbar() const override;
|
||||
--- a/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
#include "chrome/browser/ui/frame/window_frame_util.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/tab_search_feature.h"
|
||||
#include "chrome/browser/ui/tabs/features.h"
|
||||
@@ -80,7 +81,8 @@ class FrameGrabHandle : public views::Vi
|
||||
METADATA_HEADER(FrameGrabHandle, views::View)
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
@@ -108,7 +108,7 @@ class BrowserViewTabbedLayoutImpl : publ
|
||||
const BrowserLayoutParams& params) const;
|
||||
|
||||
public:
|
||||
- FrameGrabHandle() {
|
||||
+ explicit FrameGrabHandle(TabStrip* tab_strip)
|
||||
+ : tab_strip_(tab_strip->AsWeakPtr()) {
|
||||
SetProperty(views::kElementIdentifierKey,
|
||||
kTabStripFrameGrabHandleElementId);
|
||||
}
|
||||
@@ -91,8 +93,21 @@ class FrameGrabHandle : public views::Vi
|
||||
// is full.
|
||||
// TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-grab-handle")) return gfx::Size(0, 0);
|
||||
+
|
||||
+ // Remove the grab handle in compact layout
|
||||
+ if (tab_strip_ && tab_strip_->GetBrowserWindowInterface()) {
|
||||
+ auto* controller = HeliumLayoutStateController::From(
|
||||
+ tab_strip_->GetBrowserWindowInterface());
|
||||
+ if (controller && controller->ShouldDisplayToolbarTabStrip()) {
|
||||
+ return gfx::Size(0, 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return gfx::Size(27, 0);
|
||||
}
|
||||
+
|
||||
+ private:
|
||||
+ base::WeakPtr<TabStrip> tab_strip_;
|
||||
};
|
||||
|
||||
BEGIN_METADATA(FrameGrabHandle)
|
||||
@@ -296,7 +311,7 @@ HorizontalTabStripRegionView::Horizontal
|
||||
}
|
||||
|
||||
reserved_grab_handle_space_ =
|
||||
- AddChildView(std::make_unique<FrameGrabHandle>());
|
||||
+ AddChildView(std::make_unique<FrameGrabHandle>(tab_strip_));
|
||||
reserved_grab_handle_space_->SetProperty(
|
||||
views::kFlexBehaviorKey,
|
||||
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
|
||||
// Returns the type of tabstrip present.
|
||||
- enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal };
|
||||
+ enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal, kToolbar };
|
||||
HeliumLayoutType GetHeliumLayout() const;
|
||||
bool IsDynamicTabStrip(TabStripType tab_strip_type) const;
|
||||
bool ShowDynamicTabStrip(TabStripType tab_strip_type) const;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -95,15 +95,11 @@
|
||||
@@ -95,15 +95,12 @@
|
||||
|
||||
// Helium commands
|
||||
#define IDC_COPY_OR_INSPECT_SHORTCUT 34080
|
||||
@@ -14,16 +14,17 @@
|
||||
-#define IDC_VISIT_DESKTOP_OF_LRU_USER_LAST IDC_VISIT_DESKTOP_OF_LRU_USER_5
|
||||
-#endif
|
||||
+#define IDC_BROWSER_LAYOUT_MENU 34081
|
||||
+#define IDC_BROWSER_LAYOUT_HORIZONTAL 34082
|
||||
+#define IDC_BROWSER_LAYOUT_CLASSIC 34082
|
||||
+#define IDC_BROWSER_LAYOUT_COMPACT 34083
|
||||
+#define IDC_BROWSER_LAYOUT_VERTICAL 34084
|
||||
+#define IDC_BROWSER_LAYOUT_VERTICAL_RIGHT 34085
|
||||
+#define IDC_BROWSER_LAYOUT_DYNAMIC 34086
|
||||
|
||||
// Tab group Commands
|
||||
#define IDC_ADD_NEW_TAB_TO_GROUP 34100
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -10444,6 +10444,45 @@ Keep your key file in a safe place. You
|
||||
@@ -10444,6 +10444,51 @@ Keep your key file in a safe place. You
|
||||
Create split view
|
||||
</message>
|
||||
|
||||
@@ -33,9 +34,12 @@
|
||||
+ <message name="IDS_BROWSER_LAYOUT_MENU" desc="In Title Case: The submenu for browser layout options.">
|
||||
+ Browser Layout
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_HORIZONTAL" desc="In Title Case: Option for horizontal layout.">
|
||||
+ <message name="IDS_BROWSER_LAYOUT_CLASSIC" desc="In Title Case: Option for classic layout.">
|
||||
+ Classic
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_DYNAMIC" desc="In Title Case: Option for dynamic layout.">
|
||||
+ Dynamic
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_COMPACT" desc="In Title Case: Option for compact layout.">
|
||||
+ Compact
|
||||
+ </message>
|
||||
@@ -50,9 +54,12 @@
|
||||
+ <message name="IDS_BROWSER_LAYOUT_MENU" desc="The submenu for browser layout options.">
|
||||
+ Browser layout
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_HORIZONTAL" desc="Option for horizontal layout.">
|
||||
+ <message name="IDS_BROWSER_LAYOUT_CLASSIC" desc="Option for classic layout.">
|
||||
+ Classic
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_DYNAMIC" desc="Option for dynamic layout.">
|
||||
+ Dynamic
|
||||
+ </message>
|
||||
+ <message name="IDS_BROWSER_LAYOUT_COMPACT" desc="Option for compact layout.">
|
||||
+ Compact
|
||||
+ </message>
|
||||
@@ -98,24 +105,21 @@
|
||||
#include "chrome/browser/ui/intent_picker_tab_helper.h"
|
||||
#include "chrome/browser/ui/lens/lens_search_controller.h"
|
||||
#include "chrome/browser/ui/location_bar/location_bar.h"
|
||||
@@ -2207,6 +2208,23 @@ void ToggleVerticalTabs(Browser* browser
|
||||
@@ -2207,6 +2208,20 @@ void ToggleVerticalTabs(Browser* browser
|
||||
: "SwitchToVerticalTabStrip"));
|
||||
}
|
||||
|
||||
+void SetBrowserLayout(Browser* browser, HeliumLayoutType layout) {
|
||||
+ auto* controller =
|
||||
+ HeliumLayoutStateController::From(browser);
|
||||
+ auto* controller = HeliumLayoutStateController::From(browser);
|
||||
+ if (controller) {
|
||||
+ controller->SetBrowserLayout(layout);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void ToggleVerticalTabStripRightAligned(Browser* browser) {
|
||||
+ auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser);
|
||||
+ auto* controller = tabs::VerticalTabStripStateController::From(browser);
|
||||
+ if (controller) {
|
||||
+ controller->SetTabStripRightAligned(
|
||||
+ !controller->IsTabStripRightAligned());
|
||||
+ controller->SetTabStripRightAligned(!controller->IsTabStripRightAligned());
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
@@ -124,15 +128,18 @@
|
||||
tab_search::mojom::TabSearchSection::kOrganize,
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -697,6 +697,18 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -697,6 +697,21 @@ bool BrowserCommandController::ExecuteCo
|
||||
case IDC_NAME_WINDOW:
|
||||
PromptToNameWindow(browser_);
|
||||
break;
|
||||
+ case IDC_BROWSER_LAYOUT_HORIZONTAL:
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kHorizontal);
|
||||
+ case IDC_BROWSER_LAYOUT_CLASSIC:
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kClassic);
|
||||
+ break;
|
||||
+ case IDC_BROWSER_LAYOUT_DYNAMIC:
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kDynamic);
|
||||
+ break;
|
||||
+ case IDC_BROWSER_LAYOUT_COMPACT:
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kToolbar);
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kCompact);
|
||||
+ break;
|
||||
+ case IDC_BROWSER_LAYOUT_VERTICAL:
|
||||
+ SetBrowserLayout(browser_, HeliumLayoutType::kVertical);
|
||||
@@ -143,13 +150,14 @@
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
case IDC_TAKE_SCREENSHOT:
|
||||
@@ -1514,6 +1526,14 @@ void BrowserCommandController::InitComma
|
||||
@@ -1514,6 +1529,15 @@ void BrowserCommandController::InitComma
|
||||
command_updater_.UpdateCommandEnabled(IDC_SHOW_SEARCH_TOOLS, true);
|
||||
command_updater_.UpdateCommandEnabled(IDC_SHOW_AI_MODE_OMNIBOX_BUTTON, true);
|
||||
|
||||
+ // Helium layout menu
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_MENU, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_HORIZONTAL, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_CLASSIC, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_DYNAMIC, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_COMPACT, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_VERTICAL, true);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_BROWSER_LAYOUT_VERTICAL_RIGHT,
|
||||
@@ -188,7 +196,7 @@
|
||||
SystemMenuModelBuilder::SystemMenuModelBuilder(
|
||||
ui::AcceleratorProvider* provider,
|
||||
Browser* browser)
|
||||
@@ -107,6 +103,25 @@ void SystemMenuModelBuilder::BuildSystem
|
||||
@@ -107,6 +103,26 @@ void SystemMenuModelBuilder::BuildSystem
|
||||
|
||||
if (!browser()->profile()->IsOffTheRecord()) {
|
||||
model->AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
@@ -197,15 +205,16 @@
|
||||
+ std::make_unique<ui::SimpleMenuModel>(&menu_delegate_);
|
||||
+
|
||||
+ browser_layout_menu_contents_->AddCheckItemWithStringId(
|
||||
+ IDC_BROWSER_LAYOUT_HORIZONTAL, IDS_BROWSER_LAYOUT_HORIZONTAL);
|
||||
+ IDC_BROWSER_LAYOUT_CLASSIC, IDS_BROWSER_LAYOUT_CLASSIC);
|
||||
+ browser_layout_menu_contents_->AddCheckItemWithStringId(
|
||||
+ IDC_BROWSER_LAYOUT_DYNAMIC, IDS_BROWSER_LAYOUT_DYNAMIC);
|
||||
+ browser_layout_menu_contents_->AddCheckItemWithStringId(
|
||||
+ IDC_BROWSER_LAYOUT_COMPACT, IDS_BROWSER_LAYOUT_COMPACT);
|
||||
+ browser_layout_menu_contents_->AddCheckItemWithStringId(
|
||||
+ IDC_BROWSER_LAYOUT_VERTICAL, IDS_BROWSER_LAYOUT_VERTICAL);
|
||||
+ browser_layout_menu_contents_->AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
+ browser_layout_menu_contents_->AddCheckItemWithStringId(
|
||||
+ IDC_BROWSER_LAYOUT_VERTICAL_RIGHT,
|
||||
+ IDS_BROWSER_LAYOUT_VERTICAL_RIGHT);
|
||||
+ IDC_BROWSER_LAYOUT_VERTICAL_RIGHT, IDS_BROWSER_LAYOUT_VERTICAL_RIGHT);
|
||||
+
|
||||
+ model->AddSubMenuWithStringId(IDC_BROWSER_LAYOUT_MENU,
|
||||
+ IDS_BROWSER_LAYOUT_MENU,
|
||||
@@ -214,7 +223,7 @@
|
||||
model->AddItemWithStringId(IDC_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL,
|
||||
IDS_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL);
|
||||
}
|
||||
@@ -123,41 +138,6 @@ void SystemMenuModelBuilder::BuildSystem
|
||||
@@ -123,41 +139,6 @@ void SystemMenuModelBuilder::BuildSystem
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
#endif // BUILDFLAG(ENABLE_GLIC)
|
||||
|
||||
@@ -266,23 +275,25 @@
|
||||
#include "chrome/browser/ui/tabs/vertical_tab_strip_state_controller.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -47,6 +48,32 @@ bool SystemMenuModelDelegate::IsCommandI
|
||||
@@ -47,6 +48,34 @@ bool SystemMenuModelDelegate::IsCommandI
|
||||
return !prefs->GetBoolean(prefs::kUseCustomChromeFrame);
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+ if (command_id == IDC_BROWSER_LAYOUT_HORIZONTAL ||
|
||||
+ if (command_id == IDC_BROWSER_LAYOUT_CLASSIC ||
|
||||
+ command_id == IDC_BROWSER_LAYOUT_DYNAMIC ||
|
||||
+ command_id == IDC_BROWSER_LAYOUT_COMPACT ||
|
||||
+ command_id == IDC_BROWSER_LAYOUT_VERTICAL) {
|
||||
+ auto* layout_controller =
|
||||
+ HeliumLayoutStateController::From(browser_);
|
||||
+ auto* layout_controller = HeliumLayoutStateController::From(browser_);
|
||||
+ if (layout_controller) {
|
||||
+ auto current_layout = layout_controller->GetBrowserLayout();
|
||||
+ switch (command_id) {
|
||||
+ case IDC_BROWSER_LAYOUT_HORIZONTAL:
|
||||
+ return current_layout == HeliumLayoutType::kHorizontal;
|
||||
+ case IDC_BROWSER_LAYOUT_CLASSIC:
|
||||
+ return current_layout == HeliumLayoutType::kClassic;
|
||||
+ case IDC_BROWSER_LAYOUT_DYNAMIC:
|
||||
+ return current_layout == HeliumLayoutType::kDynamic;
|
||||
+ case IDC_BROWSER_LAYOUT_COMPACT:
|
||||
+ return current_layout == HeliumLayoutType::kToolbar;
|
||||
+ return current_layout == HeliumLayoutType::kCompact;
|
||||
+ case IDC_BROWSER_LAYOUT_VERTICAL:
|
||||
+ return current_layout == HeliumLayoutType::kVertical;
|
||||
+ }
|
||||
@@ -299,7 +310,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,6 +112,13 @@ bool SystemMenuModelDelegate::IsCommandI
|
||||
@@ -85,6 +114,13 @@ bool SystemMenuModelDelegate::IsCommandI
|
||||
return glic::GlicEnabling::IsEnabledForProfile(browser_->profile());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
if (profile->GetPrefs() &&
|
||||
- profile->GetPrefs()->GetBoolean(prefs::kVerticalTabsEnabled)) {
|
||||
+ profile->GetPrefs()->GetInteger(prefs::kHeliumLayout) ==
|
||||
+ std::to_underlying(HeliumLayoutType::kVertical)) {
|
||||
+ std::to_underlying(HeliumLayoutType::kVertical)) {
|
||||
vertical_tab_profiles++;
|
||||
}
|
||||
}
|
||||
@@ -52,21 +52,17 @@
|
||||
#include "chrome/common/chrome_features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
@@ -31,12 +33,22 @@ bool GetDefaultTabSearchRightAligned() {
|
||||
@@ -31,12 +33,18 @@ bool GetDefaultTabSearchRightAligned() {
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kTabSearchRightAligned,
|
||||
GetDefaultTabSearchRightAligned());
|
||||
- registry->RegisterBooleanPref(prefs::kVerticalTabsEnabled, false);
|
||||
+ registry->RegisterIntegerPref(
|
||||
+ prefs::kHeliumLayout,
|
||||
+ std::to_underlying(HeliumLayoutType::kHorizontal));
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumVerticalRightAligned,
|
||||
+ false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumVerticalCollapsed,
|
||||
+ false);
|
||||
+ registry->RegisterIntegerPref(
|
||||
+ prefs::kHeliumVerticalUncollapsedWidth,
|
||||
+ kVerticalTabStripDefaultUncollapsedWidth);
|
||||
+ registry->RegisterIntegerPref(prefs::kHeliumLayout,
|
||||
+ std::to_underlying(HeliumLayoutType::kClassic));
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumVerticalRightAligned, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumVerticalCollapsed, false);
|
||||
+ registry->RegisterIntegerPref(prefs::kHeliumVerticalUncollapsedWidth,
|
||||
+ kVerticalTabStripDefaultUncollapsedWidth);
|
||||
}
|
||||
|
||||
TabSearchPosition GetTabSearchPosition(const Profile* profile) {
|
||||
@@ -190,7 +186,7 @@
|
||||
#include "ui/actions/actions.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/views/vector_icons.h"
|
||||
@@ -34,58 +29,30 @@ VerticalTabStripStateController::Vertica
|
||||
@@ -34,58 +29,29 @@ VerticalTabStripStateController::Vertica
|
||||
BrowserWindowInterface* browser_window,
|
||||
PrefService* pref_service,
|
||||
actions::ActionItem* root_action_item,
|
||||
@@ -224,8 +220,7 @@
|
||||
- if (restored_state_uncollapsed_width.has_value()) {
|
||||
- SetUncollapsedWidth(restored_state_uncollapsed_width.value());
|
||||
- }
|
||||
+ state_.collapsed =
|
||||
+ pref_service_->GetBoolean(prefs::kHeliumVerticalCollapsed);
|
||||
+ state_.collapsed = pref_service_->GetBoolean(prefs::kHeliumVerticalCollapsed);
|
||||
+ state_.uncollapsed_width =
|
||||
+ pref_service_->GetInteger(prefs::kHeliumVerticalUncollapsedWidth);
|
||||
|
||||
@@ -260,7 +255,7 @@
|
||||
|
||||
// static
|
||||
const VerticalTabStripStateController* VerticalTabStripStateController::From(
|
||||
@@ -102,12 +69,25 @@ VerticalTabStripStateController* Vertica
|
||||
@@ -102,12 +68,24 @@ VerticalTabStripStateController* Vertica
|
||||
}
|
||||
|
||||
bool VerticalTabStripStateController::ShouldDisplayVerticalTabs() const {
|
||||
@@ -272,8 +267,8 @@
|
||||
void VerticalTabStripStateController::SetVerticalTabsEnabled(bool enabled) {
|
||||
NotifyModeWillChange();
|
||||
- pref_service_->SetBoolean(prefs::kVerticalTabsEnabled, enabled);
|
||||
+ HeliumLayoutType layout = enabled ? HeliumLayoutType::kVertical
|
||||
+ : HeliumLayoutType::kHorizontal;
|
||||
+ HeliumLayoutType layout =
|
||||
+ enabled ? HeliumLayoutType::kVertical : HeliumLayoutType::kClassic;
|
||||
+ pref_service_->SetInteger(prefs::kHeliumLayout, std::to_underlying(layout));
|
||||
+}
|
||||
+
|
||||
@@ -283,12 +278,11 @@
|
||||
+
|
||||
+void VerticalTabStripStateController::SetTabStripRightAligned(
|
||||
+ bool right_aligned) {
|
||||
+ pref_service_->SetBoolean(prefs::kHeliumVerticalRightAligned,
|
||||
+ right_aligned);
|
||||
+ pref_service_->SetBoolean(prefs::kHeliumVerticalRightAligned, right_aligned);
|
||||
}
|
||||
|
||||
bool VerticalTabStripStateController::IsCollapsed() const {
|
||||
@@ -160,7 +140,7 @@ VerticalTabStripStateController::Registe
|
||||
@@ -160,7 +138,7 @@ VerticalTabStripStateController::Registe
|
||||
}
|
||||
|
||||
void VerticalTabStripStateController::NotifyCollapseChanged() {
|
||||
@@ -297,7 +291,7 @@
|
||||
UpdateCollapseActionItem();
|
||||
on_collapse_changed_callback_list_.Notify(this);
|
||||
}
|
||||
@@ -170,23 +150,23 @@ void VerticalTabStripStateController::No
|
||||
@@ -170,21 +148,20 @@ void VerticalTabStripStateController::No
|
||||
}
|
||||
|
||||
void VerticalTabStripStateController::NotifyModeChanged() {
|
||||
@@ -314,25 +308,20 @@
|
||||
- base::NumberToString(state_.uncollapsed_width));
|
||||
- }
|
||||
+void VerticalTabStripStateController::UpdatePrefs() {
|
||||
+ pref_service_->SetBoolean(prefs::kHeliumVerticalCollapsed,
|
||||
+ state_.collapsed);
|
||||
+ pref_service_->SetBoolean(prefs::kHeliumVerticalCollapsed, state_.collapsed);
|
||||
+ pref_service_->SetInteger(prefs::kHeliumVerticalUncollapsedWidth,
|
||||
+ state_.uncollapsed_width);
|
||||
}
|
||||
|
||||
void VerticalTabStripStateController::UpdateCollapseActionItem() {
|
||||
- const gfx::VectorIcon& icon = (IsCollapsed() == base::i18n::IsRTL())
|
||||
- ? views::kMenuOpenIcon
|
||||
- : views::kMenuCloseIcon;
|
||||
+ const bool should_flip_icon_direction =
|
||||
+ base::i18n::IsRTL() != IsTabStripRightAligned();
|
||||
+ const gfx::VectorIcon& icon =
|
||||
+ IsCollapsed() == should_flip_icon_direction ? views::kMenuOpenIcon
|
||||
+ : views::kMenuCloseIcon;
|
||||
+ const gfx::VectorIcon& icon = IsCollapsed() == should_flip_icon_direction
|
||||
? views::kMenuOpenIcon
|
||||
: views::kMenuCloseIcon;
|
||||
|
||||
const auto& text =
|
||||
IsCollapsed() ? IDS_EXPAND_VERTICAL_TABS : IDS_COLLAPSE_VERTICAL_TABS;
|
||||
@@ -204,20 +184,4 @@ void VerticalTabStripStateController::Up
|
||||
@@ -204,20 +181,4 @@ void VerticalTabStripStateController::Up
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,8 +344,8 @@
|
||||
} // namespace tabs
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1313,6 +1313,21 @@ inline constexpr char kNewTabNextToActiv
|
||||
// cycling through tabs with Ctrl+Tab.
|
||||
@@ -1314,6 +1314,21 @@ inline constexpr char kNewTabNextToActiv
|
||||
// when cycling through tabs with Ctrl+Tab.
|
||||
inline constexpr char kTabCyclingMRU[] = "helium.browser.mru_tab_cycling";
|
||||
|
||||
+// An enum (HeliumLayoutType) pref that controls the browser layout.
|
||||
@@ -377,7 +366,7 @@
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
// visible on the toolbar.
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
@@ -2002,9 +2017,6 @@ inline constexpr char kGoogleSearchSideP
|
||||
@@ -2003,9 +2018,6 @@ inline constexpr char kGoogleSearchSideP
|
||||
// True when the tab search button is on the right side of the tab strip even in
|
||||
// RTL.
|
||||
inline constexpr char kTabSearchRightAligned[] = "tab_search.is_right_aligned";
|
||||
@@ -400,7 +389,7 @@
|
||||
"incognito_allowed_url.h",
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/helium/helium_layout_state_controller.h
|
||||
@@ -0,0 +1,59 @@
|
||||
@@ -0,0 +1,62 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -417,29 +406,32 @@
|
||||
+class PrefService;
|
||||
+
|
||||
+enum class HeliumLayoutType {
|
||||
+ kHorizontal = 0,
|
||||
+ kToolbar = 1,
|
||||
+ kClassic = 0,
|
||||
+ kCompact = 1,
|
||||
+ kVertical = 2,
|
||||
+ kMaxValue = kVertical,
|
||||
+ kDynamic = 3,
|
||||
+ kMaxValue = kDynamic,
|
||||
+};
|
||||
+
|
||||
+class HeliumLayoutStateController {
|
||||
+ public:
|
||||
+ DECLARE_USER_DATA(HeliumLayoutStateController);
|
||||
+
|
||||
+ explicit HeliumLayoutStateController(
|
||||
+ BrowserWindowInterface* browser_window,
|
||||
+ PrefService* pref_service);
|
||||
+ HeliumLayoutStateController(const HeliumLayoutStateController&) =
|
||||
+ explicit HeliumLayoutStateController(BrowserWindowInterface* browser_window,
|
||||
+ PrefService* pref_service);
|
||||
+ HeliumLayoutStateController(const HeliumLayoutStateController&) = delete;
|
||||
+ HeliumLayoutStateController& operator=(const HeliumLayoutStateController&) =
|
||||
+ delete;
|
||||
+ HeliumLayoutStateController& operator=(
|
||||
+ const HeliumLayoutStateController&) = delete;
|
||||
+ ~HeliumLayoutStateController();
|
||||
+
|
||||
+ static HeliumLayoutStateController* From(
|
||||
+ BrowserWindowInterface* browser_window);
|
||||
+
|
||||
+ bool ShouldDisplayToolbarTabStrip() const;
|
||||
+ bool IsClassicLayout() const;
|
||||
+ bool IsCompactLayout() const;
|
||||
+ bool IsVerticalLayout() const;
|
||||
+ bool IsDynamicLayout() const;
|
||||
+
|
||||
+ void SetBrowserLayout(HeliumLayoutType layout);
|
||||
+ HeliumLayoutType GetBrowserLayout() const;
|
||||
+
|
||||
@@ -462,7 +454,7 @@
|
||||
+#endif // CHROME_BROWSER_UI_HELIUM_HELIUM_LAYOUT_STATE_CONTROLLER_H_
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/helium/helium_layout_state_controller.cc
|
||||
@@ -0,0 +1,70 @@
|
||||
@@ -0,0 +1,80 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -486,9 +478,8 @@
|
||||
+
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kHeliumLayout,
|
||||
+ base::BindRepeating(
|
||||
+ &HeliumLayoutStateController::NotifyStateChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ base::BindRepeating(&HeliumLayoutStateController::NotifyStateChanged,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+HeliumLayoutStateController::~HeliumLayoutStateController() = default;
|
||||
@@ -499,12 +490,23 @@
|
||||
+ return Get(browser_window->GetUnownedUserDataHost());
|
||||
+}
|
||||
+
|
||||
+bool HeliumLayoutStateController::ShouldDisplayToolbarTabStrip() const {
|
||||
+ return GetBrowserLayout() == HeliumLayoutType::kToolbar;
|
||||
+bool HeliumLayoutStateController::IsClassicLayout() const {
|
||||
+ return GetBrowserLayout() == HeliumLayoutType::kClassic;
|
||||
+}
|
||||
+
|
||||
+void HeliumLayoutStateController::SetBrowserLayout(
|
||||
+ HeliumLayoutType layout) {
|
||||
+bool HeliumLayoutStateController::IsCompactLayout() const {
|
||||
+ return GetBrowserLayout() == HeliumLayoutType::kCompact;
|
||||
+}
|
||||
+
|
||||
+bool HeliumLayoutStateController::IsVerticalLayout() const {
|
||||
+ return GetBrowserLayout() == HeliumLayoutType::kVertical;
|
||||
+}
|
||||
+
|
||||
+bool HeliumLayoutStateController::IsDynamicLayout() const {
|
||||
+ return GetBrowserLayout() == HeliumLayoutType::kDynamic;
|
||||
+}
|
||||
+
|
||||
+void HeliumLayoutStateController::SetBrowserLayout(HeliumLayoutType layout) {
|
||||
+ pref_service_->SetInteger(prefs::kHeliumLayout, std::to_underlying(layout));
|
||||
+}
|
||||
+
|
||||
@@ -513,12 +515,12 @@
|
||||
+
|
||||
+ if (!tabs::IsVerticalTabsFeatureEnabled() &&
|
||||
+ layout_value == std::to_underlying(HeliumLayoutType::kVertical)) {
|
||||
+ return HeliumLayoutType::kHorizontal;
|
||||
+ return HeliumLayoutType::kClassic;
|
||||
+ }
|
||||
+
|
||||
+ if (layout_value < std::to_underlying(HeliumLayoutType::kHorizontal) ||
|
||||
+ if (layout_value < std::to_underlying(HeliumLayoutType::kClassic) ||
|
||||
+ layout_value > std::to_underlying(HeliumLayoutType::kMaxValue)) {
|
||||
+ return HeliumLayoutType::kHorizontal;
|
||||
+ return HeliumLayoutType::kClassic;
|
||||
+ }
|
||||
+
|
||||
+ return static_cast<HeliumLayoutType>(layout_value);
|
||||
@@ -543,12 +545,11 @@
|
||||
class HistoryClustersSidePanelCoordinator;
|
||||
class HistorySidePanelCoordinator;
|
||||
class IncognitoClearBrowsingDataDialogCoordinator;
|
||||
@@ -577,6 +578,9 @@ class BrowserWindowFeatures {
|
||||
@@ -577,6 +578,8 @@ class BrowserWindowFeatures {
|
||||
|
||||
std::unique_ptr<tabs::TabDeclutterController> tab_declutter_controller_;
|
||||
|
||||
+ std::unique_ptr<HeliumLayoutStateController>
|
||||
+ helium_layout_state_controller_;
|
||||
+ std::unique_ptr<HeliumLayoutStateController> helium_layout_state_controller_;
|
||||
+
|
||||
std::unique_ptr<tabs::VerticalTabStripStateController>
|
||||
vertical_tab_strip_state_controller_;
|
||||
@@ -563,14 +564,13 @@
|
||||
#include "chrome/browser/ui/lens/lens_overlay_entry_point_controller.h"
|
||||
#include "chrome/browser/ui/omnibox/ai_mode_page_action_controller.h"
|
||||
#include "chrome/browser/ui/performance_controls/memory_saver_bubble_controller.h"
|
||||
@@ -299,6 +300,11 @@ void BrowserWindowFeatures::Init(Browser
|
||||
@@ -299,6 +300,10 @@ void BrowserWindowFeatures::Init(Browser
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_GLIC)
|
||||
|
||||
+ helium_layout_state_controller_ =
|
||||
+ GetUserDataFactory()
|
||||
+ .CreateInstance<HeliumLayoutStateController>(
|
||||
+ *browser, browser, profile->GetPrefs());
|
||||
+ GetUserDataFactory().CreateInstance<HeliumLayoutStateController>(
|
||||
+ *browser, browser, profile->GetPrefs());
|
||||
+
|
||||
if (tabs::IsVerticalTabsFeatureEnabled()) {
|
||||
const std::optional<bool>& restored_state_collapsed =
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
+#include "base/check.h"
|
||||
#include "base/i18n/rtl.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/trace_event/common/trace_event_common.h"
|
||||
@@ -16,6 +17,7 @@
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
||||
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
|
||||
#include "chrome/browser/ui/views/frame/custom_corners_background.h"
|
||||
#include "chrome/browser/ui/views/frame/custom_floating_corner.h"
|
||||
@@ -138,6 +140,9 @@ BrowserViewTabbedLayoutImpl::GetMinimumT
|
||||
const BrowserLayoutParams& params) const {
|
||||
switch (GetTabStripType()) {
|
||||
case TabStripType::kHorizontal: {
|
||||
+ if (!ShowDynamicTabStrip(TabStripType::kHorizontal)) {
|
||||
+ return std::make_pair(gfx::Size(), gfx::Size());
|
||||
+ }
|
||||
auto result = views().horizontal_tab_strip_region_view->GetMinimumSize();
|
||||
result.Enlarge(GetExclusionWidth(params), 0);
|
||||
return std::make_pair(gfx::Size(), result);
|
||||
@@ -181,6 +186,9 @@ BrowserViewTabbedLayoutImpl::CalculateHo
|
||||
// Start with some preliminary values.
|
||||
layout.force_top_container_to_top =
|
||||
tab_strip_type != TabStripType::kHorizontal;
|
||||
+ if (IsDynamicTabStrip(tab_strip_type)) {
|
||||
+ layout.force_top_container_to_top = true;
|
||||
+ }
|
||||
layout.min_content_width = kContentsContainerMinimumWidth;
|
||||
|
||||
// Get information about the vertical tabstrip, if present.
|
||||
@@ -423,6 +431,25 @@ HeliumLayoutType BrowserViewTabbedLayout
|
||||
: HeliumLayoutType::kClassic;
|
||||
}
|
||||
|
||||
+bool BrowserViewTabbedLayoutImpl::IsDynamicTabStrip(
|
||||
+ TabStripType tab_strip_type) const {
|
||||
+ return GetHeliumLayout() == HeliumLayoutType::kDynamic &&
|
||||
+ tab_strip_type == TabStripType::kHorizontal &&
|
||||
+ IsParentedTo(views().top_container, views().browser_view) &&
|
||||
+ IsParentedTo(views().horizontal_tab_strip_region_view,
|
||||
+ views().browser_view);
|
||||
+}
|
||||
+
|
||||
+bool BrowserViewTabbedLayoutImpl::ShowDynamicTabStrip(
|
||||
+ TabStripType tab_strip_type) const {
|
||||
+ if (!IsDynamicTabStrip(tab_strip_type)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return !browser() || !browser()->tab_strip_model() ||
|
||||
+ browser()->tab_strip_model()->count() > 1;
|
||||
+}
|
||||
+
|
||||
bool BrowserViewTabbedLayoutImpl::ShadowOverlayVisible() const {
|
||||
if (!views().toolbar_height_side_panel) {
|
||||
return false;
|
||||
@@ -535,6 +562,9 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
BrowserLayoutParams params = browser_params;
|
||||
bool needs_exclusion = true;
|
||||
const TabStripType tab_strip_type = GetTabStripType();
|
||||
+ const bool dynamic_tab_strip = IsDynamicTabStrip(tab_strip_type);
|
||||
+ const bool show_dynamic_tab_strip = ShowDynamicTabStrip(tab_strip_type);
|
||||
+ std::optional<int> dynamic_tab_strip_top;
|
||||
HorizontalLayout horizontal_layout = CalculateHorizontalLayout(params);
|
||||
|
||||
if (tab_strip_type == TabStripType::kWebUi) {
|
||||
@@ -560,7 +590,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
}
|
||||
|
||||
// Lay out horizontal tab strip region if present.
|
||||
- if (IsParentedTo(views().horizontal_tab_strip_region_view,
|
||||
+ if (!dynamic_tab_strip &&
|
||||
+ IsParentedTo(views().horizontal_tab_strip_region_view,
|
||||
views().browser_view)) {
|
||||
gfx::Rect tabstrip_bounds;
|
||||
if (tab_strip_type == TabStripType::kHorizontal) {
|
||||
@@ -572,8 +603,10 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
tabstrip_bounds = GetBoundsWithExclusion(
|
||||
params, views().horizontal_tab_strip_region_view,
|
||||
TabStyle::Get()->GetBottomCornerRadius());
|
||||
+ const int default_tabstrip_toolbar_overlap =
|
||||
+ GetLayoutConstant(LayoutConstant::kHeliumBasePadding);
|
||||
params.SetTop(tabstrip_bounds.bottom() -
|
||||
- GetLayoutConstant(LayoutConstant::kTabstripToolbarOverlap));
|
||||
+ default_tabstrip_toolbar_overlap);
|
||||
needs_exclusion = false;
|
||||
}
|
||||
layout.AddChild(views().horizontal_tab_strip_region_view, tabstrip_bounds,
|
||||
@@ -684,6 +717,21 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
top_container_layout, top_container_params, needs_exclusion);
|
||||
top_container_layout.bounds =
|
||||
GetTopContainerBoundsInParent(top_container_local_bounds, params);
|
||||
+
|
||||
+ if (dynamic_tab_strip && tab_strip_type == TabStripType::kHorizontal) {
|
||||
+ const int toolbar_tabstrip_overlap =
|
||||
+ GetLayoutConstant(LayoutConstant::kHeliumBasePadding);
|
||||
+ if (const auto* toolbar_layout =
|
||||
+ top_container_layout.GetLayoutFor(views().toolbar);
|
||||
+ toolbar_layout && !toolbar_layout->bounds.IsEmpty()) {
|
||||
+ dynamic_tab_strip_top = top_container_layout.bounds.y() +
|
||||
+ toolbar_layout->bounds.bottom() -
|
||||
+ toolbar_tabstrip_overlap;
|
||||
+ } else {
|
||||
+ dynamic_tab_strip_top = top_container_layout.bounds.y();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
params.SetTop(top_container_layout.bounds.bottom());
|
||||
|
||||
// Possibly bump the leading margin of the top container out to cover the
|
||||
@@ -701,6 +749,22 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
}
|
||||
}
|
||||
|
||||
+ if (dynamic_tab_strip) {
|
||||
+ DCHECK_EQ(tab_strip_type, TabStripType::kHorizontal);
|
||||
+
|
||||
+ const int tabstrip_height =
|
||||
+ views().horizontal_tab_strip_region_view->GetPreferredSize().height();
|
||||
+ const int tabstrip_top =
|
||||
+ show_dynamic_tab_strip
|
||||
+ ? dynamic_tab_strip_top.value_or(params.visual_client_area.y())
|
||||
+ : -tabstrip_height;
|
||||
+ const gfx::Rect tabstrip_bounds(params.visual_client_area.x(), tabstrip_top,
|
||||
+ params.visual_client_area.width(),
|
||||
+ tabstrip_height);
|
||||
+ layout.AddChild(views().horizontal_tab_strip_region_view, tabstrip_bounds,
|
||||
+ show_dynamic_tab_strip);
|
||||
+ }
|
||||
+
|
||||
// Lay out the main area background.
|
||||
if (IsParentedTo(views().main_background_region, views().browser_view)) {
|
||||
layout.AddChild(views().main_background_region, params.visual_client_area,
|
||||
@@ -946,6 +1010,8 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
const int original_top = params.visual_client_area.y();
|
||||
|
||||
const TabStripType tab_strip_type = GetTabStripType();
|
||||
+ const bool dynamic_tab_strip = IsDynamicTabStrip(tab_strip_type);
|
||||
+ const bool show_dynamic_tab_strip = ShowDynamicTabStrip(tab_strip_type);
|
||||
|
||||
// If the WebUI tabstrip is in the top container (which can happen in
|
||||
// immersive mode), ensure it is laid out here.
|
||||
@@ -1007,6 +1073,17 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
layout.AddChild(views().toolbar, toolbar_bounds, toolbar_visible);
|
||||
}
|
||||
|
||||
+ // Clamp the margins visually by overlapping toolbar and the tab strip
|
||||
+ if (dynamic_tab_strip && show_dynamic_tab_strip) {
|
||||
+ const int toolbar_tabstrip_overlap =
|
||||
+ toolbar_visible ? GetLayoutConstant(LayoutConstant::kHeliumBasePadding)
|
||||
+ : 0;
|
||||
+ params.SetTop(
|
||||
+ params.visual_client_area.y() +
|
||||
+ views().horizontal_tab_strip_region_view->GetPreferredSize().height() -
|
||||
+ toolbar_tabstrip_overlap);
|
||||
+ }
|
||||
+
|
||||
// Lay out the bookmarks bar if one is present.
|
||||
const bool bookmarks_visible = delegate().IsBookmarkBarVisible();
|
||||
if (IsParentedTo(views().bookmark_bar, views().top_container)) {
|
||||
@@ -1058,8 +1135,10 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
void BrowserViewTabbedLayoutImpl::ConfigureTopContainerBackground(
|
||||
const BrowserLayoutParams& params,
|
||||
CustomCornersBackground* background) {
|
||||
- // Fall back to default implementation when vertical tabstrip not present.
|
||||
- if (!delegate().ShouldDrawVerticalTabStrip()) {
|
||||
+ // Fall back to default implementation when neither vertical nor dynamic
|
||||
+ // tabstrip is present.
|
||||
+ if (!delegate().ShouldDrawVerticalTabStrip() &&
|
||||
+ !IsDynamicTabStrip(GetTabStripType())) {
|
||||
BrowserViewLayoutImpl::ConfigureTopContainerBackground(params, background);
|
||||
return;
|
||||
}
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
@@ -110,6 +110,8 @@ class BrowserViewTabbedLayoutImpl : publ
|
||||
// Returns the type of tabstrip present.
|
||||
enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal };
|
||||
HeliumLayoutType GetHeliumLayout() const;
|
||||
+ bool IsDynamicTabStrip(TabStripType tab_strip_type) const;
|
||||
+ bool ShowDynamicTabStrip(TabStripType tab_strip_type) const;
|
||||
TabStripType GetTabStripType() const;
|
||||
|
||||
// Returns whether the shadow overlay (with its attendant margin) around the
|
||||
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "build/buildflag.h"
|
||||
#include "chrome/browser/themes/theme_properties.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_native_widget.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
@@ -640,7 +641,22 @@ void OpaqueBrowserFrameView::OnPaint(gfx
|
||||
frame_background_->set_theme_image_inset(
|
||||
GetBrowserView()->GetThemeOffsetFromBrowserView());
|
||||
frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
|
||||
- frame_background_->set_top_area_height(GetTopAreaHeight());
|
||||
+
|
||||
+ int top_area_height = GetTopAreaHeight();
|
||||
+ auto* helium_controller =
|
||||
+ HeliumLayoutStateController::From(GetBrowserView()->browser());
|
||||
+ if (helium_controller && helium_controller->IsDynamicLayout()) {
|
||||
+ const auto info = GetClientFrameElementInfo();
|
||||
+ if (info.tabstrip_preferred_height > 0) {
|
||||
+ const int toolbar_height =
|
||||
+ GetBrowserView()->toolbar()->GetMinimumSize().height();
|
||||
+ const int overlap = GetLayoutConstant(LayoutConstant::kHeliumBasePadding);
|
||||
+ top_area_height =
|
||||
+ std::max(top_area_height,
|
||||
+ toolbar_height + info.tabstrip_preferred_height - overlap);
|
||||
+ }
|
||||
+ }
|
||||
+ frame_background_->set_top_area_height(top_area_height);
|
||||
|
||||
if (GetFrameButtonStyle() == FrameButtonStyle::kMdButton) {
|
||||
for (views::Button* button :
|
||||
@@ -0,0 +1,53 @@
|
||||
--- a/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
#include "chrome/browser/ui/frame/window_frame_util.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/tab_search_feature.h"
|
||||
#include "chrome/browser/ui/tabs/features.h"
|
||||
@@ -79,18 +80,28 @@ class FrameGrabHandle : public views::Vi
|
||||
METADATA_HEADER(FrameGrabHandle, views::View)
|
||||
|
||||
public:
|
||||
- FrameGrabHandle() {
|
||||
+ explicit FrameGrabHandle(TabStrip* tab_strip)
|
||||
+ : tab_strip_(tab_strip->AsWeakPtr()) {
|
||||
SetProperty(views::kElementIdentifierKey,
|
||||
kTabStripFrameGrabHandleElementId);
|
||||
}
|
||||
|
||||
gfx::Size CalculatePreferredSize(
|
||||
const views::SizeBounds& available_size) const override {
|
||||
- // Reserve some space for the frame to be grabbed by, even if the tabstrip
|
||||
- // is full.
|
||||
- // TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
- return gfx::Size(42, 0);
|
||||
+ // Show the grab handle only in Classic layout
|
||||
+ if (tab_strip_ && tab_strip_->GetBrowserWindowInterface()) {
|
||||
+ auto* controller = HeliumLayoutStateController::From(
|
||||
+ tab_strip_->GetBrowserWindowInterface());
|
||||
+ if (controller && controller->IsClassicLayout()) {
|
||||
+ return gfx::Size(27, 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return gfx::Size(0, 0);
|
||||
}
|
||||
+
|
||||
+ private:
|
||||
+ base::WeakPtr<TabStrip> tab_strip_;
|
||||
};
|
||||
|
||||
BEGIN_METADATA(FrameGrabHandle)
|
||||
@@ -294,7 +305,7 @@ HorizontalTabStripRegionView::Horizontal
|
||||
}
|
||||
|
||||
reserved_grab_handle_space_ =
|
||||
- AddChildView(std::make_unique<FrameGrabHandle>());
|
||||
+ AddChildView(std::make_unique<FrameGrabHandle>(tab_strip_));
|
||||
reserved_grab_handle_space_->SetProperty(
|
||||
views::kFlexBehaviorKey,
|
||||
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
|
||||
@@ -0,0 +1,165 @@
|
||||
--- a/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
@@ -107,16 +107,32 @@ class FrameGrabHandle : public views::Vi
|
||||
BEGIN_METADATA(FrameGrabHandle)
|
||||
END_METADATA
|
||||
|
||||
-bool ShouldShowNewTabButton(BrowserWindowInterface* browser) {
|
||||
+bool CanCreateNewTabButton(BrowserWindowInterface* browser) {
|
||||
// `browser` can be null in tests and `app_controller` will be null if
|
||||
// the browser is not for an app.
|
||||
- if (browser) {
|
||||
- auto* const controller = web_app::AppBrowserController::From(browser);
|
||||
- if (controller && controller->ShouldHideNewTabButton()) {
|
||||
- return false;
|
||||
- }
|
||||
+ if (!browser) {
|
||||
+ return true;
|
||||
}
|
||||
- return true;
|
||||
+
|
||||
+ auto* const app_controller = web_app::AppBrowserController::From(browser);
|
||||
+ return !app_controller || !app_controller->ShouldHideNewTabButton();
|
||||
+}
|
||||
+
|
||||
+bool ShouldShowNewTabButton(BrowserWindowInterface* browser) {
|
||||
+ if (!CanCreateNewTabButton(browser)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (!browser) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ auto* const layout_controller = HeliumLayoutStateController::From(browser);
|
||||
+ return !layout_controller || layout_controller->IsClassicLayout();
|
||||
+}
|
||||
+
|
||||
+views::View* GetVisibleView(views::View* view) {
|
||||
+ return view && view->GetVisible() ? view : nullptr;
|
||||
}
|
||||
|
||||
// Updates the border of `view` if the insets need to be updated.
|
||||
@@ -286,7 +302,7 @@ HorizontalTabStripRegionView::Horizontal
|
||||
views::MaximumFlexSizeRule::kPreferred);
|
||||
tab_strip_->SetProperty(views::kFlexBehaviorKey, tab_strip_flex_spec);
|
||||
|
||||
- if (ShouldShowNewTabButton(browser)) {
|
||||
+ if (CanCreateNewTabButton(browser)) {
|
||||
std::unique_ptr<TabStripControlButton> tab_strip_control_button =
|
||||
std::make_unique<NewTabButton>(
|
||||
base::BindRepeating(&TabStrip::NewTabButtonPressed,
|
||||
@@ -302,6 +318,7 @@ HorizontalTabStripRegionView::Horizontal
|
||||
new_tab_button_->SetTriggerableEventFlags(
|
||||
new_tab_button_->GetTriggerableEventFlags() |
|
||||
ui::EF_MIDDLE_MOUSE_BUTTON);
|
||||
+ new_tab_button_->SetVisible(ShouldShowNewTabButton(browser));
|
||||
}
|
||||
|
||||
reserved_grab_handle_space_ =
|
||||
@@ -420,6 +437,15 @@ void HorizontalTabStripRegionView::Layou
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (new_tab_button_) {
|
||||
+ const bool should_show_new_tab_button =
|
||||
+ ShouldShowNewTabButton(tab_strip_->GetBrowserWindowInterface());
|
||||
+ if (new_tab_button_->GetVisible() != should_show_new_tab_button) {
|
||||
+ new_tab_button_->SetVisible(should_show_new_tab_button);
|
||||
+ UpdateTabStripMargin();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
const bool tab_search_container_before_tab_strip =
|
||||
tab_search_container_ && render_tab_search_before_tab_strip_;
|
||||
if (tab_search_container_before_tab_strip) {
|
||||
@@ -432,7 +458,7 @@ void HorizontalTabStripRegionView::Layou
|
||||
AdjustViewBoundsRect(tab_search_container_, 0);
|
||||
}
|
||||
|
||||
- views::View* button_to_paint_to_layer = new_tab_button_;
|
||||
+ views::View* button_to_paint_to_layer = GetVisibleView(new_tab_button_);
|
||||
|
||||
if (button_to_paint_to_layer) {
|
||||
// The button needs to be layered on top of the tabstrip to achieve
|
||||
@@ -691,7 +717,7 @@ void HorizontalTabStripRegionView::Updat
|
||||
// The new tab button overlaps the tabstrip. Render it to a layer and adjust
|
||||
// the tabstrip right margin to reserve space for it.
|
||||
std::optional<int> tab_strip_right_margin;
|
||||
- views::View* button_to_paint_to_layer = new_tab_button_;
|
||||
+ views::View* button_to_paint_to_layer = GetVisibleView(new_tab_button_);
|
||||
|
||||
if (button_to_paint_to_layer) {
|
||||
button_to_paint_to_layer->SetPaintToLayer();
|
||||
@@ -731,12 +757,10 @@ void HorizontalTabStripRegionView::Updat
|
||||
|
||||
UpdateButtonBorders();
|
||||
|
||||
- if (tab_strip_left_margin.has_value() || tab_strip_right_margin.has_value()) {
|
||||
- tab_strip_->SetProperty(
|
||||
- views::kMarginsKey,
|
||||
- gfx::Insets::TLBR(0, tab_strip_left_margin.value_or(0), 0,
|
||||
- tab_strip_right_margin.value_or(0)));
|
||||
- }
|
||||
+ tab_strip_->SetProperty(
|
||||
+ views::kMarginsKey,
|
||||
+ gfx::Insets::TLBR(0, tab_strip_left_margin.value_or(0), 0,
|
||||
+ tab_strip_right_margin.value_or(0)));
|
||||
}
|
||||
|
||||
void HorizontalTabStripRegionView::AdjustViewBoundsRect(View* view,
|
||||
--- a/chrome/browser/ui/views/tabs/tab_style_views.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "chrome/browser/themes/theme_properties.h"
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/tabs/tab_style.h"
|
||||
#include "chrome/browser/ui/tabs/tab_types.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "chrome/browser/ui/views/tabs/tab_group_underline.h"
|
||||
#include "chrome/browser/ui/views/tabs/tab_slot_controller.h"
|
||||
#include "chrome/browser/ui/views/tabs/tab_slot_view.h"
|
||||
+#include "chrome/browser/ui/web_applications/app_browser_controller.h"
|
||||
#include "chrome/grit/theme_resources.h"
|
||||
#include "components/tab_groups/tab_group_visual_data.h"
|
||||
#include "third_party/skia/include/core/SkPath.h"
|
||||
@@ -51,6 +53,25 @@
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
namespace {
|
||||
+
|
||||
+bool ShouldShowTrailingSeparatorAfterLastTab(
|
||||
+ BrowserWindowInterface* browser_window_interface) {
|
||||
+ // Match HorizontalTabStripRegionView::ShouldShowNewTabButton().
|
||||
+ if (!browser_window_interface) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ auto* const app_controller =
|
||||
+ web_app::AppBrowserController::From(browser_window_interface);
|
||||
+ if (app_controller && app_controller->ShouldHideNewTabButton()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ auto* const layout_controller =
|
||||
+ HeliumLayoutStateController::From(browser_window_interface);
|
||||
+ return !layout_controller || layout_controller->IsClassicLayout();
|
||||
+}
|
||||
+
|
||||
class TabStyleViewsImpl : public TabStyleViews {
|
||||
public:
|
||||
explicit TabStyleViewsImpl(Tab* tab);
|
||||
@@ -726,6 +747,10 @@ float TabStyleViewsImpl::GetSeparatorOpa
|
||||
// combo button with a non-transparent background in place of the new tab
|
||||
// button, we should not show the trailing separator.
|
||||
if (!adjacent_tab) {
|
||||
+ if (!leading && !ShouldShowTrailingSeparatorAfterLastTab(
|
||||
+ tab()->controller()->GetBrowserWindowInterface())) {
|
||||
+ return 0.0f;
|
||||
+ }
|
||||
return leading ? 0.0f : shown_separator_opacity;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1334,6 +1334,10 @@ inline constexpr char kHeliumVerticalUnc
|
||||
inline constexpr char kHeliumCenteredLocationBar[] =
|
||||
"helium.browser.centered_location_bar";
|
||||
|
||||
+// A boolean pref set to true if the minimal location bar should be used.
|
||||
+inline constexpr char kHeliumMinimalLocationBar[] =
|
||||
+ "helium.browser.minimal_location_bar";
|
||||
+
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
// visible on the toolbar.
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -119,6 +119,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kHeliumCenteredLocationBar, false);
|
||||
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumMinimalLocationBar, false);
|
||||
+
|
||||
registry->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true,
|
||||
pref_registration_flags);
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
|
||||
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "chrome/browser/ui/lens/lens_searchbox_controller.h"
|
||||
#include "chrome/browser/ui/location_bar/location_bar.h"
|
||||
#include "chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h"
|
||||
+#include "chrome/browser/ui/omnibox/omnibox_controller.h"
|
||||
#include "chrome/browser/ui/omnibox/omnibox_next_features.h"
|
||||
#include "chrome/browser/ui/omnibox/omnibox_tab_helper.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
@@ -167,6 +168,14 @@ ChromeOmniboxClient::~ChromeOmniboxClien
|
||||
}
|
||||
}
|
||||
|
||||
+bool ChromeOmniboxClient::ShouldUseMinimalLocationBar() const {
|
||||
+ OmniboxController* omnibox_controller = location_bar_->GetOmniboxController();
|
||||
+ OmniboxEditModel* edit_model =
|
||||
+ omnibox_controller ? omnibox_controller->edit_model() : nullptr;
|
||||
+ return edit_model && edit_model->focus_state() == OMNIBOX_FOCUS_NONE &&
|
||||
+ GetPrefs()->GetBoolean(prefs::kHeliumMinimalLocationBar);
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<AutocompleteProviderClient>
|
||||
ChromeOmniboxClient::CreateAutocompleteProviderClient() {
|
||||
// base::Unretained(location_bar_) is safe because `location_bar_` outlives
|
||||
@@ -329,6 +338,15 @@ std::u16string ChromeOmniboxClient::GetF
|
||||
}
|
||||
|
||||
std::u16string ChromeOmniboxClient::GetURLForDisplay() const {
|
||||
+ OmniboxController* omnibox_controller = location_bar_->GetOmniboxController();
|
||||
+ OmniboxEditModel* edit_model =
|
||||
+ omnibox_controller ? omnibox_controller->edit_model() : nullptr;
|
||||
+ bool in_progress = edit_model && edit_model->user_input_in_progress();
|
||||
+
|
||||
+ if (ShouldUseMinimalLocationBar() && !in_progress) {
|
||||
+ return location_bar_->GetLocationBarModel()->GetURLForDisplay(
|
||||
+ /*trim_after_host_name=*/true);
|
||||
+ }
|
||||
return location_bar_->GetLocationBarModel()->GetURLForDisplay();
|
||||
}
|
||||
|
||||
@@ -405,6 +423,9 @@ void ChromeOmniboxClient::OnFocusChanged
|
||||
if (!location_bar_->GetWebContents()) {
|
||||
return;
|
||||
}
|
||||
+ if (GetPrefs()->GetBoolean(prefs::kHeliumMinimalLocationBar)) {
|
||||
+ location_bar_->UpdateWithoutTabRestore();
|
||||
+ }
|
||||
if (auto* helper =
|
||||
OmniboxTabHelper::FromWebContents(location_bar_->GetWebContents())) {
|
||||
helper->OnFocusChanged(state, reason);
|
||||
@@ -856,7 +877,9 @@ void ChromeOmniboxClient::OnAutocomplete
|
||||
}
|
||||
|
||||
void ChromeOmniboxClient::OnInputInProgress(bool in_progress) {
|
||||
- location_bar_->UpdateWithoutTabRestore();
|
||||
+ if (!ShouldUseMinimalLocationBar() || !in_progress) {
|
||||
+ location_bar_->UpdateWithoutTabRestore();
|
||||
+ }
|
||||
content::WebContents* const web_contents = location_bar_->GetWebContents();
|
||||
if (web_contents) {
|
||||
auto* const helper =
|
||||
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.h
|
||||
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.h
|
||||
@@ -144,6 +144,8 @@ class ChromeOmniboxClient final : public
|
||||
const AutocompleteMatch& match);
|
||||
|
||||
private:
|
||||
+ bool ShouldUseMinimalLocationBar() const;
|
||||
+
|
||||
// Performs prerendering for |match|.
|
||||
void DoPrerender(const AutocompleteMatch& match);
|
||||
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
|
||||
#include "chrome/browser/ui/views/page_action/page_action_view.h"
|
||||
#include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_controller.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "chrome/grit/branded_strings.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
@@ -276,6 +277,9 @@ OmniboxViewViews::OmniboxViewViews(bool
|
||||
pref_change_registrar_.Init(
|
||||
location_bar_view_->browser()->profile()->GetPrefs());
|
||||
pref_change_registrar_.Add(
|
||||
+ prefs::kHeliumMinimalLocationBar,
|
||||
+ base::BindRepeating(&OmniboxViewViews::Update, base::Unretained(this)));
|
||||
+ pref_change_registrar_.Add(
|
||||
omnibox::kPreventUrlElisionsInOmnibox,
|
||||
base::BindRepeating(&OmniboxViewViews::Update, base::Unretained(this)));
|
||||
}
|
||||
@@ -341,6 +345,7 @@ void OmniboxViewViews::Init() {
|
||||
ash::input_method::InputMethodManager::Get()->AddCandidateWindowObserver(
|
||||
this);
|
||||
#endif
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
UpdateAccessibleTextSelection();
|
||||
}
|
||||
|
||||
@@ -375,6 +380,7 @@ void OmniboxViewViews::OnTabChanged(cons
|
||||
web_contents->GetUserData(OmniboxTabHelper::kOmniboxStateKey));
|
||||
controller()->edit_model()->RestoreState(state ? &state->model_state
|
||||
: nullptr);
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
if (state) {
|
||||
// This assumes that the omnibox has already been focused or blurred as
|
||||
// appropriate; otherwise, a subsequent OnFocus() or OnBlur() call could
|
||||
@@ -478,6 +484,8 @@ void OmniboxViewViews::Update() {
|
||||
// security state may be different from before the Update.
|
||||
EmphasizeURLComponents();
|
||||
}
|
||||
+
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
}
|
||||
|
||||
std::u16string OmniboxViewViews::GetText() const {
|
||||
@@ -890,6 +898,20 @@ void OmniboxViewViews::UpdateAccessibleT
|
||||
friendly_suggestion_text_prefix_length_);
|
||||
}
|
||||
|
||||
+void OmniboxViewViews::UpdateSteadyStateTextAlignment() {
|
||||
+ bool center_text = false;
|
||||
+ if (controller()->edit_model()->focus_state() == OMNIBOX_FOCUS_NONE &&
|
||||
+ !controller()->edit_model()->user_input_in_progress() &&
|
||||
+ location_bar_view_ && location_bar_view_->profile()) {
|
||||
+ center_text = location_bar_view_->profile()->GetPrefs()->GetBoolean(
|
||||
+ prefs::kHeliumMinimalLocationBar);
|
||||
+ }
|
||||
+
|
||||
+ SetHorizontalAlignment(center_text ? gfx::ALIGN_CENTER : gfx::ALIGN_LEFT);
|
||||
+ set_placeholder_text_draw_flags(center_text ? gfx::Canvas::TEXT_ALIGN_CENTER
|
||||
+ : gfx::Canvas::TEXT_ALIGN_LEFT);
|
||||
+}
|
||||
+
|
||||
void OmniboxViewViews::OnOmniboxPaste() {
|
||||
const std::u16string text(GetClipboardText(/*notify_if_restricted=*/true));
|
||||
|
||||
@@ -1026,6 +1048,7 @@ void OmniboxViewViews::ApplyCaretVisibil
|
||||
location_bar_view_->OnOmniboxFocused();
|
||||
}
|
||||
}
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
InstallPlaceholderText();
|
||||
}
|
||||
|
||||
@@ -1670,6 +1693,7 @@ void OmniboxViewViews::OnFocus() {
|
||||
|
||||
// TODO(oshima): Get control key state.
|
||||
controller()->edit_model()->OnSetFocus(false);
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
// Don't call WebLocationBar::OnSetFocus(), this view has already acquired
|
||||
// focus.
|
||||
|
||||
@@ -1742,6 +1766,7 @@ void OmniboxViewViews::OnBlur() {
|
||||
|
||||
// Tell the model to reset itself.
|
||||
controller()->edit_model()->OnKillFocus();
|
||||
+ UpdateSteadyStateTextAlignment();
|
||||
|
||||
// Deselect the text. Ensures the cursor is an I-beam.
|
||||
SetSelectedRange(gfx::Range(GetCursorPosition()));
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
|
||||
@@ -211,6 +211,7 @@ class OmniboxViewViews
|
||||
// Returns the selected text.
|
||||
std::u16string_view GetSelectedText() const;
|
||||
void UpdateAccessibleTextSelection() override;
|
||||
+ void UpdateSteadyStateTextAlignment();
|
||||
|
||||
// Paste text from the clipboard into the omnibox.
|
||||
// Textfields implementation of Paste() pastes the contents of the clipboard
|
||||
--- a/components/omnibox/browser/location_bar_model.h
|
||||
+++ b/components/omnibox/browser/location_bar_model.h
|
||||
@@ -38,6 +38,10 @@ class LocationBarModel {
|
||||
// The returned string is not suitable for editing, and is for display only.
|
||||
virtual std::u16string GetURLForDisplay() const = 0;
|
||||
|
||||
+ // Returns a simplified URL for display, optionally trimming everything after
|
||||
+ // the hostname.
|
||||
+ virtual std::u16string GetURLForDisplay(bool trim_after_host_name) const = 0;
|
||||
+
|
||||
// Returns the URL of the current navigation entry.
|
||||
virtual GURL GetURL() const = 0;
|
||||
|
||||
--- a/components/omnibox/browser/location_bar_model_impl.cc
|
||||
+++ b/components/omnibox/browser/location_bar_model_impl.cc
|
||||
@@ -53,6 +53,11 @@ std::u16string LocationBarModelImpl::Get
|
||||
}
|
||||
|
||||
std::u16string LocationBarModelImpl::GetURLForDisplay() const {
|
||||
+ return GetURLForDisplay(delegate_->ShouldTrimDisplayUrlAfterHostName());
|
||||
+}
|
||||
+
|
||||
+std::u16string LocationBarModelImpl::GetURLForDisplay(
|
||||
+ bool trim_after_host_name) const {
|
||||
// For the contextual tasks page, apply "origin-swapping" logic in order to
|
||||
// display the proper URL in the Omnibox.
|
||||
const auto inner_frame_url = delegate_->GetContextualTasksInnerFrameURL();
|
||||
@@ -77,7 +82,7 @@ std::u16string LocationBarModelImpl::Get
|
||||
|
||||
url_formatter::FormatUrlTypes format_types =
|
||||
url_formatter::kFormatUrlOmitDefaults;
|
||||
- if (delegate_->ShouldTrimDisplayUrlAfterHostName()) {
|
||||
+ if (delegate_->ShouldTrimDisplayUrlAfterHostName() || trim_after_host_name) {
|
||||
format_types |= url_formatter::kFormatUrlTrimAfterHost;
|
||||
}
|
||||
|
||||
--- a/components/omnibox/browser/location_bar_model_impl.h
|
||||
+++ b/components/omnibox/browser/location_bar_model_impl.h
|
||||
@@ -35,6 +35,7 @@ class LocationBarModelImpl : public Loca
|
||||
// LocationBarModel:
|
||||
std::u16string GetFormattedFullURL() const override;
|
||||
std::u16string GetURLForDisplay() const override;
|
||||
+ std::u16string GetURLForDisplay(bool trim_after_host_name) const override;
|
||||
GURL GetURL() const override;
|
||||
bool IsContextualTasksPage() const override;
|
||||
GURL GetContextualTasksInnerFrameURL() const override;
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -307,6 +307,9 @@
|
||||
<message name="IDS_SETTINGS_CENTERED_LOCATION_BAR" desc="Label for the toggle to use a centered address bar.">
|
||||
Center the address bar
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_MINIMAL_LOCATION_BAR" desc="Label for the toggle that enables the minimal address bar.">
|
||||
+ Minimal address bar
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
|
||||
Show home button
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -514,6 +514,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
|
||||
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
|
||||
+ {"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"tabStripPosition", IDS_SETTINGS_TAB_STRIP_POSITION},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -204,6 +204,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumCenteredLocationBar] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumMinimalLocationBar] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
// Miscellaneous
|
||||
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
@@ -120,6 +120,10 @@
|
||||
pref="{{prefs.helium.browser.centered_location_bar}}"
|
||||
label="$i18n{centeredLocationBar}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button
|
||||
+ pref="{{prefs.helium.browser.minimal_location_bar}}"
|
||||
+ label="$i18n{minimalLocationBar}">
|
||||
+ </settings-toggle-button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -1,19 +1,18 @@
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -198,6 +198,12 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -198,6 +198,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
}
|
||||
s_allowlist = new PrefsUtil::TypedPrefMap();
|
||||
|
||||
+ // Helium layout
|
||||
+ (*s_allowlist)[::prefs::kHeliumLayout] =
|
||||
+ settings_api::PrefType::kNumber;
|
||||
+ (*s_allowlist)[::prefs::kHeliumLayout] = settings_api::PrefType::kNumber;
|
||||
+ (*s_allowlist)[::prefs::kHeliumVerticalRightAligned] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
+
|
||||
// Miscellaneous
|
||||
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -235,8 +241,6 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -235,8 +240,6 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kSidePanelHorizontalAlignment] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -24,16 +23,19 @@
|
||||
(*s_allowlist)[tab_groups::prefs::kAutoPinNewTabGroups] =
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -276,6 +276,21 @@
|
||||
@@ -276,6 +276,24 @@
|
||||
<message name="IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER" desc="Label for the checkbox which enables or disables cycling through tabs in MRU order when using Ctrl+Tab.">
|
||||
Cycle through tabs in most recently used order with Ctrl+Tab
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_LAYOUT" desc="Label for the browser layout dropdown that controls how the browser UI is displayed.">
|
||||
+ Browser layout
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_LAYOUT_HORIZONTAL" desc="Horizontal option in the browser layout dropdown.">
|
||||
+ <message name="IDS_SETTINGS_BROWSER_LAYOUT_CLASSIC" desc="Classic option in the browser layout dropdown.">
|
||||
+ Classic
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_LAYOUT_DYNAMIC" desc="Dynamic option in the browser layout dropdown.">
|
||||
+ Dynamic
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_BROWSER_LAYOUT_COMPACT" desc="Compact option in the browser layout dropdown.">
|
||||
+ Compact
|
||||
+ </message>
|
||||
@@ -48,12 +50,13 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -506,6 +506,11 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -506,6 +506,12 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"systemMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_SYSTEM_LABEL},
|
||||
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
|
||||
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
|
||||
+ {"browserLayout", IDS_SETTINGS_BROWSER_LAYOUT},
|
||||
+ {"browserLayoutHorizontal", IDS_SETTINGS_BROWSER_LAYOUT_HORIZONTAL},
|
||||
+ {"browserLayoutClassic", IDS_SETTINGS_BROWSER_LAYOUT_CLASSIC},
|
||||
+ {"browserLayoutDynamic", IDS_SETTINGS_BROWSER_LAYOUT_DYNAMIC},
|
||||
+ {"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
+ {"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
+ {"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
@@ -62,22 +65,23 @@
|
||||
{"tabStripPosition", IDS_SETTINGS_TAB_STRIP_POSITION},
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
@@ -82,6 +82,14 @@ export enum SystemTheme {
|
||||
@@ -82,6 +82,15 @@ export enum SystemTheme {
|
||||
// </if>
|
||||
}
|
||||
|
||||
+// This must be kept in sync with the HeliumLayoutType enum in
|
||||
+// chrome/browser/ui/helium/helium_layout_state_controller.h.
|
||||
+enum BrowserLayout {
|
||||
+ HORIZONTAL = 0,
|
||||
+ CLASSIC = 0,
|
||||
+ COMPACT = 1,
|
||||
+ VERTICAL = 2,
|
||||
+ DYNAMIC = 3,
|
||||
+}
|
||||
+
|
||||
const SettingsAppearancePageElementBase =
|
||||
SettingsViewMixin(RelaunchMixin(I18nMixin(PrefsMixin(PolymerElement))));
|
||||
|
||||
@@ -209,18 +217,22 @@ export class SettingsAppearancePageEleme
|
||||
@@ -209,18 +218,26 @@ export class SettingsAppearancePageEleme
|
||||
},
|
||||
},
|
||||
|
||||
@@ -90,12 +94,16 @@
|
||||
{
|
||||
- value: 'true',
|
||||
- name: loadTimeData.getString('uiFeatureAlignSide'),
|
||||
+ value: BrowserLayout.HORIZONTAL,
|
||||
+ name: loadTimeData.getString('browserLayoutHorizontal'),
|
||||
+ value: BrowserLayout.CLASSIC,
|
||||
+ name: loadTimeData.getString('browserLayoutClassic'),
|
||||
},
|
||||
{
|
||||
- value: 'false',
|
||||
- name: loadTimeData.getString('uiFeatureAlignTop'),
|
||||
+ value: BrowserLayout.DYNAMIC,
|
||||
+ name: loadTimeData.getString('browserLayoutDynamic'),
|
||||
+ },
|
||||
+ {
|
||||
+ value: BrowserLayout.COMPACT,
|
||||
+ name: loadTimeData.getString('browserLayoutCompact'),
|
||||
+ },
|
||||
@@ -105,7 +113,7 @@
|
||||
},
|
||||
];
|
||||
},
|
||||
@@ -301,7 +313,7 @@ export class SettingsAppearancePageEleme
|
||||
@@ -301,7 +318,7 @@ export class SettingsAppearancePageEleme
|
||||
declare private showTabSearchPositionRestartButton_: boolean;
|
||||
declare private showManagedThemeDialog_: boolean;
|
||||
declare private sidePanelOptions_: DropdownMenuOptionList;
|
||||
@@ -114,7 +122,7 @@
|
||||
declare private tabSearchOptions_: DropdownMenuOptionList;
|
||||
private appearanceBrowserProxy_: AppearanceBrowserProxy =
|
||||
AppearanceBrowserProxyImpl.getInstance();
|
||||
@@ -458,6 +470,10 @@ export class SettingsAppearancePageEleme
|
||||
@@ -458,6 +475,10 @@ export class SettingsAppearancePageEleme
|
||||
}
|
||||
// </if>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1558,6 +1558,11 @@ inline constexpr char kPrefersDefaultScr
|
||||
@@ -1559,6 +1559,11 @@ inline constexpr char kPrefersDefaultScr
|
||||
inline constexpr char kCopyPageUrlShortcut[] =
|
||||
"helium.settings.a11y.copy_page_url_shortcut";
|
||||
|
||||
@@ -24,14 +24,15 @@
|
||||
// them even though they're only typically controlled via policy.
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -100,6 +100,7 @@
|
||||
#define IDC_BROWSER_LAYOUT_COMPACT 34083
|
||||
#define IDC_BROWSER_LAYOUT_VERTICAL 34084
|
||||
@@ -102,6 +102,8 @@
|
||||
#define IDC_BROWSER_LAYOUT_VERTICAL_RIGHT 34085
|
||||
+#define IDC_CTRL_S_SHORTCUT 34086
|
||||
#define IDC_BROWSER_LAYOUT_DYNAMIC 34086
|
||||
|
||||
+#define IDC_CTRL_S_SHORTCUT 34090
|
||||
+
|
||||
// Tab group Commands
|
||||
#define IDC_ADD_NEW_TAB_TO_GROUP 34100
|
||||
#define IDC_CREATE_NEW_TAB_GROUP 34101
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -54,6 +54,7 @@
|
||||
@@ -75,7 +76,7 @@
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
profile_pref_registrar_.Add(
|
||||
prefs::kPrintingEnabled,
|
||||
@@ -1258,6 +1271,20 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -1261,6 +1274,20 @@ bool BrowserCommandController::ExecuteCo
|
||||
copy ? IDC_COPY_URL : IDC_DEV_TOOLS_INSPECT,
|
||||
disposition, time_stamp);
|
||||
}
|
||||
@@ -96,14 +97,15 @@
|
||||
// Hosted App commands
|
||||
case IDC_COPY_URL:
|
||||
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
|
||||
@@ -2296,7 +2323,10 @@ void BrowserCommandController::UpdateSav
|
||||
@@ -2300,7 +2327,11 @@ void BrowserCommandController::UpdateSav
|
||||
return;
|
||||
}
|
||||
|
||||
- command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_));
|
||||
+ const bool can_save_page = CanSavePage(browser_);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, can_save_page);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_CTRL_S_SHORTCUT,
|
||||
+ command_updater_.UpdateCommandEnabled(
|
||||
+ IDC_CTRL_S_SHORTCUT,
|
||||
+ can_save_page || ShouldToggleVerticalCollapse(profile()->GetPrefs()));
|
||||
}
|
||||
|
||||
@@ -183,7 +185,7 @@
|
||||
<message name="IDS_SETTINGS_APPEARANCE" desc="Name of the settings page which displays appearance preferences.">
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -511,6 +511,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -512,6 +512,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
@@ -193,7 +195,7 @@
|
||||
{"tabStripPosition", IDS_SETTINGS_TAB_STRIP_POSITION},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -640,6 +640,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -639,6 +639,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kCopyPageUrlShortcut] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
|
||||
@@ -0,0 +1,601 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1397,6 +1397,16 @@ inline constexpr char kShowMenuButton[]
|
||||
// the toolbar.
|
||||
inline constexpr char kShowMediaButton[] = "helium.browser.show_media_button";
|
||||
|
||||
+// A boolean pref set to true if the Vertical Tabs collapse button should be
|
||||
+// visible on the toolbar when the vertical Helium layout is active.
|
||||
+inline constexpr char kShowVerticalTabsCollapseButton[] =
|
||||
+ "helium.browser.show_vertical_tabs_collapse_button";
|
||||
+
|
||||
+// A boolean pref set to true if the New Tab button should be visible on the
|
||||
+// toolbar when the dynamic Helium layout is active.
|
||||
+inline constexpr char kShowDynamicNewTabButton[] =
|
||||
+ "helium.browser.show_dynamic_new_tab_button";
|
||||
+
|
||||
// A boolean pref set to true if Gemini integration be enabled. This is managed
|
||||
// by enterprise policy.
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -141,6 +141,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kShowExtensionsButton, true);
|
||||
registry->RegisterBooleanPref(prefs::kShowMenuButton, true);
|
||||
registry->RegisterBooleanPref(prefs::kShowMediaButton, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kShowVerticalTabsCollapseButton, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kShowDynamicNewTabButton, true);
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
|
||||
--- a/chrome/browser/ui/browser_element_identifiers.cc
|
||||
+++ b/chrome/browser/ui/browser_element_identifiers.cc
|
||||
@@ -178,6 +178,7 @@ DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbar
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarChromeLabsButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarDownloadBubbleElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarDownloadButtonElementId);
|
||||
+DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarDynamicNewTabButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarExtensionsContainerElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarForwardButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarForwardButtonMenuElementId);
|
||||
@@ -191,6 +192,7 @@ DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbar
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarSidePanelButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarSidePanelContainerElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarTabCounterButtonElementId);
|
||||
+DEFINE_ELEMENT_IDENTIFIER_VALUE(kToolbarVerticalTabsCollapseButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kTopContainerElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kUnfocusTabGroupButtonElementId);
|
||||
DEFINE_ELEMENT_IDENTIFIER_VALUE(kUserNotesSidePanelWebViewElementId);
|
||||
--- a/chrome/browser/ui/browser_element_identifiers.h
|
||||
+++ b/chrome/browser/ui/browser_element_identifiers.h
|
||||
@@ -221,6 +221,7 @@ DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolba
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarChromeLabsButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarDownloadBubbleElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarDownloadButtonElementId);
|
||||
+DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarDynamicNewTabButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarExtensionsContainerElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarForwardButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarForwardButtonMenuElementId);
|
||||
@@ -235,6 +236,7 @@ DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolba
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarSidePanelButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarSidePanelContainerElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarTabCounterButtonElementId);
|
||||
+DECLARE_ELEMENT_IDENTIFIER_VALUE(kToolbarVerticalTabsCollapseButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kTopContainerElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kUnfocusTabGroupButtonElementId);
|
||||
DECLARE_ELEMENT_IDENTIFIER_VALUE(kUserNotesSidePanelWebViewElementId);
|
||||
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
@@ -220,6 +220,8 @@ void PinnedToolbarActionsModel::ResetToD
|
||||
pref_service_->ClearPref(prefs::kShowExtensionsButton);
|
||||
pref_service_->ClearPref(prefs::kShowMenuButton);
|
||||
pref_service_->ClearPref(prefs::kShowMediaButton);
|
||||
+ pref_service_->ClearPref(prefs::kShowVerticalTabsCollapseButton);
|
||||
+ pref_service_->ClearPref(prefs::kShowDynamicNewTabButton);
|
||||
|
||||
pref_service_->ClearPref(prefs::kShowHomeButton);
|
||||
pref_service_->ClearPref(prefs::kShowForwardButton);
|
||||
@@ -241,6 +243,8 @@ bool PinnedToolbarActionsModel::IsDefaul
|
||||
prefs::kShowExtensionsButton,
|
||||
prefs::kShowMenuButton,
|
||||
prefs::kShowMediaButton,
|
||||
+ prefs::kShowVerticalTabsCollapseButton,
|
||||
+ prefs::kShowDynamicNewTabButton,
|
||||
|
||||
prefs::kPinnedActions,
|
||||
prefs::kShowHomeButton,
|
||||
--- a/chrome/browser/ui/view_ids.h
|
||||
+++ b/chrome/browser/ui/view_ids.h
|
||||
@@ -68,6 +68,8 @@ enum ViewID {
|
||||
VIEW_ID_WEBAUTHN_BUTTON,
|
||||
VIEW_ID_SHARING_HUB_BUTTON,
|
||||
VIEW_ID_MANAGEMENT_BUTTON,
|
||||
+ VIEW_ID_DYNAMIC_NEW_TAB_BUTTON,
|
||||
+ VIEW_ID_COLLAPSE_VERTICAL_TABS_BUTTON,
|
||||
|
||||
// Location bar content settings icons.
|
||||
VIEW_ID_CONTENT_SETTING_JAVASCRIPT,
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -109,6 +109,7 @@
|
||||
#include "components/send_tab_to_self/features.h"
|
||||
#include "components/signin/public/base/signin_buildflags.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
+#include "components/vector_icons/vector_icons.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "media/base/media_switches.h"
|
||||
@@ -137,6 +138,7 @@
|
||||
#include "ui/views/layout/flex_layout.h"
|
||||
#include "ui/views/layout/flex_layout_view.h"
|
||||
#include "ui/views/layout/proposed_layout.h"
|
||||
+#include "ui/views/vector_icons.h"
|
||||
#include "ui/views/view.h"
|
||||
#include "ui/views/view_class_properties.h"
|
||||
#include "ui/views/widget/tooltip_manager.h"
|
||||
@@ -163,6 +165,18 @@ constexpr int kLocationBarFlexOrder = kT
|
||||
constexpr int kToolbarActionsFlexOrder = kToolbarFlexOrderOffset + 2;
|
||||
constexpr int kExtensionsFlexOrder = kToolbarFlexOrderOffset + 3;
|
||||
|
||||
+constexpr int kDynamicNewTabButtonIconSize = 16;
|
||||
+
|
||||
+class DynamicNewTabToolbarButton : public ToolbarButton {
|
||||
+ public:
|
||||
+ explicit DynamicNewTabToolbarButton(PressedCallback callback)
|
||||
+ : ToolbarButton(std::move(callback)) {}
|
||||
+ ~DynamicNewTabToolbarButton() override = default;
|
||||
+
|
||||
+ protected:
|
||||
+ int GetIconSize() const override { return kDynamicNewTabButtonIconSize; }
|
||||
+};
|
||||
+
|
||||
// Gets the display mode for a given browser.
|
||||
ToolbarView::DisplayMode GetDisplayMode(Browser* browser) {
|
||||
// Checked in this order because even tabbed PWAs use the CUSTOM_TAB
|
||||
@@ -185,7 +199,9 @@ auto& GetViewCommandMap() {
|
||||
{VIEW_ID_FORWARD_BUTTON, IDC_FORWARD},
|
||||
{VIEW_ID_HOME_BUTTON, IDC_HOME},
|
||||
{VIEW_ID_RELOAD_BUTTON, IDC_RELOAD},
|
||||
- {VIEW_ID_AVATAR_BUTTON, IDC_SHOW_AVATAR_MENU}});
|
||||
+ {VIEW_ID_AVATAR_BUTTON, IDC_SHOW_AVATAR_MENU},
|
||||
+ {VIEW_ID_DYNAMIC_NEW_TAB_BUTTON, IDC_NEW_TAB},
|
||||
+ {VIEW_ID_COLLAPSE_VERTICAL_TABS_BUTTON, IDC_TOGGLE_VERTICAL_TABS}});
|
||||
return kViewCommandMap;
|
||||
}
|
||||
|
||||
@@ -344,6 +360,15 @@ void ToolbarView::Init() {
|
||||
|
||||
// Always add children in order from left to right, for accessibility.
|
||||
|
||||
+ vertical_tabs_collapse_button_ = AddChildView(std::make_unique<ToolbarButton>(
|
||||
+ base::BindRepeating(&ToolbarView::VerticalTabsCollapseButtonPressed,
|
||||
+ base::Unretained(this))));
|
||||
+ vertical_tabs_collapse_button_->SetID(VIEW_ID_COLLAPSE_VERTICAL_TABS_BUTTON);
|
||||
+ vertical_tabs_collapse_button_->SetVisible(false);
|
||||
+ vertical_tabs_collapse_button_->SetProperty(
|
||||
+ views::kElementIdentifierKey,
|
||||
+ kToolbarVerticalTabsCollapseButtonElementId);
|
||||
+
|
||||
back_ = AddChildView(std::make_unique<BackForwardButton>(
|
||||
BackForwardButton::Direction::kBack,
|
||||
base::BindRepeating(callback, browser_, IDC_BACK), browser_));
|
||||
@@ -384,6 +409,25 @@ void ToolbarView::Init() {
|
||||
location_bar_view_ = AddChildView(std::move(location_bar));
|
||||
location_bar_ = location_bar_view_;
|
||||
|
||||
+ std::unique_ptr<ToolbarButton> dynamic_new_tab_button =
|
||||
+ std::make_unique<DynamicNewTabToolbarButton>(base::BindRepeating(
|
||||
+ &ToolbarView::NewTabButtonPressed, base::Unretained(this)));
|
||||
+ const int dynamic_new_tab_button_size =
|
||||
+ GetLayoutConstant(LayoutConstant::kToolbarButtonHeight);
|
||||
+ dynamic_new_tab_button->SetPreferredSize(
|
||||
+ gfx::Size(dynamic_new_tab_button_size, dynamic_new_tab_button_size));
|
||||
+ dynamic_new_tab_button_ = AddChildView(std::move(dynamic_new_tab_button));
|
||||
+ dynamic_new_tab_button_->SetID(VIEW_ID_DYNAMIC_NEW_TAB_BUTTON);
|
||||
+ dynamic_new_tab_button_->SetTooltipText(
|
||||
+ l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB));
|
||||
+ dynamic_new_tab_button_->GetViewAccessibility().SetName(
|
||||
+ l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
|
||||
+ dynamic_new_tab_button_->SetVectorIcon(vector_icons::kAddIcon);
|
||||
+ dynamic_new_tab_button_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
|
||||
+ dynamic_new_tab_button_->SetVisible(false);
|
||||
+ dynamic_new_tab_button_->SetProperty(views::kElementIdentifierKey,
|
||||
+ kToolbarDynamicNewTabButtonElementId);
|
||||
+
|
||||
if (extensions_container) {
|
||||
extensions_container_ = AddChildView(std::move(extensions_container));
|
||||
extensions_toolbar_coordinator_ =
|
||||
@@ -445,19 +489,24 @@ void ToolbarView::Init() {
|
||||
media_button_ = AddChildView(std::move(media_button));
|
||||
}
|
||||
|
||||
+ if (auto* vertical_tab_strip_state_controller =
|
||||
+ tabs::VerticalTabStripStateController::From(
|
||||
+ browser_view_->browser())) {
|
||||
+ vertical_tab_mode_subscription_ =
|
||||
+ vertical_tab_strip_state_controller->RegisterOnModeChanged(
|
||||
+ base::BindRepeating(&ToolbarView::OnVerticalTabStripModeChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ vertical_tab_collapse_subscription_ =
|
||||
+ vertical_tab_strip_state_controller->RegisterOnCollapseChanged(
|
||||
+ base::BindRepeating(&ToolbarView::OnVerticalTabStripCollapseChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ should_display_vertical_tabs_ =
|
||||
+ vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs();
|
||||
+ }
|
||||
+
|
||||
#if BUILDFLAG(ENABLE_GLIC)
|
||||
if (glic::GlicEnabling::IsProfileEligible(browser_view_->GetProfile())) {
|
||||
- auto* vertical_tab_strip_state_controller =
|
||||
- tabs::VerticalTabStripStateController::From(browser_view_->browser());
|
||||
glic_button_ = AddChildView(CreateGlicButton());
|
||||
- if (vertical_tab_strip_state_controller) {
|
||||
- vertical_tab_subscription_ =
|
||||
- vertical_tab_strip_state_controller->RegisterOnModeChanged(
|
||||
- base::BindRepeating(&ToolbarView::OnVerticalTabStripModeChanged,
|
||||
- base::Unretained(this)));
|
||||
- should_display_vertical_tabs_ =
|
||||
- vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs();
|
||||
- }
|
||||
UpdateGlicButtonVisibility();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_GLIC)
|
||||
@@ -562,6 +611,16 @@ void ToolbarView::Init() {
|
||||
|
||||
reload_->SetVisible(show_reload_button_.GetValue());
|
||||
|
||||
+ show_vertical_tabs_collapse_button_.Init(
|
||||
+ prefs::kShowVerticalTabsCollapseButton, prefs,
|
||||
+ base::BindRepeating(&ToolbarView::UpdateToolbarLayout,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ show_dynamic_new_tab_button_.Init(
|
||||
+ prefs::kShowDynamicNewTabButton, prefs,
|
||||
+ base::BindRepeating(&ToolbarView::UpdateToolbarLayout,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
show_avatar_button_.Init(
|
||||
prefs::kShowAvatarButton, prefs,
|
||||
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
|
||||
@@ -610,8 +669,9 @@ void ToolbarView::Init() {
|
||||
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
|
||||
views::MaximumFlexSizeRule::kPreferred);
|
||||
|
||||
- for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
|
||||
- home_, avatar_}) {
|
||||
+ for (auto* button : std::array<views::Button*, 7>{
|
||||
+ vertical_tabs_collapse_button_, back_, forward_, reload_, home_,
|
||||
+ dynamic_new_tab_button_, avatar_}) {
|
||||
if (button) {
|
||||
button->set_tag(GetViewCommandMap().at(button->GetID()));
|
||||
button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
|
||||
@@ -624,6 +684,12 @@ void ToolbarView::Init() {
|
||||
void ToolbarView::OnVerticalTabStripModeChanged(
|
||||
tabs::VerticalTabStripStateController* controller) {
|
||||
should_display_vertical_tabs_ = controller->ShouldDisplayVerticalTabs();
|
||||
+ UpdateToolbarLayout();
|
||||
+}
|
||||
+
|
||||
+void ToolbarView::OnVerticalTabStripCollapseChanged(
|
||||
+ tabs::VerticalTabStripStateController* controller) {
|
||||
+ UpdateVerticalTabsCollapseButton();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_GLIC)
|
||||
@@ -1153,6 +1219,16 @@ void ToolbarView::NewTabButtonPressed(co
|
||||
NewTabTypes::kNewTabButtonInToolbarForTouch);
|
||||
}
|
||||
|
||||
+void ToolbarView::VerticalTabsCollapseButtonPressed(const ui::Event& event) {
|
||||
+ auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser_view_->browser());
|
||||
+ if (!controller) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ controller->SetCollapsed(!controller->IsCollapsed());
|
||||
+}
|
||||
+
|
||||
bool ToolbarView::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
||||
const views::View* focused_view = focus_manager()->GetFocusedView();
|
||||
if (focused_view && (focused_view->GetID() == VIEW_ID_OMNIBOX)) {
|
||||
@@ -1271,9 +1347,35 @@ void ToolbarView::LayoutCommon() {
|
||||
const bool extend_buttons_to_edge =
|
||||
browser_->window() &&
|
||||
(browser_->window()->IsMaximized() || browser_->window()->IsFullscreen());
|
||||
- back_->SetLeadingMargin(extend_buttons_to_edge ? interior_margin.left() : 0);
|
||||
+ const bool collapse_button_on_trailing_edge =
|
||||
+ vertical_tabs_collapse_button_ &&
|
||||
+ vertical_tabs_collapse_button_->GetVisible() && IsVerticalLayout() &&
|
||||
+ IsVerticalTabsRightAligned();
|
||||
+ ToolbarButton* const leading_button =
|
||||
+ vertical_tabs_collapse_button_ &&
|
||||
+ vertical_tabs_collapse_button_->GetVisible() &&
|
||||
+ !collapse_button_on_trailing_edge
|
||||
+ ? vertical_tabs_collapse_button_.get()
|
||||
+ : back_.get();
|
||||
+ leading_button->SetLeadingMargin(
|
||||
+ extend_buttons_to_edge ? interior_margin.left() : 0);
|
||||
+ if (leading_button != back_.get()) {
|
||||
+ back_->SetLeadingMargin(0);
|
||||
+ }
|
||||
+ if (vertical_tabs_collapse_button_.get() != leading_button) {
|
||||
+ vertical_tabs_collapse_button_->SetLeadingMargin(0);
|
||||
+ }
|
||||
+
|
||||
app_menu_button_->SetTrailingMargin(
|
||||
- extend_buttons_to_edge ? interior_margin.right() : 0);
|
||||
+ extend_buttons_to_edge && !collapse_button_on_trailing_edge
|
||||
+ ? interior_margin.right()
|
||||
+ : 0);
|
||||
+ if (vertical_tabs_collapse_button_) {
|
||||
+ vertical_tabs_collapse_button_->SetTrailingMargin(
|
||||
+ extend_buttons_to_edge && collapse_button_on_trailing_edge
|
||||
+ ? interior_margin.right()
|
||||
+ : 0);
|
||||
+ }
|
||||
|
||||
if (toolbar_divider_ && extensions_container_) {
|
||||
views::ManualLayoutUtil(layout_manager_)
|
||||
@@ -1333,6 +1435,19 @@ void ToolbarView::UpdateToolbarLayout()
|
||||
.WithOrder(order);
|
||||
};
|
||||
|
||||
+ UpdateVerticalTabsCollapseButton();
|
||||
+ UpdateDynamicNewTabButton();
|
||||
+
|
||||
+ if (vertical_tabs_collapse_button_) {
|
||||
+ const size_t target_index =
|
||||
+ IsVerticalLayout() && IsVerticalTabsRightAligned()
|
||||
+ ? GetIndexOf(app_menu_button_).value() + 1
|
||||
+ : 0;
|
||||
+ if (GetIndexOf(vertical_tabs_collapse_button_).value() != target_index) {
|
||||
+ ReorderChildView(vertical_tabs_collapse_button_, target_index);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
location_bar_view_->SetProperty(views::kFlexBehaviorKey,
|
||||
location_bar_flex_rule);
|
||||
if (is_compact_layout) {
|
||||
@@ -1371,6 +1486,65 @@ bool ToolbarView::IsCompactLayout() cons
|
||||
return controller && controller->IsCompactLayout();
|
||||
}
|
||||
|
||||
+bool ToolbarView::IsDynamicLayout() const {
|
||||
+ auto* controller =
|
||||
+ HeliumLayoutStateController::From(browser_view_->browser());
|
||||
+ return controller && controller->IsDynamicLayout();
|
||||
+}
|
||||
+
|
||||
+bool ToolbarView::IsVerticalLayout() const {
|
||||
+ auto* controller =
|
||||
+ HeliumLayoutStateController::From(browser_view_->browser());
|
||||
+ return controller && controller->IsVerticalLayout();
|
||||
+}
|
||||
+
|
||||
+bool ToolbarView::IsVerticalTabsRightAligned() const {
|
||||
+ auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser_view_->browser());
|
||||
+ return controller && controller->IsTabStripRightAligned();
|
||||
+}
|
||||
+
|
||||
+bool ToolbarView::ShouldShowToolbarNewTabButton() const {
|
||||
+ return IsCompactLayout() || IsDynamicLayout();
|
||||
+}
|
||||
+
|
||||
+void ToolbarView::UpdateVerticalTabsCollapseButton() {
|
||||
+ if (!vertical_tabs_collapse_button_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser_view_->browser());
|
||||
+ const bool should_show = controller && IsVerticalLayout() &&
|
||||
+ show_vertical_tabs_collapse_button_.GetValue();
|
||||
+ vertical_tabs_collapse_button_->SetVisible(should_show);
|
||||
+
|
||||
+ if (!should_show) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const bool should_use_menu_open_icon =
|
||||
+ controller->IsCollapsed() == controller->IsTabStripRightAligned();
|
||||
+ const gfx::VectorIcon& icon =
|
||||
+ should_use_menu_open_icon ? views::kMenuOpenIcon : views::kMenuCloseIcon;
|
||||
+ const int text_id = controller->IsCollapsed() ? IDS_EXPAND_VERTICAL_TABS
|
||||
+ : IDS_COLLAPSE_VERTICAL_TABS;
|
||||
+ const std::u16string text = l10n_util::GetStringUTF16(text_id);
|
||||
+
|
||||
+ vertical_tabs_collapse_button_->SetVectorIcon(icon);
|
||||
+ vertical_tabs_collapse_button_->SetTooltipText(text);
|
||||
+ vertical_tabs_collapse_button_->GetViewAccessibility().SetName(text);
|
||||
+}
|
||||
+
|
||||
+void ToolbarView::UpdateDynamicNewTabButton() {
|
||||
+ if (!dynamic_new_tab_button_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ dynamic_new_tab_button_->SetVisible(ShouldShowToolbarNewTabButton() &&
|
||||
+ show_dynamic_new_tab_button_.GetValue());
|
||||
+}
|
||||
+
|
||||
// AppMenuIconController::Delegate:
|
||||
void ToolbarView::UpdateTypeAndSeverity(
|
||||
AppMenuIconController::TypeAndSeverity type_and_severity) {
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
@@ -246,6 +246,12 @@ class ToolbarView : public views::Access
|
||||
|
||||
// Returns whether the Helium layout is Compact.
|
||||
bool IsCompactLayout() const;
|
||||
+ bool IsDynamicLayout() const;
|
||||
+ bool IsVerticalLayout() const;
|
||||
+ bool IsVerticalTabsRightAligned() const;
|
||||
+ bool ShouldShowToolbarNewTabButton() const;
|
||||
+ void UpdateVerticalTabsCollapseButton();
|
||||
+ void UpdateDynamicNewTabButton();
|
||||
|
||||
// AppMenuIconController::Delegate:
|
||||
void UpdateTypeAndSeverity(
|
||||
@@ -314,9 +320,12 @@ class ToolbarView : public views::Access
|
||||
void OnTouchUiChanged();
|
||||
|
||||
void NewTabButtonPressed(const ui::Event& event);
|
||||
+ void VerticalTabsCollapseButtonPressed(const ui::Event& event);
|
||||
|
||||
void OnVerticalTabStripModeChanged(
|
||||
tabs::VerticalTabStripStateController* controller);
|
||||
+ void OnVerticalTabStripCollapseChanged(
|
||||
+ tabs::VerticalTabStripStateController* controller);
|
||||
|
||||
#if BUILDFLAG(ENABLE_GLIC)
|
||||
std::unique_ptr<glic::ToolbarGlicButton> CreateGlicButton();
|
||||
@@ -334,6 +343,7 @@ class ToolbarView : public views::Access
|
||||
// Controls. Most of these can be null, e.g. in popup windows. Only
|
||||
// |location_bar_| is guaranteed to exist. These pointers are owned by the
|
||||
// view hierarchy.
|
||||
+ raw_ptr<ToolbarButton> vertical_tabs_collapse_button_ = nullptr;
|
||||
raw_ptr<ToolbarButton> back_ = nullptr;
|
||||
raw_ptr<ToolbarButton> forward_ = nullptr;
|
||||
raw_ptr<ReloadButton> reload_ = nullptr;
|
||||
@@ -351,6 +361,7 @@ class ToolbarView : public views::Access
|
||||
raw_ptr<PinnedToolbarActionsContainer> pinned_toolbar_actions_container_ =
|
||||
nullptr;
|
||||
raw_ptr<AvatarToolbarButton> avatar_ = nullptr;
|
||||
+ raw_ptr<ToolbarButton> dynamic_new_tab_button_ = nullptr;
|
||||
raw_ptr<MediaToolbarButtonView> media_button_ = nullptr;
|
||||
raw_ptr<BrowserAppMenuButton> app_menu_button_ = nullptr;
|
||||
raw_ptr<views::View> new_tab_button_ = nullptr;
|
||||
@@ -377,6 +388,10 @@ class ToolbarView : public views::Access
|
||||
|
||||
BooleanPrefMember show_reload_button_;
|
||||
|
||||
+ BooleanPrefMember show_vertical_tabs_collapse_button_;
|
||||
+
|
||||
+ BooleanPrefMember show_dynamic_new_tab_button_;
|
||||
+
|
||||
BooleanPrefMember show_avatar_button_;
|
||||
|
||||
BooleanPrefMember show_extensions_button_;
|
||||
@@ -407,8 +422,8 @@ class ToolbarView : public views::Access
|
||||
// `toolbar_controller_`.
|
||||
raw_ptr<OverflowButton> overflow_button_ = nullptr;
|
||||
|
||||
- // Subscription for when tab strip mode changes
|
||||
- base::CallbackListSubscription vertical_tab_subscription_;
|
||||
+ base::CallbackListSubscription vertical_tab_mode_subscription_;
|
||||
+ base::CallbackListSubscription vertical_tab_collapse_subscription_;
|
||||
|
||||
bool should_display_vertical_tabs_ = false;
|
||||
bool should_show_glic_button_ = false;
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -282,6 +282,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kShowMediaButton] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kShowVerticalTabsCollapseButton] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kShowDynamicNewTabButton] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
// Appearance settings.
|
||||
(*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
@@ -18,6 +18,8 @@ enum ActionId {
|
||||
kForward,
|
||||
kBack,
|
||||
kReload,
|
||||
+ kVerticalTabsCollapse,
|
||||
+ kDynamicNewTab,
|
||||
kAvatar,
|
||||
kExtensions,
|
||||
kMenu,
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "ui/base/models/image_model.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/gfx/vector_icon_types.h"
|
||||
+#include "ui/views/vector_icons.h"
|
||||
|
||||
namespace {
|
||||
std::optional<side_panel::customize_chrome::mojom::ActionId>
|
||||
@@ -51,6 +52,11 @@ MojoActionForChromeAction(actions::Actio
|
||||
return side_panel::customize_chrome::mojom::ActionId::kBack;
|
||||
case kActionReload:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kReload;
|
||||
+ case kActionToggleCollapseVertical:
|
||||
+ return side_panel::customize_chrome::mojom::ActionId::
|
||||
+ kVerticalTabsCollapse;
|
||||
+ case kActionNewTab:
|
||||
+ return side_panel::customize_chrome::mojom::ActionId::kDynamicNewTab;
|
||||
case kActionAvatar:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kAvatar;
|
||||
case kActionExtensions:
|
||||
@@ -109,6 +115,10 @@ std::optional<actions::ActionId> ChromeA
|
||||
return kActionBack;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kReload:
|
||||
return kActionReload;
|
||||
+ case side_panel::customize_chrome::mojom::ActionId::kVerticalTabsCollapse:
|
||||
+ return kActionToggleCollapseVertical;
|
||||
+ case side_panel::customize_chrome::mojom::ActionId::kDynamicNewTab:
|
||||
+ return kActionNewTab;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kAvatar:
|
||||
return kActionAvatar;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kExtensions:
|
||||
@@ -199,6 +209,16 @@ CustomizeToolbarHandler::CustomizeToolba
|
||||
base::Unretained(this), kActionReload,
|
||||
prefs::kShowReloadButton));
|
||||
pref_change_registrar_.Add(
|
||||
+ prefs::kShowVerticalTabsCollapseButton,
|
||||
+ base::BindRepeating(&CustomizeToolbarHandler::OnActionPinnedChanged,
|
||||
+ base::Unretained(this), kActionToggleCollapseVertical,
|
||||
+ prefs::kShowVerticalTabsCollapseButton));
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kShowDynamicNewTabButton,
|
||||
+ base::BindRepeating(&CustomizeToolbarHandler::OnActionPinnedChanged,
|
||||
+ base::Unretained(this), kActionNewTab,
|
||||
+ prefs::kShowDynamicNewTabButton));
|
||||
+ pref_change_registrar_.Add(
|
||||
prefs::kShowAvatarButton,
|
||||
base::BindRepeating(&CustomizeToolbarHandler::OnActionPinnedChanged,
|
||||
base::Unretained(this), kActionAvatar,
|
||||
@@ -282,6 +302,32 @@ void CustomizeToolbarHandler::ListAction
|
||||
.Rasterize(&provider),
|
||||
scale_factor)));
|
||||
|
||||
+ auto vertical_tabs_collapse_action =
|
||||
+ side_panel::customize_chrome::mojom::Action::New(
|
||||
+ MojoActionForChromeAction(kActionToggleCollapseVertical).value(),
|
||||
+ base::UTF16ToUTF8(
|
||||
+ l10n_util::GetStringUTF16(IDS_COLLAPSE_VERTICAL_TABS)),
|
||||
+ prefs()->GetBoolean(prefs::kShowVerticalTabsCollapseButton), false,
|
||||
+ side_panel::customize_chrome::mojom::CategoryId::kNavigation,
|
||||
+ GURL(webui::EncodePNGAndMakeDataURI(
|
||||
+ ui::ImageModel::FromVectorIcon(views::kMenuCloseIcon,
|
||||
+ icon_color_id)
|
||||
+ .Rasterize(&provider),
|
||||
+ scale_factor)));
|
||||
+
|
||||
+ auto dynamic_new_tab_action =
|
||||
+ side_panel::customize_chrome::mojom::Action::New(
|
||||
+ MojoActionForChromeAction(kActionNewTab).value(),
|
||||
+ base::UTF16ToUTF8(BrowserActions::GetCleanTitleAndTooltipText(
|
||||
+ l10n_util::GetStringUTF16(IDS_NEW_TAB))),
|
||||
+ prefs()->GetBoolean(prefs::kShowDynamicNewTabButton), false,
|
||||
+ side_panel::customize_chrome::mojom::CategoryId::kNavigation,
|
||||
+ GURL(webui::EncodePNGAndMakeDataURI(
|
||||
+ ui::ImageModel::FromVectorIcon(vector_icons::kAddIcon,
|
||||
+ icon_color_id)
|
||||
+ .Rasterize(&provider),
|
||||
+ scale_factor)));
|
||||
+
|
||||
auto avatar_action = side_panel::customize_chrome::mojom::Action::New(
|
||||
MojoActionForChromeAction(kActionAvatar).value(),
|
||||
base::UTF16ToUTF8(l10n_util::GetStringUTF16(IDS_PROFILES_MENU_NAME)),
|
||||
@@ -367,6 +413,9 @@ void CustomizeToolbarHandler::ListAction
|
||||
actions.push_back(std::move(contextual_task_action));
|
||||
}
|
||||
|
||||
+ actions.push_back(std::move(vertical_tabs_collapse_action));
|
||||
+ actions.push_back(std::move(dynamic_new_tab_action));
|
||||
+
|
||||
actions.push_back(std::move(extensions_action));
|
||||
actions.push_back(std::move(media_controls_action));
|
||||
actions.push_back(std::move(avatar_action));
|
||||
@@ -511,6 +560,12 @@ void CustomizeToolbarHandler::PinAction(
|
||||
case kActionReload:
|
||||
prefs()->SetBoolean(prefs::kShowReloadButton, pin);
|
||||
break;
|
||||
+ case kActionToggleCollapseVertical:
|
||||
+ prefs()->SetBoolean(prefs::kShowVerticalTabsCollapseButton, pin);
|
||||
+ break;
|
||||
+ case kActionNewTab:
|
||||
+ prefs()->SetBoolean(prefs::kShowDynamicNewTabButton, pin);
|
||||
+ break;
|
||||
case kActionAvatar:
|
||||
prefs()->SetBoolean(prefs::kShowAvatarButton, pin);
|
||||
break;
|
||||
@@ -0,0 +1,255 @@
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
|
||||
#include "chrome/browser/ui/views/frame/custom_corners_background.h"
|
||||
@@ -49,6 +50,10 @@ constexpr int kLoadingBarOffset =
|
||||
// Minimum area next to caption buttons to use as a grab handle.
|
||||
constexpr int kVerticalTabsGrabHandleSize = 40;
|
||||
|
||||
+// Overlap the caption-button exclusion so the toolbar can sit flush
|
||||
+// against the frame controls when it is the top-most row.
|
||||
+constexpr int kTopToolbarExclusion = 10;
|
||||
+
|
||||
// Maximum portion of the window a "size-restricted" contents-height side panel
|
||||
// can take up. This is not the only limit on side panel size.
|
||||
constexpr float kMaxContentsHeightSidePanelFraction = 2.f / 3.f;
|
||||
@@ -410,6 +415,14 @@ BrowserViewTabbedLayoutImpl::GetTabStrip
|
||||
: TabStripType::kNone;
|
||||
}
|
||||
|
||||
+HeliumLayoutType BrowserViewTabbedLayoutImpl::GetHeliumLayout() const {
|
||||
+ auto* const controller =
|
||||
+ HeliumLayoutStateController::Get(browser()->GetUnownedUserDataHost());
|
||||
+
|
||||
+ return controller ? controller->GetBrowserLayout()
|
||||
+ : HeliumLayoutType::kClassic;
|
||||
+}
|
||||
+
|
||||
bool BrowserViewTabbedLayoutImpl::ShadowOverlayVisible() const {
|
||||
if (!views().toolbar_height_side_panel) {
|
||||
return false;
|
||||
@@ -970,15 +983,20 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
tab_strip_type == TabStripType::kHorizontal);
|
||||
}
|
||||
|
||||
- // Lay out toolbar. If tabstrip is completely absent (or vertical), this can
|
||||
- // go in the top exclusion area.
|
||||
+ // Lay out toolbar. If toolbar is in the top-most row, it will go into the
|
||||
+ // exclusion area.
|
||||
const bool toolbar_visible = delegate().IsToolbarVisible();
|
||||
if (IsParentedTo(views().toolbar, views().top_container)) {
|
||||
gfx::Rect toolbar_bounds;
|
||||
if (toolbar_visible) {
|
||||
+ // Toolbar is in the top row in all layouts except Classic.
|
||||
+ const bool is_not_classic =
|
||||
+ GetHeliumLayout() != HeliumLayoutType::kClassic;
|
||||
+ const int exclusion = is_not_classic ? kTopToolbarExclusion : 0;
|
||||
+
|
||||
toolbar_bounds =
|
||||
needs_exclusion
|
||||
- ? GetBoundsWithExclusion(params, views().toolbar)
|
||||
+ ? GetBoundsWithExclusion(params, views().toolbar, exclusion)
|
||||
: gfx::Rect(params.visual_client_area.x(),
|
||||
params.visual_client_area.y(),
|
||||
params.visual_client_area.width(),
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "chrome/browser/ui/global_error/global_error_service.h"
|
||||
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
|
||||
#include "chrome/browser/ui/global_media_controls/media_toolbar_button_controller.h"
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/intent_picker_tab_helper.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/omnibox/omnibox_view.h"
|
||||
@@ -155,6 +156,11 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActi
|
||||
|
||||
namespace {
|
||||
|
||||
+constexpr int kToolbarFlexOrderOffset = 1000;
|
||||
+constexpr int kLocationBarFlexOrder = kToolbarFlexOrderOffset + 1;
|
||||
+constexpr int kToolbarActionsFlexOrder = kToolbarFlexOrderOffset + 2;
|
||||
+constexpr int kExtensionsFlexOrder = kToolbarFlexOrderOffset + 3;
|
||||
+
|
||||
// Gets the display mode for a given browser.
|
||||
ToolbarView::DisplayMode GetDisplayMode(Browser* browser) {
|
||||
// Checked in this order because even tabbed PWAs use the CUSTOM_TAB
|
||||
@@ -598,10 +604,15 @@ void ToolbarView::Init() {
|
||||
|
||||
InitLayout();
|
||||
|
||||
+ auto flex_preferred =
|
||||
+ views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
|
||||
+ views::MaximumFlexSizeRule::kPreferred);
|
||||
+
|
||||
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
|
||||
home_, avatar_}) {
|
||||
if (button) {
|
||||
button->set_tag(GetViewCommandMap().at(button->GetID()));
|
||||
+ button->SetProperty(views::kFlexBehaviorKey, flex_preferred);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1152,22 +1163,6 @@ views::View* ToolbarView::GetDefaultFocu
|
||||
void ToolbarView::InitLayout() {
|
||||
const int default_margin =
|
||||
GetLayoutConstant(LayoutConstant::kToolbarIconDefaultMargin);
|
||||
- // TODO(dfried): rename this constant.
|
||||
- const int location_bar_margin =
|
||||
- GetLayoutConstant(LayoutConstant::kToolbarStandardSpacing);
|
||||
-
|
||||
- // Shift previously flex-able elements' order by `kOrderOffset`.
|
||||
- // This will cause them to be the first ones to drop out or shrink to minimum.
|
||||
- // Order 1 - kOrderOffset will be assigned to new flex-able elements.
|
||||
- constexpr int kOrderOffset = 1000;
|
||||
- constexpr int kLocationBarFlexOrder = kOrderOffset + 1;
|
||||
- constexpr int kToolbarActionsFlexOrder = kOrderOffset + 2;
|
||||
- constexpr int kExtensionsFlexOrder = kOrderOffset + 3;
|
||||
-
|
||||
- const views::FlexSpecification location_bar_flex_rule =
|
||||
- views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum,
|
||||
- views::MaximumFlexSizeRule::kUnbounded)
|
||||
- .WithOrder(kLocationBarFlexOrder);
|
||||
|
||||
layout_manager_ = SetLayoutManager(std::make_unique<views::FlexLayout>());
|
||||
|
||||
@@ -1176,12 +1171,7 @@ void ToolbarView::InitLayout() {
|
||||
.SetCollapseMargins(true)
|
||||
.SetDefault(views::kMarginsKey, gfx::Insets::VH(0, default_margin));
|
||||
|
||||
- if (location_bar_view_) {
|
||||
- location_bar_view_->SetProperty(views::kFlexBehaviorKey,
|
||||
- location_bar_flex_rule);
|
||||
- location_bar_view_->SetProperty(views::kMarginsKey,
|
||||
- gfx::Insets::VH(0, location_bar_margin));
|
||||
- }
|
||||
+ UpdateToolbarLayout();
|
||||
|
||||
if (extensions_container_) {
|
||||
const views::FlexSpecification extensions_flex_rule =
|
||||
@@ -1227,9 +1217,7 @@ void ToolbarView::LayoutCommon() {
|
||||
DCHECK(display_mode_ == DisplayMode::kNormal);
|
||||
|
||||
gfx::Insets interior_margin =
|
||||
- GetLayoutInsets(browser_view_->webui_tab_strip()
|
||||
- ? LayoutInset::WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN
|
||||
- : LayoutInset::TOOLBAR_INTERIOR_MARGIN);
|
||||
+ GetLayoutInsets(LayoutInset::TOOLBAR_INTERIOR_MARGIN);
|
||||
|
||||
if (!browser_view_->webui_tab_strip()) {
|
||||
if (app_menu_button_->IsLabelPresentAndVisible()) {
|
||||
@@ -1276,6 +1264,68 @@ void ToolbarView::LayoutCommon() {
|
||||
// Cast button visibility is controlled externally.
|
||||
}
|
||||
|
||||
+void ToolbarView::UpdateToolbarLayout() {
|
||||
+ if (!location_bar_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const auto flex_preferred =
|
||||
+ views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
|
||||
+ views::MaximumFlexSizeRule::kPreferred);
|
||||
+ const int location_bar_margin =
|
||||
+ GetLayoutConstant(LayoutConstant::kToolbarStandardSpacing);
|
||||
+ const auto min_location_bar_flex = views::MinimumFlexSizeRule::kPreferred;
|
||||
+ const views::FlexSpecification location_bar_flex_rule =
|
||||
+ views::FlexSpecification(min_location_bar_flex,
|
||||
+ views::MaximumFlexSizeRule::kUnbounded)
|
||||
+ .WithOrder(kLocationBarFlexOrder);
|
||||
+
|
||||
+ const bool is_compact_layout = IsCompactLayout();
|
||||
+ const auto make_flex_rule = [&](auto* layout_manager, int order) {
|
||||
+ return is_compact_layout
|
||||
+ ? flex_preferred
|
||||
+ : views::FlexSpecification(layout_manager->GetDefaultFlexRule())
|
||||
+ .WithOrder(order);
|
||||
+ };
|
||||
+
|
||||
+ location_bar_view_->SetProperty(views::kFlexBehaviorKey,
|
||||
+ location_bar_flex_rule);
|
||||
+ if (is_compact_layout) {
|
||||
+ location_bar_view_->SetPreferredSize(gfx::Size(kPreferredCompactWidth, 0));
|
||||
+ location_bar_view_->SetProperty(
|
||||
+ views::kMarginsKey, gfx::Insets::TLBR(0, location_bar_margin, 0, 0));
|
||||
+ } else {
|
||||
+ location_bar_view_->SetPreferredSize(std::nullopt);
|
||||
+ location_bar_view_->SetProperty(views::kMarginsKey,
|
||||
+ gfx::Insets::VH(0, location_bar_margin));
|
||||
+ }
|
||||
+
|
||||
+ // Pinned actions (including downloads) and extensions
|
||||
+ // should not shrink in compact layout.
|
||||
+ if (pinned_toolbar_actions_container_) {
|
||||
+ pinned_toolbar_actions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey,
|
||||
+ make_flex_rule(
|
||||
+ pinned_toolbar_actions_container_->GetAnimatingLayoutManager(),
|
||||
+ kToolbarActionsFlexOrder));
|
||||
+ }
|
||||
+
|
||||
+ if (extensions_container_) {
|
||||
+ extensions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey,
|
||||
+ make_flex_rule(extensions_container_->GetAnimatingLayoutManager(),
|
||||
+ kExtensionsFlexOrder));
|
||||
+ }
|
||||
+
|
||||
+ InvalidateLayout();
|
||||
+}
|
||||
+
|
||||
+bool ToolbarView::IsCompactLayout() const {
|
||||
+ auto* controller =
|
||||
+ HeliumLayoutStateController::From(browser_view_->browser());
|
||||
+ return controller && controller->IsCompactLayout();
|
||||
+}
|
||||
+
|
||||
// AppMenuIconController::Delegate:
|
||||
void ToolbarView::UpdateTypeAndSeverity(
|
||||
AppMenuIconController::TypeAndSeverity type_and_severity) {
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
@@ -152,6 +152,9 @@ class ToolbarView : public views::Access
|
||||
// Shows a bookmark bubble and anchors it appropriately.
|
||||
void ShowBookmarkBubble(const GURL& url, bool already_bookmarked);
|
||||
|
||||
+ // Updates the toolbar for the current browser layout.
|
||||
+ void UpdateToolbarLayout();
|
||||
+
|
||||
// Accessors.
|
||||
Browser* browser() const { return browser_; }
|
||||
views::Button* GetChromeLabsButton() const;
|
||||
@@ -237,6 +240,9 @@ class ToolbarView : public views::Access
|
||||
// Logic that must be done on initialization and then on layout.
|
||||
void LayoutCommon();
|
||||
|
||||
+ // Returns whether the Helium layout is Compact.
|
||||
+ bool IsCompactLayout() const;
|
||||
+
|
||||
// AppMenuIconController::Delegate:
|
||||
void UpdateTypeAndSeverity(
|
||||
AppMenuIconController::TypeAndSeverity type_and_severity) override;
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_tabbed_layout_impl.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
+#include "chrome/browser/ui/helium/helium_layout_state_controller.h"
|
||||
#include "chrome/browser/ui/views/frame/layout/browser_view_layout.h"
|
||||
#include "chrome/browser/ui/views/frame/layout/browser_view_layout_impl.h"
|
||||
#include "chrome/browser/ui/views/frame/layout/browser_view_layout_params.h"
|
||||
@@ -108,6 +109,7 @@ class BrowserViewTabbedLayoutImpl : publ
|
||||
|
||||
// Returns the type of tabstrip present.
|
||||
enum class TabStripType { kNone, kWebUi, kVertical, kHorizontal };
|
||||
+ HeliumLayoutType GetHeliumLayout() const;
|
||||
TabStripType GetTabStripType() const;
|
||||
|
||||
// Returns whether the shadow overlay (with its attendant margin) around the
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,19 +63,22 @@
|
||||
|
||||
return (ui::TouchUiController::Get()->touch_ui()
|
||||
? kDefaultInternalSpacingTouchUI
|
||||
@@ -826,6 +824,15 @@ SkPath IconLabelBubbleView::GetHighlight
|
||||
{radii.lower_right(), radii.lower_right()},
|
||||
{radii.lower_left(), radii.lower_left()}};
|
||||
@@ -820,12 +818,12 @@ SkPath IconLabelBubbleView::GetHighlight
|
||||
highlight_bounds = GetMirroredRect(highlight_bounds);
|
||||
|
||||
+ const SkRect new_rect = RectToSkRect(highlight_bounds);
|
||||
const SkRect rect = RectToSkRect(highlight_bounds);
|
||||
- gfx::RoundedCornersF radii = GetCornerRadii();
|
||||
- const SkVector sk_radii[4] = {{radii.upper_left(), radii.upper_left()},
|
||||
- {radii.upper_right(), radii.upper_right()},
|
||||
- {radii.lower_right(), radii.lower_right()},
|
||||
- {radii.lower_left(), radii.lower_left()}};
|
||||
-
|
||||
+ const float layout_radius = static_cast<float>(
|
||||
+ GetLayoutConstant(LayoutConstant::kLocationBarChildCornerRadius));
|
||||
+ const SkVector new_radii[4] = {{layout_radius, layout_radius},
|
||||
+ const SkVector sk_radii[4] = {{layout_radius, layout_radius},
|
||||
+ {layout_radius, layout_radius},
|
||||
+ {layout_radius, layout_radius},
|
||||
+ {layout_radius, layout_radius}};
|
||||
+ return SkPath::RRect(SkRRect::MakeRectRadii(new_rect, new_radii));
|
||||
+
|
||||
return SkPath::RRect(SkRRect::MakeRectRadii(rect, sk_radii));
|
||||
}
|
||||
|
||||
|
||||
+128
-25
@@ -69,10 +69,16 @@
|
||||
}
|
||||
|
||||
void OmniboxResultView::SetMatch(const AutocompleteMatch& match) {
|
||||
@@ -510,14 +507,6 @@ void OmniboxResultView::ApplyThemeAndRef
|
||||
popup_view_->controller()->client()->GetTemplateURLService())) {
|
||||
const OmniboxPopupSelection::LineState line_state =
|
||||
popup_view_->GetSelection().state;
|
||||
@@ -504,22 +501,6 @@ void OmniboxResultView::ApplyThemeAndRef
|
||||
|
||||
button_row_->SetThemeState(GetThemeState());
|
||||
|
||||
- // The selection indicator indicates when the suggestion is focused. Do not
|
||||
- // show the selection indicator if an auxiliary button is selected.
|
||||
- if (match_.HasInstantKeyword(
|
||||
- popup_view_->controller()->client()->GetTemplateURLService())) {
|
||||
- const OmniboxPopupSelection::LineState line_state =
|
||||
- popup_view_->GetSelection().state;
|
||||
- selection_indicator_->SetVisible(
|
||||
- selected &&
|
||||
- (line_state == OmniboxPopupSelection::LineState::NORMAL ||
|
||||
@@ -81,32 +87,85 @@
|
||||
- selection_indicator_->SetVisible(selected &&
|
||||
- popup_view_->GetSelection().state ==
|
||||
- OmniboxPopupSelection::NORMAL);
|
||||
}
|
||||
|
||||
- }
|
||||
-
|
||||
if (suggestion_view_->iph_link_view()->GetVisible()) {
|
||||
views::FocusRing::Get(suggestion_view_->iph_link_view())->SchedulePaint();
|
||||
}
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_row_view.cc
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_row_view.cc
|
||||
@@ -106,6 +106,8 @@ views::View* OmniboxRowView::GetActiveAu
|
||||
@@ -106,16 +106,7 @@ views::View* OmniboxRowView::GetActiveAu
|
||||
}
|
||||
|
||||
gfx::Insets OmniboxRowView::GetInsets() const {
|
||||
- if (result_view_->GetThemeState() == OmniboxPartState::IPH) {
|
||||
- int LRInsets = OmniboxMatchCellView::kIphOffset;
|
||||
- return gfx::Insets::TLBR(8, LRInsets, 8, LRInsets);
|
||||
- }
|
||||
-
|
||||
- if (result_view_->GetThemeState() == OmniboxPartState::TOOLBELT) {
|
||||
- return gfx::Insets::TLBR(0, 0, 0, 0);
|
||||
- }
|
||||
-
|
||||
- return gfx::Insets::TLBR(0, 0, 0, 16);
|
||||
+ return gfx::Insets::TLBR(2, 4, 0, 4);
|
||||
+
|
||||
if (result_view_->GetThemeState() == OmniboxPartState::IPH) {
|
||||
int LRInsets = OmniboxMatchCellView::kIphOffset;
|
||||
return gfx::Insets::TLBR(8, LRInsets, 8, LRInsets);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(OmniboxRowView)
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc
|
||||
@@ -366,7 +366,7 @@ void OmniboxMatchCellView::SetIcon(const
|
||||
should_draw_icon_background = false;
|
||||
}
|
||||
@@ -60,9 +60,6 @@ static constexpr int kUniformRowHeightIc
|
||||
// since the text will have to be further right to accommodate the icons.
|
||||
static constexpr int kIphTextIndent = 14;
|
||||
|
||||
-// The extra space added to the left-side inset of the toolbelt suggestion.
|
||||
-static constexpr int kToolbeltTextInsetLeft = 12;
|
||||
-
|
||||
// The right-side inset of the toolbelt suggestion.
|
||||
static constexpr int kToolbeltTextInsetRight = 8;
|
||||
|
||||
@@ -349,40 +346,7 @@ void OmniboxMatchCellView::OnMatchUpdate
|
||||
|
||||
void OmniboxMatchCellView::SetIcon(const gfx::ImageSkia& image,
|
||||
const AutocompleteMatch& match) {
|
||||
- const bool is_pedal_suggestion_row =
|
||||
- match.type == AutocompleteMatchType::PEDAL;
|
||||
- const bool is_journeys_suggestion_row =
|
||||
- match.type == AutocompleteMatchType::HISTORY_CLUSTER;
|
||||
- const bool is_instant_keyword_row =
|
||||
- AutocompleteMatch::IsFeaturedSearchType(match.type);
|
||||
- bool should_draw_icon_background = is_pedal_suggestion_row ||
|
||||
- is_journeys_suggestion_row ||
|
||||
- is_instant_keyword_row;
|
||||
-
|
||||
- // Do not apply the distinctive background color to the open lens action when
|
||||
- // the UI tweaks are enabled.
|
||||
- if (match.HasTakeoverAction(OmniboxActionId::CONTEXTUAL_SEARCH_OPEN_LENS) &&
|
||||
- omnibox_feature_configs::ContextualSearch::Get().open_lens_action_ui_tweaks) {
|
||||
- should_draw_icon_background = false;
|
||||
- }
|
||||
-
|
||||
- if (should_draw_icon_background) {
|
||||
+ if ((false)) {
|
||||
// When a PEDAL suggestion has been split out to its own row, apply a square
|
||||
// background with a distinctive color to the respective icon. Journeys
|
||||
// suggestion rows should also receive the same treatment.
|
||||
@@ -590,7 +590,7 @@ gfx::Size OmniboxMatchCellView::Calculat
|
||||
- // When a PEDAL suggestion has been split out to its own row, apply a square
|
||||
- // background with a distinctive color to the respective icon. Journeys
|
||||
- // suggestion rows should also receive the same treatment.
|
||||
- const auto background_color = is_pedal_suggestion_row ||
|
||||
- is_journeys_suggestion_row ||
|
||||
- is_instant_keyword_row
|
||||
- ? kColorOmniboxAnswerIconGM3Background
|
||||
- : kColorOmniboxResultsIconGM3Background;
|
||||
- icon_view_->SetImage(ui::ImageModel::FromImageSkia(
|
||||
- gfx::ImageSkiaOperations::CreateImageWithRoundRectBackground(
|
||||
- gfx::SizeF(kUniformRowHeightIconSize, kUniformRowHeightIconSize),
|
||||
- kIconAndImageCornerRadius,
|
||||
- GetColorProvider()->GetColor(background_color), image)));
|
||||
- } else {
|
||||
icon_view_->SetImage(ui::ImageModel::FromImageSkia(image));
|
||||
- }
|
||||
}
|
||||
|
||||
void OmniboxMatchCellView::ClearIcon() {
|
||||
@@ -590,7 +554,7 @@ gfx::Size OmniboxMatchCellView::Calculat
|
||||
} else if (layout_style_ == LayoutStyle::IPH_SUGGESTION ||
|
||||
layout_style_ == LayoutStyle::TOOLBELT) {
|
||||
// IPH and toolbelt suggestions have extra height.
|
||||
@@ -115,7 +174,7 @@
|
||||
} else {
|
||||
// The height for traditional 1-line matches.
|
||||
height = kRowHeight;
|
||||
@@ -611,7 +611,7 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
@@ -611,7 +575,7 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
// not derived from other matches' `indent` below.
|
||||
if (layout_style_ == LayoutStyle::IPH_SUGGESTION ||
|
||||
layout_style_ == LayoutStyle::TOOLBELT) {
|
||||
@@ -124,7 +183,7 @@
|
||||
}
|
||||
|
||||
// The entity, answer, and icon images are horizontally centered within their
|
||||
@@ -622,7 +622,7 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
@@ -622,7 +586,7 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
// b) Entities, answers, and icons continue to be center-aligned.
|
||||
// c) Regardless of the state of those other features and their widths.
|
||||
// This applies to both touch-UI and non-touch-UI.
|
||||
@@ -133,15 +192,59 @@
|
||||
|
||||
indent += omnibox_feature_configs::AdjustOmniboxIndent()
|
||||
.Get()
|
||||
@@ -632,6 +632,8 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
@@ -632,51 +596,7 @@ int OmniboxMatchCellView::GetImageIndent
|
||||
}
|
||||
|
||||
int OmniboxMatchCellView::GetTextIndent() const {
|
||||
- // Text indent is added to the `OmniboxMatchCellView::GetInsets()`. It is not
|
||||
- // added to the image position & size.
|
||||
-
|
||||
- // Toolbelt layout is similar to IPH and has a custom indent.
|
||||
- if (layout_style_ == LayoutStyle::TOOLBELT) {
|
||||
- return kToolbeltTextInsetLeft;
|
||||
- }
|
||||
-
|
||||
- // Some IPH matches have no icons. They should be moved further left so the
|
||||
- // gap between the IPH background and the start of the IPH text isn't jarring.
|
||||
- // Non-IPH matches without icons (e.g. the 'no results found' tab match) don't
|
||||
- // want to apply this left shift because their text needs to align with the
|
||||
- // other matches' and the omnibox's texts. This number is independent of other
|
||||
- // layout numbers; i.e., it's not meant to align with other UI; it's just
|
||||
- // arbitrarily chosen by UX. Hence, it's not derived from other matches'
|
||||
- // `indent` below.
|
||||
- if (layout_style_ == LayoutStyle::IPH_SUGGESTION &&
|
||||
- icon_view_->GetPreferredSize() == gfx::Size{}) {
|
||||
- return kIphTextIndent;
|
||||
- }
|
||||
-
|
||||
- // Answers don't have an icon, and their text needs to line up with the icons
|
||||
- // of other suggestions, so they need a smaller indent.
|
||||
- if (layout_style_ == LayoutStyle::HISTORY_EMBEDDING_ANSWER) {
|
||||
- return 18;
|
||||
- }
|
||||
-
|
||||
- // For normal matches, the gap between the left edge of this view and the
|
||||
- // left edge of its favicon or answer image.
|
||||
- int indent = 52;
|
||||
-
|
||||
- indent += omnibox_feature_configs::AdjustOmniboxIndent()
|
||||
- .Get()
|
||||
- .match_text_indent_offset;
|
||||
-
|
||||
- if (layout_style_ == LayoutStyle::IPH_SUGGESTION) {
|
||||
- // The IPH row left inset is +`kIphOffset` from other suggestions, so the
|
||||
- // text indent should be -`kIphOffset` to keep the text aligned. IPH matches
|
||||
- // seem to have inner padding, so the gap between the left edge of this
|
||||
- // `OmniboxMatchCellView` and the IPH icon/text is actually larger than
|
||||
- // `indent`.
|
||||
- indent -= kIphOffset;
|
||||
- }
|
||||
-
|
||||
- return indent;
|
||||
+ return 30;
|
||||
+
|
||||
// Text indent is added to the `OmniboxMatchCellView::GetInsets()`. It is not
|
||||
// added to the image position & size.
|
||||
}
|
||||
|
||||
void OmniboxMatchCellView::SetTailSuggestCommonPrefixWidth(
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h
|
||||
@@ -36,7 +36,7 @@ class OmniboxMatchCellView : public view
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
--- a/components/password_manager/core/browser/password_suggestion_generator.cc
|
||||
+++ b/components/password_manager/core/browser/password_suggestion_generator.cc
|
||||
@@ -397,6 +397,8 @@ PasswordSuggestionGenerator::PasswordSug
|
||||
@@ -397,6 +397,10 @@ PasswordSuggestionGenerator::PasswordSug
|
||||
|
||||
void PasswordSuggestionGenerator::AppendOptionalFooterSection(
|
||||
std::vector<autofill::Suggestion>* suggestions) const {
|
||||
+ return;
|
||||
+ if ((true)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
bool has_webauthn_credential = std::ranges::any_of(
|
||||
*suggestions,
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
@@ -91,7 +91,7 @@ class FrameGrabHandle : public views::Vi
|
||||
// is full.
|
||||
// TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-grab-handle")) return gfx::Size(0, 0);
|
||||
- return gfx::Size(42, 0);
|
||||
+ return gfx::Size(27, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -159,16 +159,19 @@
|
||||
group_color.value_or(tab_stroke_color));
|
||||
--- a/chrome/browser/ui/views/tabs/tab.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab.cc
|
||||
@@ -136,6 +136,8 @@ constexpr int kPinnedTabExtraWidthToRend
|
||||
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustmentTouchUI = 8;
|
||||
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustment = 4;
|
||||
@@ -131,10 +131,7 @@ namespace {
|
||||
// transitioning a tab from normal to pinned tab.
|
||||
constexpr int kPinnedTabExtraWidthToRenderAsNormal = 30;
|
||||
|
||||
-// Additional padding of close button to the right of the tab
|
||||
-// indicator when `extra_alert_indicator_padding_` is true.
|
||||
-constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustmentTouchUI = 8;
|
||||
-constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustment = 4;
|
||||
+constexpr int kIndicatorPadding = 2;
|
||||
+
|
||||
|
||||
bool g_show_hover_card_on_mouse_hover = true;
|
||||
|
||||
// Helper functions ------------------------------------------------------------
|
||||
@@ -445,19 +447,15 @@ void Tab::Layout(PassKey) {
|
||||
@@ -445,19 +442,15 @@ void Tab::Layout(PassKey) {
|
||||
}
|
||||
close_button_->SetVisible(showing_close_button_);
|
||||
|
||||
@@ -193,7 +196,7 @@
|
||||
contents_rect.y() + Center(contents_rect.height(), image_size.height()),
|
||||
image_size.width(), image_size.height());
|
||||
if (center_icon_) {
|
||||
@@ -468,6 +466,7 @@ void Tab::Layout(PassKey) {
|
||||
@@ -468,6 +461,7 @@ void Tab::Layout(PassKey) {
|
||||
MaybeAdjustLeftForPinnedTab(&bounds, bounds.width());
|
||||
}
|
||||
alert_indicator_button_->SetBoundsRect(bounds);
|
||||
@@ -201,7 +204,7 @@
|
||||
}
|
||||
alert_indicator_button_->UpdateAlertIndicatorAnimation();
|
||||
alert_indicator_button_->SetVisible(showing_alert_indicator_);
|
||||
@@ -476,7 +475,9 @@ void Tab::Layout(PassKey) {
|
||||
@@ -476,7 +470,9 @@ void Tab::Layout(PassKey) {
|
||||
bool show_title = ShouldRenderAsNormalTab();
|
||||
if (show_title) {
|
||||
int title_left = start;
|
||||
@@ -212,7 +215,7 @@
|
||||
// When computing the spacing from the favicon, don't count the actual
|
||||
// icon view width (which will include extra room for the alert
|
||||
// indicator), but rather the normal favicon width which is what it will
|
||||
@@ -487,9 +488,7 @@ void Tab::Layout(PassKey) {
|
||||
@@ -487,9 +483,7 @@ void Tab::Layout(PassKey) {
|
||||
title_left = std::max(title_left, after_favicon);
|
||||
}
|
||||
int title_right = contents_rect.right();
|
||||
@@ -223,7 +226,7 @@
|
||||
// Allow the title to overlay the close button's empty border padding.
|
||||
title_right = close_x - after_title_padding;
|
||||
}
|
||||
@@ -1174,7 +1173,7 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1174,7 +1168,7 @@ void Tab::UpdateIconVisibility() {
|
||||
const int close_button_width =
|
||||
GetLayoutConstant(LayoutConstant::kTabCloseButtonSize) +
|
||||
GetLayoutConstant(LayoutConstant::kTabAfterTitlePadding);
|
||||
@@ -232,7 +235,7 @@
|
||||
available_width >= (touch_ui ? kTouchMinimumContentsWidthForCloseButtons
|
||||
: kMinimumContentsWidthForCloseButtons);
|
||||
|
||||
@@ -1227,6 +1226,10 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1227,6 +1221,10 @@ void Tab::UpdateIconVisibility() {
|
||||
large_enough_for_close_button;
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-tab-close-buttons"))
|
||||
showing_close_button_ = false;
|
||||
@@ -243,7 +246,7 @@
|
||||
if (showing_close_button_) {
|
||||
available_width -= close_button_width;
|
||||
}
|
||||
@@ -1244,10 +1247,6 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1244,10 +1242,6 @@ void Tab::UpdateIconVisibility() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +257,7 @@
|
||||
}
|
||||
|
||||
bool Tab::ShouldRenderAsNormalTab() const {
|
||||
@@ -1267,15 +1266,29 @@ void Tab::UpdateTabIconAttention() {
|
||||
@@ -1267,15 +1261,29 @@ void Tab::UpdateTabIconAttention() {
|
||||
}
|
||||
|
||||
int Tab::GetWidthOfLargestSelectableRegion() const {
|
||||
@@ -306,15 +309,43 @@
|
||||
// Sets whether hover cards should appear on mouse hover. Used in browser
|
||||
--- a/chrome/browser/ui/views/tabs/tab_group_highlight.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_group_highlight.cc
|
||||
@@ -48,6 +48,8 @@ void TabGroupHighlight::OnPaint(gfx::Can
|
||||
@@ -48,35 +48,7 @@ void TabGroupHighlight::OnPaint(gfx::Can
|
||||
}
|
||||
|
||||
SkPath TabGroupHighlight::GetPath() const {
|
||||
- // This path imitates the shape of a tab (see GM2TabStyle::GetPath()). It
|
||||
- // doesn't reuse the exact same GetPath() function because it doesn't need
|
||||
- // much of the complexity there. Group highlights only appear on group drag,
|
||||
- // which is a well-scoped interaction. A dragging group doesn't nestle in with
|
||||
- // the tabs around it, so there are no special cases needed when determining
|
||||
- // its shape.
|
||||
- const int corner_radius = TabStyle::Get()->GetBottomCornerRadius();
|
||||
- const int top = GetLayoutConstant(LayoutConstant::kTabStripPadding);
|
||||
-
|
||||
- return SkPathBuilder()
|
||||
- .moveTo(0, bounds().height())
|
||||
- .arcTo(SkVector(corner_radius, corner_radius), 0,
|
||||
- SkPathBuilder::kSmall_ArcSize, SkPathDirection::kCCW,
|
||||
- SkPoint(corner_radius, bounds().height() - corner_radius))
|
||||
- .lineTo(corner_radius, top + corner_radius)
|
||||
- .arcTo(SkVector(corner_radius, corner_radius), 0,
|
||||
- SkPathBuilder::kSmall_ArcSize, SkPathDirection::kCW,
|
||||
- SkPoint(2 * corner_radius, top))
|
||||
- .lineTo(bounds().width() - 2 * corner_radius, top)
|
||||
- .arcTo(SkVector(corner_radius, corner_radius), 0,
|
||||
- SkPathBuilder::kSmall_ArcSize, SkPathDirection::kCW,
|
||||
- SkPoint(bounds().width() - corner_radius, top + corner_radius))
|
||||
- .lineTo(bounds().width() - corner_radius,
|
||||
- bounds().height() - corner_radius)
|
||||
- .arcTo(SkVector(corner_radius, corner_radius), 0,
|
||||
- SkPathBuilder::kSmall_ArcSize, SkPathDirection::kCCW,
|
||||
- SkPoint(bounds().width(), bounds().height()))
|
||||
- .close()
|
||||
- .detach();
|
||||
+ return {};
|
||||
+
|
||||
// This path imitates the shape of a tab (see GM2TabStyle::GetPath()). It
|
||||
// doesn't reuse the exact same GetPath() function because it doesn't need
|
||||
// much of the complexity there. Group highlights only appear on group drag,
|
||||
}
|
||||
|
||||
BEGIN_METADATA(TabGroupHighlight)
|
||||
--- a/chrome/browser/ui/views/tabs/tab/tab_close_button.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab/tab_close_button.cc
|
||||
@@ -49,6 +49,8 @@ gfx::Size GetButtonSize() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1348,6 +1348,30 @@ inline constexpr char kSplitViewDragAndD
|
||||
@@ -1349,6 +1349,30 @@ inline constexpr char kSplitViewDragAndD
|
||||
inline constexpr char kSplitViewDragAndDropNudgeUsedCount[] =
|
||||
"browser.split_view_drag_and_drop_nudge_used_count";
|
||||
|
||||
|
||||
+10
-2
@@ -75,7 +75,6 @@ ungoogled-chromium/add-flag-to-convert-popups-to-tabs.patch
|
||||
ungoogled-chromium/add-flag-to-disable-local-history-expiration.patch
|
||||
ungoogled-chromium/prepopulated-search-engines.patch
|
||||
ungoogled-chromium/add-flag-to-clear-data-on-exit.patch
|
||||
ungoogled-chromium/add-flag-for-grab-handle.patch
|
||||
ungoogled-chromium/add-flag-for-close-confirmation.patch
|
||||
ungoogled-chromium/add-flag-for-custom-ntp.patch
|
||||
ungoogled-chromium/add-flag-for-tab-hover-cards.patch
|
||||
@@ -258,7 +257,6 @@ helium/ui/profile-customization-cleanup.patch
|
||||
helium/ui/bangs-ui.patch
|
||||
helium/ui/thinner-infobar.patch
|
||||
helium/ui/reduce-text-button-height.patch
|
||||
helium/ui/smaller-window-grab-handle.patch
|
||||
helium/ui/pwa-toolbar.patch
|
||||
helium/ui/remove-layout-separators.patch
|
||||
helium/ui/toolbar-background.patch
|
||||
@@ -279,10 +277,20 @@ helium/ui/layout/settings.patch
|
||||
helium/ui/layout/context-menu.patch
|
||||
helium/ui/layout/shortcuts.patch
|
||||
helium/ui/layout/centered-address-bar.patch
|
||||
helium/ui/layout/frame-grab-handle.patch
|
||||
helium/ui/layout/horizontal-tabs.patch
|
||||
helium/ui/layout/toolbar-layout.patch
|
||||
helium/ui/layout/minimal-location-bar.patch
|
||||
helium/ui/layout/dynamic.patch
|
||||
helium/ui/layout/compact.patch
|
||||
helium/ui/layout/vertical.patch
|
||||
helium/ui/layout/toolbar-actions.patch
|
||||
|
||||
helium/ui/pdf-viewer.patch
|
||||
helium/ui/hide-pip-live-caption-button.patch
|
||||
helium/ui/disable-ink-ripple-effect.patch
|
||||
helium/ui/dont-antialias-rects.patch
|
||||
|
||||
helium/ui/experiments/zen-mode-wiring.patch
|
||||
helium/ui/experiments/zen-caption-buttons.patch
|
||||
helium/ui/experiments/zen-mode.patch
|
||||
|
||||
@@ -179,10 +179,10 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -64,4 +64,8 @@
|
||||
"Remove Grab Handle",
|
||||
"Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
|
||||
@@ -60,4 +60,8 @@
|
||||
"Clear data on exit",
|
||||
"Clears all browsing data on exit. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
|
||||
+ {"close-confirmation",
|
||||
+ "Close Confirmation",
|
||||
+ "Show a warning prompt when closing the browser window. ungoogled-chromium flag",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -68,4 +68,8 @@
|
||||
@@ -64,4 +64,8 @@
|
||||
"Close Confirmation",
|
||||
"Show a warning prompt when closing the browser window. ungoogled-chromium flag",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kCloseConfirmation)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -88,4 +88,8 @@
|
||||
@@ -84,4 +84,8 @@
|
||||
"Custom HTTP Accept Header",
|
||||
"Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
|
||||
kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- a/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@@ -89,6 +90,7 @@ class FrameGrabHandle : public views::Vi
|
||||
// Reserve some space for the frame to be grabbed by, even if the tabstrip
|
||||
// is full.
|
||||
// TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-grab-handle")) return gfx::Size(0, 0);
|
||||
return gfx::Size(42, 0);
|
||||
}
|
||||
};
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -60,4 +60,8 @@
|
||||
"Clear data on exit",
|
||||
"Clears all browsing data on exit. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
|
||||
+ {"remove-grab-handle",
|
||||
+ "Remove Grab Handle",
|
||||
+ "Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -32,7 +32,7 @@
|
||||
substitutions["backgroundPosition"] = GetNewTabBackgroundPositionCSS(tp);
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -100,4 +100,8 @@
|
||||
@@ -96,4 +96,8 @@
|
||||
"Hide Fullscreen Exit UI",
|
||||
"Hides the \"X\" that appears when the mouse cursor is moved towards the top of the window in fullscreen mode. Additionally, this hides the \"Press F11 to exit full screen\" popup. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-fullscreen-exit-ui")},
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -72,4 +72,8 @@
|
||||
@@ -68,4 +68,8 @@
|
||||
"Custom New Tab Page",
|
||||
"Allows setting a custom URL for the new tab page. Value can be internal (e.g. `about:blank` or `chrome://new-tab-page`), external (e.g. `example.com`), or local (e.g. `file:///tmp/startpage.html`). This applies for incognito windows as well when not set to a `chrome://` internal page. ungoogled-chromium flag",
|
||||
kOsDesktop, ORIGIN_LIST_VALUE_TYPE("custom-ntp", "")},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -84,4 +84,8 @@
|
||||
@@ -80,4 +80,8 @@
|
||||
"Disable GREASE for TLS",
|
||||
"Turn off GREASE (Generate Random Extensions And Sustain Extensibility) for TLS connections. ungoogled-chromium flag.",
|
||||
kOsAll, SINGLE_VALUE_TYPE("disable-grease-tls")},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -80,4 +80,8 @@
|
||||
@@ -76,4 +76,8 @@
|
||||
"Hide tab close buttons",
|
||||
"Hides the close buttons on tabs. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-tab-close-buttons")},
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if (!toolbar_view_model_->HasAnyExtensions()) {
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -92,4 +92,8 @@
|
||||
@@ -88,4 +88,8 @@
|
||||
"Disable link drag",
|
||||
"Prevents dragging of links and selected text. ungoogled-chromium flag.",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kDisableLinkDrag)},
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
return !IsRunningInAppMode();
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -96,4 +96,8 @@
|
||||
@@ -92,4 +92,8 @@
|
||||
"Hide Extensions Menu",
|
||||
"Hides the extensions container. This includes the puzzle piece icon as well as any pinned extensions. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-extensions-menu")},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -76,4 +76,8 @@
|
||||
@@ -72,4 +72,8 @@
|
||||
"Tab Hover Cards",
|
||||
"Allows removing the tab hover cards or using a tooltip as a replacement. ungoogled-chromium flag.",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kTabHoverCards)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -132,4 +132,8 @@
|
||||
@@ -128,4 +128,8 @@
|
||||
"Spoof WebGL Info",
|
||||
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -116,4 +116,8 @@
|
||||
@@ -112,4 +112,8 @@
|
||||
"Minimal Referrers",
|
||||
"Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than remove-cross-origin-referrers. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(network::features::kMinimalReferrers)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -120,4 +120,8 @@
|
||||
@@ -116,4 +116,8 @@
|
||||
"Reduced System Info",
|
||||
"Reduces the amount of system information obatainable through headers and javascript, also causes hardwareConcurrency to respond with two cores. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kReducedSystemInfo)},
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -128,4 +128,8 @@
|
||||
@@ -124,4 +124,8 @@
|
||||
"Enforce Certificate Transparency",
|
||||
"Enforce Certificate Transparency for certificates that sites present. This is enabled by default. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(features::kCertificateTransparencyAskBeforeEnabling)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -104,4 +104,16 @@
|
||||
@@ -100,4 +100,16 @@
|
||||
"Enable themes in Incognito mode",
|
||||
"Allows themes to override Google's built-in Incognito theming. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("enable-incognito-themes")},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -124,4 +124,8 @@
|
||||
@@ -120,4 +120,8 @@
|
||||
"Remove Client Hints",
|
||||
"Removes client hints (information sent to servers about your system, similar to a user agent). ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kRemoveClientHints)},
|
||||
|
||||
@@ -204,6 +204,9 @@ components/domain_reliability/baked_in_configs/gvt2_com.json
|
||||
components/domain_reliability/baked_in_configs/gvt6_com.json
|
||||
components/domain_reliability/baked_in_configs/ssl_gstatic_com.json
|
||||
components/domain_reliability/baked_in_configs/www_google_com.json
|
||||
components/helium_onboarding/node_modules/@esbuild/android-arm/esbuild.wasm
|
||||
components/helium_onboarding/node_modules/@esbuild/android-x64/esbuild.wasm
|
||||
components/helium_onboarding/node_modules/@esbuild/openharmony-arm64/esbuild.wasm
|
||||
components/media_router/common/providers/cast/channel/fuzz_corpus/cast_message0
|
||||
components/media_router/common/providers/cast/channel/fuzz_corpus/cast_message1
|
||||
components/media_router/common/providers/cast/channel/fuzz_corpus/cast_message2
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
8
|
||||
9
|
||||
|
||||
Reference in New Issue
Block a user