2024-11-24 17:56:35 -03:00
|
|
|
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
2024-11-26 18:29:33 -03:00
|
|
|
index 9247e9b3f4c92..eacd7f76564df 100644
|
2024-11-24 17:56:35 -03:00
|
|
|
--- a/base/BUILD.gn
|
|
|
|
+++ b/base/BUILD.gn
|
2024-11-26 18:29:33 -03:00
|
|
|
@@ -1085,6 +1085,7 @@ component("base") {
|
|
|
|
"//build:chromecast_buildflags",
|
|
|
|
"//build:chromeos_buildflags",
|
|
|
|
"//third_party/abseil-cpp:absl",
|
|
|
|
+ "//ui/base:buildflags",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (build_rust_base_conversions) {
|
|
|
|
@@ -2532,6 +2533,7 @@ buildflag_header("debugging_buildflags") {
|
2024-11-24 17:56:35 -03:00
|
|
|
"ENABLE_ALLOCATION_STACK_TRACE_RECORDER=$build_allocation_stack_trace_recorder",
|
|
|
|
"ENABLE_ALLOCATION_TRACE_RECORDER_FULL_REPORTING=$build_allocation_trace_recorder_full_reporting",
|
|
|
|
"PRINT_UNSYMBOLIZED_STACK_TRACES=$print_unsymbolized_stack_traces",
|
|
|
|
+ "THORIUM_DEBUG=$thorium_debug",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2024-11-19 13:58:44 -03:00
|
|
|
diff --git a/base/check.cc b/base/check.cc
|
2024-11-24 17:56:35 -03:00
|
|
|
index bd63d5a88e34e..1bed253cb50ee 100644
|
2024-11-19 13:58:44 -03:00
|
|
|
--- a/base/check.cc
|
|
|
|
+++ b/base/check.cc
|
|
|
|
@@ -323,6 +323,7 @@ std::ostream& CheckError::stream() {
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckError::~CheckError() {
|
2024-11-24 17:56:35 -03:00
|
|
|
+#if !BUILDFLAG(THORIUM_DEBUG)
|
2024-11-19 13:58:44 -03:00
|
|
|
// TODO(crbug.com/40254046): Consider splitting out CHECK from DCHECK so that
|
|
|
|
// the destructor can be marked [[noreturn]] and we don't need to check
|
|
|
|
// severity in the destructor.
|
|
|
|
@@ -340,6 +341,7 @@ CheckError::~CheckError() {
|
|
|
|
if (is_fatal) {
|
|
|
|
base::ImmediateCrash();
|
|
|
|
}
|
2024-11-24 17:56:35 -03:00
|
|
|
+#endif // !BUILDFLAG(THORIUM_DEBUG)
|
2024-11-19 13:58:44 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
CheckError::CheckError(LogMessage* log_message) : log_message_(log_message) {}
|
2024-11-24 17:56:35 -03:00
|
|
|
diff --git a/base/debug/debug.gni b/base/debug/debug.gni
|
|
|
|
index 1d236d210a16f..b5059c81559ec 100644
|
|
|
|
--- a/base/debug/debug.gni
|
|
|
|
+++ b/base/debug/debug.gni
|
|
|
|
@@ -26,6 +26,13 @@ declare_args() {
|
|
|
|
# Even if it's disabled we still collect some data, i.e. total number of
|
|
|
|
# allocations. All other data will be set to a default value.
|
|
|
|
build_allocation_trace_recorder_full_reporting = false
|
|
|
|
+
|
|
|
|
+ # A special build flag for the Thorium debug builds.
|
|
|
|
+ #
|
|
|
|
+ # This enables stack traces in logs and non-fatalizes DCHECKs.
|
|
|
|
+ # Ultimately, it should help users collect necessary data for browser issues
|
|
|
|
+ # without setting up a dedicated debugger.
|
|
|
|
+ thorium_debug = is_debug
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(!(build_allocation_stack_trace_recorder && is_fuchsia),
|
|
|
|
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc
|
|
|
|
index 7cda11126e61e..fe82b35a1a5d1 100644
|
|
|
|
--- a/base/files/file_util_win.cc
|
|
|
|
+++ b/base/files/file_util_win.cc
|
|
|
|
@@ -883,8 +883,9 @@ bool IsLink(const FilePath& file_path) {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GetFileInfo(const FilePath& file_path, File::Info* results) {
|
|
|
|
+#if !BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
ScopedBlockingCall scoped_blocking_call(FROM_HERE, BlockingType::MAY_BLOCK);
|
|
|
|
-
|
|
|
|
+#endif
|
|
|
|
WIN32_FILE_ATTRIBUTE_DATA attr;
|
|
|
|
if (!GetFileAttributesEx(file_path.value().c_str(), GetFileExInfoStandard,
|
|
|
|
&attr)) {
|
2024-11-19 13:58:44 -03:00
|
|
|
diff --git a/base/logging.cc b/base/logging.cc
|
2024-11-26 17:24:55 -03:00
|
|
|
index 0d93ca4713624..3815fe60b4776 100644
|
2024-11-19 13:58:44 -03:00
|
|
|
--- a/base/logging.cc
|
|
|
|
+++ b/base/logging.cc
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -8,6 +8,7 @@
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "base/logging.h"
|
|
|
|
+#include "base/environment.h"
|
|
|
|
|
|
|
|
#ifdef BASE_CHECK_H_
|
|
|
|
#error "logging.h should not include check.h"
|
|
|
|
@@ -62,6 +63,7 @@
|
2024-11-25 13:25:03 -03:00
|
|
|
#include "build/chromeos_buildflags.h"
|
|
|
|
#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h"
|
|
|
|
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
|
|
|
|
#if !BUILDFLAG(IS_NACL)
|
|
|
|
#include "base/auto_reset.h"
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -457,6 +459,7 @@ void WriteToFd(int fd, const char* data, size_t length) {
|
2024-11-24 17:56:35 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
void SetLogFatalCrashKey(LogMessage* log_message) {
|
|
|
|
#if !BUILDFLAG(IS_NACL)
|
|
|
|
// In case of an out-of-memory condition, this code could be reentered when
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -477,6 +480,7 @@ void SetLogFatalCrashKey(LogMessage* log_message) {
|
2024-11-24 17:56:35 -03:00
|
|
|
|
|
|
|
#endif // !BUILDFLAG(IS_NACL)
|
|
|
|
}
|
|
|
|
+#endif
|
2024-11-19 13:58:44 -03:00
|
|
|
|
2024-11-24 17:56:35 -03:00
|
|
|
std::string BuildCrashString(const char* file,
|
|
|
|
int line,
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -585,9 +589,24 @@ int GetMinLogLevel() {
|
|
|
|
return g_min_log_level;
|
2024-11-24 17:56:35 -03:00
|
|
|
}
|
|
|
|
|
2024-11-26 17:24:55 -03:00
|
|
|
+bool IsVerbose() {
|
|
|
|
+ const char* const env = getenv("THORIUM_DEBUG");
|
|
|
|
+ const std::string_view env_str =
|
|
|
|
+ env ? std::string_view(env) : std::string_view();
|
|
|
|
+ if (env_str == "1" || env_str == "true") {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
2024-11-24 17:56:35 -03:00
|
|
|
bool ShouldCreateLogMessage(int severity) {
|
|
|
|
- if (severity < g_min_log_level)
|
|
|
|
+ if (severity < g_min_log_level) {
|
|
|
|
return false;
|
|
|
|
+ }
|
2024-11-26 17:24:55 -03:00
|
|
|
+ if (IsVerbose()) {
|
2024-11-19 13:58:44 -03:00
|
|
|
+ return true;
|
|
|
|
+ }
|
2024-11-24 17:56:35 -03:00
|
|
|
|
2024-11-19 13:58:44 -03:00
|
|
|
// Return true here unless we know ~LogMessage won't do anything.
|
|
|
|
return g_logging_destination != LOG_NONE || g_log_message_handler ||
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -599,8 +618,12 @@ bool ShouldCreateLogMessage(int severity) {
|
2024-11-24 17:56:35 -03:00
|
|
|
// set, or only LOG_TO_FILE is set, since that is useful for local development
|
|
|
|
// and debugging.
|
|
|
|
bool ShouldLogToStderr(int severity) {
|
|
|
|
- if (g_logging_destination & LOG_TO_STDERR)
|
|
|
|
+ if (g_logging_destination & LOG_TO_STDERR) {
|
2024-11-19 13:58:44 -03:00
|
|
|
+ return true;
|
2024-11-26 17:24:55 -03:00
|
|
|
+ }
|
|
|
|
+ if (IsVerbose()) {
|
|
|
|
return true;
|
2024-11-19 13:58:44 -03:00
|
|
|
+ }
|
2024-11-24 17:56:35 -03:00
|
|
|
|
2024-11-19 13:58:44 -03:00
|
|
|
#if BUILDFLAG(IS_FUCHSIA)
|
|
|
|
// Fuchsia will persist data logged to stdio by a component, so do not emit
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -731,9 +754,11 @@ void LogMessage::Flush() {
|
2024-11-24 17:56:35 -03:00
|
|
|
// Don't let actions from this method affect the system error after returning.
|
|
|
|
base::ScopedClearLastError scoped_clear_last_error;
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
size_t stack_start = stream_.str().length();
|
|
|
|
+#endif
|
|
|
|
#if !defined(OFFICIAL_BUILD) && !BUILDFLAG(IS_NACL) && !defined(__UCLIBC__) && \
|
|
|
|
- !BUILDFLAG(IS_AIX)
|
|
|
|
+ !BUILDFLAG(IS_AIX) || BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
// Include a stack trace on a fatal, unless a debugger is attached.
|
|
|
|
if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
|
|
|
|
base::debug::StackTrace stack_trace;
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -766,6 +791,7 @@ void LogMessage::Flush() {
|
2024-11-24 17:56:35 -03:00
|
|
|
std::string str_newline(stream_.str());
|
|
|
|
TraceLogMessage(file_, line_, str_newline.substr(message_start_));
|
|
|
|
|
|
|
|
+#if !BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
// FATAL messages should always run the assert handler and crash, even if a
|
|
|
|
// message handler marks them as otherwise handled.
|
|
|
|
absl::Cleanup handle_fatal_message = [&] {
|
2024-11-26 17:24:55 -03:00
|
|
|
@@ -776,6 +802,7 @@ void LogMessage::Flush() {
|
2024-11-24 17:56:35 -03:00
|
|
|
|
|
|
|
if (severity_ == LOGGING_FATAL)
|
|
|
|
SetLogFatalCrashKey(this);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Give any log message handler first dibs on the message.
|
|
|
|
if (g_log_message_handler &&
|
2024-11-26 17:24:55 -03:00
|
|
|
diff --git a/base/logging.h b/base/logging.h
|
|
|
|
index fe2ce670da340..82bbda21a16e5 100644
|
|
|
|
--- a/base/logging.h
|
|
|
|
+++ b/base/logging.h
|
|
|
|
@@ -301,6 +301,9 @@ BASE_EXPORT void SetMinLogLevel(int level);
|
|
|
|
// Gets the current log level.
|
|
|
|
BASE_EXPORT int GetMinLogLevel();
|
|
|
|
|
|
|
|
+// Whether to always log in verbose mode
|
|
|
|
+BASE_EXPORT bool IsVerbose();
|
|
|
|
+
|
|
|
|
// Used by LOG_IS_ON to lazy-evaluate stream arguments.
|
|
|
|
BASE_EXPORT bool ShouldCreateLogMessage(int severity);
|
|
|
|
|
2024-11-12 23:55:35 -03:00
|
|
|
diff --git a/chrome/browser/extensions/api/messaging/launch_context_win.cc b/chrome/browser/extensions/api/messaging/launch_context_win.cc
|
|
|
|
index b103bbe61303d..469611cb36e7a 100644
|
|
|
|
--- a/chrome/browser/extensions/api/messaging/launch_context_win.cc
|
|
|
|
+++ b/chrome/browser/extensions/api/messaging/launch_context_win.cc
|
|
|
|
@@ -62,7 +62,7 @@ bool GetManifestPathWithFlags(HKEY root_key,
|
|
|
|
std::wstring* result) {
|
|
|
|
#if BUILDFLAG(CHROMIUM_BRANDING)
|
|
|
|
static constexpr wchar_t kChromiumNativeMessagingRegistryKey[] =
|
|
|
|
- L"SOFTWARE\\Chromium\\NativeMessagingHosts";
|
|
|
|
+ L"SOFTWARE\\Thorium\\NativeMessagingHosts";
|
|
|
|
|
|
|
|
// Try to read the path using the Chromium-specific registry for Chromium.
|
|
|
|
// If that fails, fallback to Chrome-specific registry key below.
|
2024-11-18 06:48:10 -03:00
|
|
|
diff --git a/chrome/browser/resources/downloads/item.html.ts b/chrome/browser/resources/downloads/item.html.ts
|
|
|
|
index 1e0f2c895d708..64347e17d7e42 100644
|
|
|
|
--- a/chrome/browser/resources/downloads/item.html.ts
|
|
|
|
+++ b/chrome/browser/resources/downloads/item.html.ts
|
|
|
|
@@ -47,7 +47,7 @@ export function getHtml(this: DownloadsItemElement) {
|
|
|
|
?hidden="${!this.shouldShowReferrerUrl_()}">
|
2024-10-27 16:34:01 -03:00
|
|
|
<!-- Text populated dynamically -->
|
|
|
|
</div>
|
2024-11-18 06:48:10 -03:00
|
|
|
- <a id="url" ?hidden="${this.showReferrerUrl_}" target="_blank"
|
2024-10-27 16:34:01 -03:00
|
|
|
+ <a id="url" target="_blank"
|
2024-11-18 06:48:10 -03:00
|
|
|
@click="${this.onUrlClick_}" focus-row-control
|
|
|
|
focus-type="url">${this.getDisplayUrlStr_()}</a>
|
2024-10-27 16:34:01 -03:00
|
|
|
</div>
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -94,7 +94,6 @@ export function getHtml(this: DownloadsItemElement) {
|
|
|
|
focus-row-control focus-type="copyDownloadLink">
|
|
|
|
</cr-icon-button>
|
2024-11-12 23:55:35 -03:00
|
|
|
<cr-icon-button id="more-actions" iron-icon="cr:more-vert"
|
2024-11-18 06:48:10 -03:00
|
|
|
- ?hidden="${!this.computeShowActionMenu_()}"
|
2024-11-12 23:55:35 -03:00
|
|
|
class="dropdown-trigger" title="$i18n{moreActions}"
|
2024-11-18 06:48:10 -03:00
|
|
|
@click="${this.onMoreActionsClick_}" aria-haspopup="menu"
|
2024-11-12 23:55:35 -03:00
|
|
|
focus-row-control focus-type="actionMenuButton">
|
|
|
|
diff --git a/chrome/browser/resources/pdf/manifest.json b/chrome/browser/resources/pdf/manifest.json
|
|
|
|
index f355f92ac2f37..e0b69081164fd 100644
|
|
|
|
--- a/chrome/browser/resources/pdf/manifest.json
|
|
|
|
+++ b/chrome/browser/resources/pdf/manifest.json
|
|
|
|
@@ -3,8 +3,8 @@
|
|
|
|
"manifest_version": 2,
|
|
|
|
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDN6hM0rsDYGbzQPQfOygqlRtQgKUXMfnSjhIBL7LnReAVBEd7ZmKtyN2qmSasMl4HZpMhVe2rPWVVwBDl6iyNE/Kok6E6v6V3vCLGsOpQAuuNVye/3QxzIldzG/jQAdWZiyXReRVapOhZtLjGfywCvlWq7Sl/e3sbc0vWybSDI2QIDAQAB",
|
|
|
|
"name": "<NAME>",
|
|
|
|
- "version": "1",
|
|
|
|
- "description": "",
|
|
|
|
+ "version": "1.0.1",
|
|
|
|
+ "description": "Internal Component Extension for rendering PDFs.",
|
|
|
|
"offline_enabled": true,
|
|
|
|
"incognito": "split",
|
|
|
|
"permissions": [
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
2024-11-19 13:58:44 -03:00
|
|
|
index 40c586fb4f715..9bc0ea94e459a 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/browser/search/search.cc
|
|
|
|
+++ b/chrome/browser/search/search.cc
|
2024-11-19 13:58:44 -03:00
|
|
|
@@ -95,17 +95,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)) {
|
|
|
|
@@ -142,21 +131,6 @@ bool IsNTPOrRelatedURLHelper(const GURL& url, Profile* profile) {
|
|
|
|
IsMatchingServiceWorker(url, new_tab_url));
|
|
|
|
}
|
|
|
|
|
|
|
|
-bool IsURLAllowedForSupervisedUser(const GURL& url, Profile& profile) {
|
|
|
|
- if (!profile.IsChild()) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- supervised_user::SupervisedUserService* supervised_user_service =
|
|
|
|
- SupervisedUserServiceFactory::GetForProfile(&profile);
|
|
|
|
- supervised_user::SupervisedUserURLFilter* url_filter =
|
|
|
|
- supervised_user_service->GetURLFilter();
|
|
|
|
- if (url_filter->GetFilteringBehaviorForURL(url) ==
|
|
|
|
- supervised_user::FilteringBehavior::kBlock) {
|
|
|
|
- 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 {
|
|
|
|
@@ -179,33 +153,9 @@ struct NewTabURLDetails {
|
2024-10-03 08:24:53 -03:00
|
|
|
const GURL local_url(default_is_google
|
|
|
|
? chrome::kChromeUINewTabPageURL
|
|
|
|
: chrome::kChromeUINewTabPageThirdPartyURL);
|
|
|
|
- if (default_is_google) {
|
|
|
|
- return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
|
|
|
- }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
- const TemplateURL* template_url =
|
|
|
|
- GetDefaultSearchProviderTemplateURL(profile);
|
|
|
|
- if (!profile || !template_url) {
|
|
|
|
- return NewTabURLDetails(local_url, NEW_TAB_URL_BAD);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- GURL search_provider_url(template_url->new_tab_url_ref().ReplaceSearchTerms(
|
|
|
|
- TemplateURLRef::SearchTermsArgs(std::u16string()),
|
|
|
|
- UIThreadSearchTermsData()));
|
|
|
|
-
|
|
|
|
- if (!search_provider_url.is_valid()) {
|
|
|
|
- return NewTabURLDetails(local_url, NEW_TAB_URL_NOT_SET);
|
|
|
|
- }
|
|
|
|
- if (!search_provider_url.SchemeIsCryptographic()) {
|
|
|
|
- return NewTabURLDetails(local_url, NEW_TAB_URL_INSECURE);
|
|
|
|
- }
|
|
|
|
- if (!IsURLAllowedForSupervisedUser(search_provider_url,
|
|
|
|
- CHECK_DEREF(profile))) {
|
|
|
|
- return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);
|
|
|
|
+ return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
|
|
|
}
|
|
|
|
|
|
|
|
const GURL url;
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
|
2024-11-18 06:48:10 -03:00
|
|
|
index bc6e4008f2c5a..bd11ac01d442c 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/BUILD.gn
|
|
|
|
+++ b/chrome/browser/ui/BUILD.gn
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -4430,6 +4430,8 @@ static_library("ui") {
|
2024-11-18 05:04:15 -03:00
|
|
|
"views/frame/top_container_view.cc",
|
|
|
|
"views/frame/top_container_view.h",
|
|
|
|
"views/frame/top_controls_slide_controller.h",
|
|
|
|
+ "views/frame/window_caption_util.cc",
|
|
|
|
+ "views/frame/window_caption_util.h",
|
|
|
|
"views/frame/web_contents_close_handler.cc",
|
|
|
|
"views/frame/web_contents_close_handler.h",
|
|
|
|
"views/frame/web_contents_close_handler_delegate.h",
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils.cc b/chrome/browser/ui/bookmarks/bookmark_utils.cc
|
|
|
|
index e7858be996ca8..c0b2695b6e00b 100644
|
|
|
|
--- a/chrome/browser/ui/bookmarks/bookmark_utils.cc
|
|
|
|
+++ b/chrome/browser/ui/bookmarks/bookmark_utils.cc
|
|
|
|
@@ -318,8 +318,35 @@ ui::ImageModel GetBookmarkFolderIcon(
|
|
|
|
absl::variant<ui::ColorId, SkColor> color,
|
|
|
|
const ui::ColorProvider* color_provider) {
|
|
|
|
gfx::ImageSkia folder;
|
|
|
|
- folder =
|
|
|
|
- GetBookmarkFolderImageFromVectorIcon(icon_type, color, color_provider);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+#if BUILDFLAG(IS_WIN)
|
|
|
|
+ // TODO(bsep): vectorize the Windows versions: crbug.com/564112
|
|
|
|
+ folder = *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
|
|
|
|
+ default_id);
|
|
|
|
+#elif BUILDFLAG(IS_MAC)
|
|
|
|
+ SkColor sk_color;
|
|
|
|
+ if (absl::holds_alternative<SkColor>(color)) {
|
|
|
|
+ sk_color = absl::get<SkColor>(color);
|
|
|
|
+ } else {
|
|
|
|
+ DCHECK(color_provider);
|
|
|
|
+ sk_color = color_provider->GetColor(absl::get<ui::ColorId>(color));
|
|
|
|
+ }
|
|
|
|
+ const int white_id = (icon_type == BookmarkFolderIconType::kNormal)
|
|
|
|
+ ? IDR_FOLDER_CLOSED_WHITE
|
|
|
|
+ : IDR_BOOKMARK_BAR_FOLDER_MANAGED_WHITE;
|
|
|
|
+ const int resource_id =
|
|
|
|
+ color_utils::IsDark(sk_color) ? default_id : white_id;
|
|
|
|
+ folder = *ui::ResourceBundle::GetSharedInstance()
|
|
|
|
+ .GetNativeImageNamed(resource_id)
|
|
|
|
+ .ToImageSkia();
|
|
|
|
+#else
|
|
|
|
+ folder = GetBookmarkFolderImageFromVectorIcon(icon_type, color,
|
|
|
|
+ color_provider);
|
|
|
|
+#endif
|
|
|
|
+ } else {
|
|
|
|
+ folder =
|
|
|
|
+ GetBookmarkFolderImageFromVectorIcon(icon_type, color, color_provider);
|
|
|
|
+ }
|
|
|
|
return gfx::ImageSkia(std::make_unique<RTLFlipSource>(folder),
|
|
|
|
folder.size());
|
|
|
|
};
|
2024-09-20 19:45:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
|
|
index 64948595a4bc6..a568c893736ca 100644
|
|
|
|
--- a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
|
|
+++ b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
|
|
|
|
@@ -47,7 +47,7 @@ using bookmarks::BookmarkNode;
|
|
|
|
|
|
|
|
namespace chrome {
|
|
|
|
|
|
|
|
-size_t kNumBookmarkUrlsBeforePrompting = 15;
|
|
|
|
+size_t kNumBookmarkUrlsBeforePrompting = 50;
|
|
|
|
|
|
|
|
static BookmarkNavigationWrapper* g_nav_wrapper_test_instance = nullptr;
|
|
|
|
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
|
|
|
|
index 71f9d6ad07da0..246532a09797a 100644
|
|
|
|
--- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
|
|
|
|
+++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
|
|
|
|
@@ -133,10 +133,6 @@ std::optional<size_t> RecentlyUsedFoldersComboModel::GetDefaultIndex() const {
|
|
|
|
// TODO(pbos): Look at returning -1 here if there's no default index. Right
|
|
|
|
// now a lot of code in Combobox assumes an index within `items_` bounds.
|
|
|
|
auto it = base::ranges::find(items_, Item(parent_node_, Item::TYPE_NODE));
|
|
|
|
- if (it == items_.end()) {
|
|
|
|
- it = base::ranges::find(items_,
|
|
|
|
- Item(parent_node_, Item::TYPE_ALL_BOOKMARKS_NODE));
|
|
|
|
- }
|
|
|
|
return it == items_.end() ? 0 : static_cast<int>(it - items_.begin());
|
|
|
|
}
|
|
|
|
|
2024-11-25 13:25:03 -03:00
|
|
|
diff --git a/chrome/browser/ui/browser_actions.cc b/chrome/browser/ui/browser_actions.cc
|
|
|
|
index d65691f1aa1a5..da4fff1f928f7 100644
|
|
|
|
--- a/chrome/browser/ui/browser_actions.cc
|
|
|
|
+++ b/chrome/browser/ui/browser_actions.cc
|
|
|
|
@@ -9,6 +9,7 @@
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "base/check_op.h"
|
|
|
|
+#include "base/command_line.h"
|
|
|
|
#include "chrome/app/vector_icons/vector_icons.h"
|
|
|
|
#include "chrome/browser/devtools/devtools_window.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
|
|
|
@@ -410,6 +411,8 @@ void BrowserActions::InitializeBrowserActions() {
|
|
|
|
if (IsChromeLabsEnabled()) {
|
|
|
|
// TODO(b/354758327): Update `ShouldShowChromeLabsUI()` to not require
|
|
|
|
// `model` as a parameter, then use to set visibility of action item.
|
|
|
|
+ static const bool disable_thorium_icons =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
|
|
|
|
root_action_item_->AddChild(
|
|
|
|
ChromeMenuAction(base::BindRepeating(
|
|
|
|
[](Browser* browser, actions::ActionItem* item,
|
|
|
|
@@ -418,7 +421,9 @@ void BrowserActions::InitializeBrowserActions() {
|
|
|
|
},
|
|
|
|
base::Unretained(browser)),
|
|
|
|
kActionShowChromeLabs, IDS_CHROMELABS,
|
|
|
|
- IDS_CHROMELABS, kScienceIcon)
|
|
|
|
+ IDS_CHROMELABS, disable_thorium_icons
|
|
|
|
+ ? kScienceIcon
|
|
|
|
+ : kScienceThoriumIcon)
|
|
|
|
.SetVisible(false)
|
|
|
|
.Build());
|
|
|
|
}
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 86af74569f013..1f9cc1696eda4 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/browser/ui/browser_command_controller.cc
|
|
|
|
+++ b/chrome/browser/ui/browser_command_controller.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -1423,7 +1423,8 @@ void BrowserCommandController::InitCommandState() {
|
2024-10-03 08:24:53 -03:00
|
|
|
command_updater_.UpdateCommandEnabled(IDC_WINDOW_CLOSE_OTHER_TABS,
|
|
|
|
normal_window);
|
|
|
|
|
|
|
|
- const bool enable_tab_search_commands = browser_->is_type_normal();
|
|
|
|
+ const bool enable_tab_search_commands = browser_->is_type_normal() &&
|
|
|
|
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
|
|
|
|
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH,
|
|
|
|
enable_tab_search_commands);
|
|
|
|
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH_CLOSE,
|
2024-11-19 13:58:44 -03:00
|
|
|
diff --git a/chrome/browser/ui/color/chrome_color_mixer.cc b/chrome/browser/ui/color/chrome_color_mixer.cc
|
|
|
|
index 589c77c52175b..e408764fc6aae 100644
|
|
|
|
--- a/chrome/browser/ui/color/chrome_color_mixer.cc
|
|
|
|
+++ b/chrome/browser/ui/color/chrome_color_mixer.cc
|
|
|
|
@@ -748,8 +748,7 @@ void AddChromeColorMixer(ui::ColorProvider* provider,
|
|
|
|
ui::SetAlpha(kColorToolbarInkDrop, std::ceil(0.06f * 255.0f));
|
|
|
|
mixer[kColorAppMenuChipInkDropHover] = {kColorToolbarInkDropHover};
|
|
|
|
mixer[kColorAppMenuChipInkDropRipple] = {kColorToolbarInkDropRipple};
|
|
|
|
- mixer[kColorToolbarExtensionSeparatorEnabled] = {
|
|
|
|
- kColorTabBackgroundInactiveFrameActive};
|
|
|
|
+ mixer[kColorToolbarExtensionSeparatorEnabled] = {ui::kColorSysDivider};
|
|
|
|
mixer[kColorToolbarExtensionSeparatorDisabled] = {
|
|
|
|
kColorToolbarButtonIconInactive};
|
|
|
|
mixer[kColorToolbarSeparator] = {kColorToolbarSeparatorDefault};
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/color/chrome_color_mixers.cc b/chrome/browser/ui/color/chrome_color_mixers.cc
|
|
|
|
index 9698e807b11df..8bb6a245caeba 100644
|
|
|
|
--- a/chrome/browser/ui/color/chrome_color_mixers.cc
|
|
|
|
+++ b/chrome/browser/ui/color/chrome_color_mixers.cc
|
|
|
|
@@ -22,6 +22,7 @@
|
|
|
|
#include "chrome/browser/ui/color/omnibox_color_mixer.h"
|
|
|
|
#include "chrome/browser/ui/color/product_specifications_color_mixer.h"
|
|
|
|
#include "chrome/browser/ui/color/tab_strip_color_mixer.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/color/color_provider_utils.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
@@ -59,20 +60,38 @@ void AddChromeColorMixers(ui::ColorProvider* provider,
|
|
|
|
chrome_color_provider_utils_callbacks;
|
|
|
|
ui::SetColorProviderUtilsCallbacks(
|
|
|
|
chrome_color_provider_utils_callbacks.get());
|
|
|
|
- AddChromeColorMixer(provider, key);
|
|
|
|
- AddNewTabPageColorMixer(provider, key);
|
|
|
|
- AddOmniboxColorMixer(provider, key);
|
|
|
|
- AddProductSpecificationsColorMixer(provider, key);
|
|
|
|
- AddTabStripColorMixer(provider, key);
|
|
|
|
-
|
|
|
|
- AddMaterialChromeColorMixer(provider, key);
|
|
|
|
- AddMaterialNewTabPageColorMixer(provider, key);
|
|
|
|
- AddMaterialOmniboxColorMixer(provider, key);
|
|
|
|
- AddMaterialSidePanelColorMixer(provider, key);
|
|
|
|
- AddMaterialTabStripColorMixer(provider, key);
|
|
|
|
-
|
|
|
|
- // Must be the last one in order to override other mixer colors.
|
|
|
|
- AddNativeChromeColorMixer(provider, key);
|
|
|
|
+
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ AddMaterialChromeColorMixer(provider, key);
|
|
|
|
+ AddMaterialNewTabPageColorMixer(provider, key);
|
|
|
|
+ AddMaterialOmniboxColorMixer(provider, key);
|
|
|
|
+ AddMaterialSidePanelColorMixer(provider, key);
|
|
|
|
+ AddMaterialTabStripColorMixer(provider, key);
|
|
|
|
+
|
|
|
|
+ AddChromeColorMixer(provider, key);
|
|
|
|
+ AddNewTabPageColorMixer(provider, key);
|
|
|
|
+ AddOmniboxColorMixer(provider, key);
|
|
|
|
+ AddProductSpecificationsColorMixer(provider, key);
|
|
|
|
+ AddTabStripColorMixer(provider, key);
|
|
|
|
+
|
|
|
|
+ // Must be the last one in order to override other mixer colors.
|
|
|
|
+ AddNativeChromeColorMixer(provider, key);
|
|
|
|
+ } else {
|
|
|
|
+ AddChromeColorMixer(provider, key);
|
|
|
|
+ AddNewTabPageColorMixer(provider, key);
|
|
|
|
+ AddOmniboxColorMixer(provider, key);
|
|
|
|
+ AddProductSpecificationsColorMixer(provider, key);
|
|
|
|
+ AddTabStripColorMixer(provider, key);
|
|
|
|
+
|
|
|
|
+ AddMaterialChromeColorMixer(provider, key);
|
|
|
|
+ AddMaterialNewTabPageColorMixer(provider, key);
|
|
|
|
+ AddMaterialOmniboxColorMixer(provider, key);
|
|
|
|
+ AddMaterialSidePanelColorMixer(provider, key);
|
|
|
|
+ AddMaterialTabStripColorMixer(provider, key);
|
|
|
|
+
|
|
|
|
+ // Must be the last one in order to override other mixer colors.
|
|
|
|
+ AddNativeChromeColorMixer(provider, key);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (key.custom_theme) {
|
|
|
|
key.custom_theme->AddColorMixers(provider, key);
|
|
|
|
diff --git a/chrome/browser/ui/color/tab_strip_color_mixer.cc b/chrome/browser/ui/color/tab_strip_color_mixer.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 9faa599b47cc1..d683ac878cb0e 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/color/tab_strip_color_mixer.cc
|
|
|
|
+++ b/chrome/browser/ui/color/tab_strip_color_mixer.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -136,10 +136,7 @@ void AddTabStripColorMixer(ui::ColorProvider* provider,
|
2024-11-18 05:04:15 -03:00
|
|
|
// behavior. The main difference is that the tab hover color in GM2 depends on
|
|
|
|
// the tab width - narrower tabs have more opacity. We must chooses a single
|
|
|
|
// opacity, so we go with one towards the more opaque end of the GM2 range.
|
|
|
|
- mixer[kColorTabBackgroundInactiveHoverFrameActive] = {
|
|
|
|
- ui::AlphaBlend(kColorTabBackgroundActiveFrameActive,
|
|
|
|
- kColorTabBackgroundInactiveFrameActive,
|
|
|
|
- /* 40% opacity */ 0.4 * SK_AlphaOPAQUE)};
|
|
|
|
+ mixer[kColorTabBackgroundInactiveHoverFrameActive] = {ui::kColorSysStateHeaderHover};
|
|
|
|
mixer[kColorTabBackgroundInactiveHoverFrameInactive] = {
|
|
|
|
ui::AlphaBlend(kColorTabBackgroundActiveFrameInactive,
|
|
|
|
kColorTabBackgroundInactiveFrameInactive,
|
|
|
|
diff --git a/chrome/browser/ui/frame/window_frame_util.h b/chrome/browser/ui/frame/window_frame_util.h
|
|
|
|
index e4ccd7fab5421..0eadd6bdd8def 100644
|
|
|
|
--- a/chrome/browser/ui/frame/window_frame_util.h
|
|
|
|
+++ b/chrome/browser/ui/frame/window_frame_util.h
|
|
|
|
@@ -11,6 +11,8 @@ namespace gfx {
|
|
|
|
class Size;
|
|
|
|
}
|
|
|
|
|
|
|
|
+class Browser;
|
|
|
|
+
|
|
|
|
// Static-only class containing values and helper functions for frame classes
|
|
|
|
// that need to be accessible outside of /browser/ui/views.
|
|
|
|
class WindowFrameUtil {
|
2024-08-12 10:53:10 -04:00
|
|
|
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
|
2024-11-25 13:25:03 -03:00
|
|
|
index 87c4ee64068a6..9dd4397f0e88b 100644
|
2024-08-12 10:53:10 -04:00
|
|
|
--- a/chrome/browser/ui/layout_constants.cc
|
|
|
|
+++ b/chrome/browser/ui/layout_constants.cc
|
2024-09-24 07:56:24 -03:00
|
|
|
@@ -7,6 +7,7 @@
|
2024-08-12 10:53:10 -04:00
|
|
|
#include "base/feature_list.h"
|
|
|
|
#include "base/notreached.h"
|
|
|
|
#include "build/build_config.h"
|
2024-08-14 23:30:11 -04:00
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
2024-09-24 07:56:24 -03:00
|
|
|
#include "chrome/browser/ui/tabs/features.h"
|
2024-08-14 23:30:11 -04:00
|
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
|
|
#include "components/omnibox/common/omnibox_features.h"
|
2024-09-24 07:56:24 -03:00
|
|
|
@@ -22,20 +23,25 @@ int GetLayoutConstant(LayoutConstant constant) {
|
2024-08-23 18:57:48 -04:00
|
|
|
const bool touch_ui = ui::TouchUiController::Get()->touch_ui();
|
|
|
|
switch (constant) {
|
|
|
|
case APP_MENU_PROFILE_ROW_AVATAR_ICON_SIZE:
|
|
|
|
- return 24;
|
2024-09-01 14:15:48 -04:00
|
|
|
+ return features::IsThorium2024() ? 18 : 24;
|
2024-08-23 18:57:48 -04:00
|
|
|
case APP_MENU_MAXIMUM_CHARACTER_LENGTH:
|
|
|
|
return 30;
|
2024-08-12 10:53:10 -04:00
|
|
|
case BOOKMARK_BAR_HEIGHT: {
|
|
|
|
// The fixed margin ensures the bookmark buttons appear centered relative
|
|
|
|
// to the white space above and below.
|
2024-09-24 07:56:24 -03:00
|
|
|
- const int bookmark_bar_attached_vertical_margin = 6;
|
2024-09-24 23:18:15 -03:00
|
|
|
+ const int bookmark_bar_attached_vertical_margin = features::IsThorium2024() ? 3 : 6;
|
2024-08-12 10:53:10 -04:00
|
|
|
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
|
|
|
|
bookmark_bar_attached_vertical_margin;
|
|
|
|
}
|
2024-08-23 18:57:48 -04:00
|
|
|
- case BOOKMARK_BAR_BUTTON_HEIGHT:
|
|
|
|
- return touch_ui ? 36 : 28;
|
|
|
|
+ case BOOKMARK_BAR_BUTTON_HEIGHT: {
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return touch_ui ? 34 : 26;
|
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 36 : 28;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
case BOOKMARK_BAR_BUTTON_PADDING:
|
|
|
|
- return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
|
2024-09-24 23:18:15 -03:00
|
|
|
+ return features::IsThorium2024() ? 2 : GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
|
2024-08-23 18:57:48 -04:00
|
|
|
case BOOKMARK_BAR_BUTTON_IMAGE_LABEL_PADDING:
|
2024-09-24 07:56:24 -03:00
|
|
|
return 6;
|
2024-08-23 18:57:48 -04:00
|
|
|
case WEB_APP_MENU_BUTTON_SIZE:
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -68,11 +74,23 @@ int GetLayoutConstant(LayoutConstant constant) {
|
|
|
|
// here once we decide on a permutation.
|
|
|
|
NOTREACHED();
|
|
|
|
case LOCATION_BAR_TRAILING_DECORATION_EDGE_PADDING:
|
|
|
|
- return touch_ui ? 3 : 12;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return touch_ui ? 3 : 5;
|
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 3 : 12;
|
|
|
|
+ }
|
2024-11-18 05:04:15 -03:00
|
|
|
case LOCATION_BAR_TRAILING_DECORATION_INNER_PADDING:
|
2024-11-25 13:25:03 -03:00
|
|
|
- return touch_ui ? 3 : 8;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return touch_ui ? 3 : 4;
|
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 3 : 8;
|
|
|
|
+ }
|
2024-11-18 05:04:15 -03:00
|
|
|
case LOCATION_BAR_HEIGHT:
|
|
|
|
- return touch_ui ? 36 : 34;
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-25 13:25:03 -03:00
|
|
|
+ return touch_ui ? 34 : 30;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 36 : 34;
|
|
|
|
+ }
|
|
|
|
case LOCATION_BAR_ICON_SIZE:
|
|
|
|
return touch_ui ? 20 : 16;
|
|
|
|
case LOCATION_BAR_LEADING_ICON_SIZE:
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -85,15 +103,23 @@ int GetLayoutConstant(LayoutConstant constant) {
|
2024-09-20 19:45:14 -03:00
|
|
|
return 16;
|
|
|
|
case TAB_ALERT_INDICATOR_ICON_WIDTH:
|
|
|
|
return touch_ui ? 12 : 16;
|
|
|
|
+ case TAB_BUTTON_OFFSET:
|
|
|
|
+ return features::IsThorium2024() ? -1 : 0;
|
|
|
|
case TAB_CLOSE_BUTTON_SIZE:
|
2024-11-18 05:04:15 -03:00
|
|
|
- return touch_ui ? 24 : 16;
|
|
|
|
+ return touch_ui ? 24 : 18;
|
2024-09-24 07:56:24 -03:00
|
|
|
case TAB_HEIGHT:
|
2024-11-18 05:04:15 -03:00
|
|
|
return 34 + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
|
|
|
|
case TAB_STRIP_HEIGHT:
|
2024-08-12 10:53:10 -04:00
|
|
|
return GetLayoutConstant(TAB_HEIGHT) +
|
|
|
|
GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
case TAB_STRIP_PADDING:
|
2024-09-24 07:56:24 -03:00
|
|
|
- return 6;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ return features::IsThorium2024() ? 0 : 6;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case TAB_MARGIN:
|
2024-09-20 19:45:14 -03:00
|
|
|
+ return features::IsThorium2024() ? 6 : 6;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case TAB_INACTIVE_PADDING:
|
2024-09-20 19:45:14 -03:00
|
|
|
+ return features::IsThorium2024() ? 3 : 6;
|
2024-08-17 08:28:28 -04:00
|
|
|
+ case TAB_SEARCH_PADDING:
|
2024-09-20 19:45:14 -03:00
|
|
|
+ return features::IsThorium2024() ? 3 : 6;
|
2024-08-12 10:53:10 -04:00
|
|
|
case TAB_SEPARATOR_HEIGHT:
|
2024-09-24 07:56:24 -03:00
|
|
|
return touch_ui ? 24 : 20;
|
|
|
|
case TAB_PRE_TITLE_PADDING:
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -108,13 +134,21 @@ int GetLayoutConstant(LayoutConstant constant) {
|
2024-11-18 05:04:15 -03:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
case TOOLBAR_BUTTON_HEIGHT:
|
|
|
|
- return touch_ui ? 48 : 34;
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-25 13:25:03 -03:00
|
|
|
+ return touch_ui ? 46 : 30;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 48 : 34;
|
|
|
|
+ }
|
2024-08-20 15:26:49 -04:00
|
|
|
case TOOLBAR_DIVIDER_CORNER_RADIUS:
|
|
|
|
return 1;
|
|
|
|
case TOOLBAR_DIVIDER_HEIGHT:
|
|
|
|
- return touch_ui ? 20 : 16;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-18 05:04:15 -03:00
|
|
|
+ return touch_ui ? 20 : 18;
|
2024-08-20 15:26:49 -04:00
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 20 : 16;
|
|
|
|
+ }
|
|
|
|
case TOOLBAR_DIVIDER_SPACING:
|
|
|
|
- return 9;
|
2024-10-12 14:02:00 -03:00
|
|
|
+ return features::IsThorium2024() ? 7 : 9;
|
2024-08-20 15:26:49 -04:00
|
|
|
case TOOLBAR_DIVIDER_WIDTH:
|
|
|
|
return 2;
|
|
|
|
case TOOLBAR_ELEMENT_PADDING:
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -122,13 +156,17 @@ int GetLayoutConstant(LayoutConstant constant) {
|
2024-09-24 07:56:24 -03:00
|
|
|
case TOOLBAR_ICON_DEFAULT_MARGIN:
|
|
|
|
return touch_ui ? 0 : 2;
|
2024-08-16 23:32:34 -04:00
|
|
|
case TOOLBAR_STANDARD_SPACING:
|
2024-09-24 07:56:24 -03:00
|
|
|
- return touch_ui ? 12 : 9;
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-18 05:04:15 -03:00
|
|
|
+ return touch_ui ? 12 : 7;
|
2024-09-24 07:56:24 -03:00
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? 12 : 9;
|
|
|
|
+ }
|
2024-09-01 14:35:00 -04:00
|
|
|
case PAGE_INFO_ICON_SIZE:
|
2024-09-24 07:56:24 -03:00
|
|
|
return 20;
|
2024-08-16 23:32:34 -04:00
|
|
|
case DOWNLOAD_ICON_SIZE:
|
2024-09-24 07:56:24 -03:00
|
|
|
return 20;
|
2024-08-16 23:32:34 -04:00
|
|
|
case TOOLBAR_CORNER_RADIUS:
|
2024-08-17 08:28:28 -04:00
|
|
|
- return 8;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ return 0;
|
2024-08-16 23:32:34 -04:00
|
|
|
default:
|
2024-08-17 08:28:28 -04:00
|
|
|
break;
|
|
|
|
}
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -146,7 +184,11 @@ gfx::Insets GetLayoutInsets(LayoutInset inset) {
|
2024-09-24 23:18:15 -03:00
|
|
|
return gfx::Insets::VH(8, 20);
|
|
|
|
|
|
|
|
case LOCATION_BAR_ICON_INTERIOR_PADDING:
|
|
|
|
- return gfx::Insets::VH(2, 2);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return touch_ui ? gfx::Insets::VH(5, 10) : gfx::Insets::VH(4, 8);
|
|
|
|
+ } else {
|
|
|
|
+ return gfx::Insets::VH(2, 2);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
case LOCATION_BAR_PAGE_INFO_ICON_PADDING:
|
|
|
|
return touch_ui ? gfx::Insets::VH(5, 10) : gfx::Insets::VH(4, 4);
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -161,27 +203,36 @@ gfx::Insets GetLayoutInsets(LayoutInset inset) {
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
case TOOLBAR_BUTTON:
|
|
|
|
- return gfx::Insets(touch_ui ? 12 : 7);
|
|
|
|
+ return gfx::Insets(touch_ui ? 12
|
|
|
|
+ : (features::IsThorium2024() ? 6 : 7));
|
|
|
|
|
|
|
|
case BROWSER_APP_MENU_CHIP_PADDING:
|
2024-11-18 05:04:15 -03:00
|
|
|
- if (touch_ui) {
|
|
|
|
+ if (touch_ui || features::IsThorium2024()) {
|
|
|
|
return GetLayoutInsets(TOOLBAR_BUTTON);
|
|
|
|
} else {
|
|
|
|
return gfx::Insets::TLBR(7, 4, 7, 6);
|
|
|
|
}
|
|
|
|
|
|
|
|
case AVATAR_CHIP_PADDING:
|
|
|
|
- if (touch_ui) {
|
|
|
|
+ if (touch_ui || features::IsThorium2024()) {
|
|
|
|
return GetLayoutInsets(TOOLBAR_BUTTON);
|
|
|
|
} else {
|
|
|
|
return gfx::Insets::TLBR(7, 10, 7, 4);
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
case TOOLBAR_INTERIOR_MARGIN:
|
|
|
|
- return touch_ui ? gfx::Insets() : gfx::Insets::VH(6, 5);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return touch_ui ? gfx::Insets() : gfx::Insets::VH(4, 6);
|
|
|
|
+ } else {
|
|
|
|
+ return touch_ui ? gfx::Insets() : gfx::Insets::VH(6, 5);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
case WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN:
|
|
|
|
- return gfx::Insets::VH(4, 0);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return gfx::Insets::VH(4, 6);
|
|
|
|
+ } else {
|
|
|
|
+ return gfx::Insets::VH(4, 0);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
NOTREACHED_IN_MIGRATION();
|
|
|
|
return gfx::Insets();
|
2024-08-14 23:30:11 -04:00
|
|
|
diff --git a/chrome/browser/ui/layout_constants.h b/chrome/browser/ui/layout_constants.h
|
2024-09-24 07:56:24 -03:00
|
|
|
index a35795ee8cc11..60577ba01a5fd 100644
|
2024-08-14 23:30:11 -04:00
|
|
|
--- a/chrome/browser/ui/layout_constants.h
|
|
|
|
+++ b/chrome/browser/ui/layout_constants.h
|
2024-09-24 07:56:24 -03:00
|
|
|
@@ -123,9 +123,21 @@ enum LayoutConstant {
|
2024-08-14 23:30:11 -04:00
|
|
|
// detached tab, and on all sides of the controls padding.
|
|
|
|
TAB_STRIP_PADDING,
|
|
|
|
|
2024-08-16 23:32:34 -04:00
|
|
|
+ // For the tab margins
|
|
|
|
+ TAB_MARGIN,
|
|
|
|
+
|
|
|
|
+ // For inactive tab padding
|
|
|
|
+ TAB_INACTIVE_PADDING,
|
2024-08-14 23:30:11 -04:00
|
|
|
+
|
|
|
|
// The height of a separator in the tabstrip.
|
|
|
|
TAB_SEPARATOR_HEIGHT,
|
|
|
|
|
2024-08-17 08:28:28 -04:00
|
|
|
+ // Padding for the tab search button
|
|
|
|
+ TAB_SEARCH_PADDING,
|
2024-09-20 19:45:14 -03:00
|
|
|
+
|
|
|
|
+ // Offset y for new tab button
|
|
|
|
+ TAB_BUTTON_OFFSET,
|
2024-08-17 08:28:28 -04:00
|
|
|
+
|
|
|
|
// Padding before the tab title.
|
|
|
|
TAB_PRE_TITLE_PADDING,
|
|
|
|
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/status_bubble.h b/chrome/browser/ui/status_bubble.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index 74a00df155806..c8e4a81911d80 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/browser/ui/status_bubble.h
|
|
|
|
+++ b/chrome/browser/ui/status_bubble.h
|
|
|
|
@@ -18,7 +18,7 @@ class GURL;
|
|
|
|
class StatusBubble {
|
|
|
|
public:
|
|
|
|
// On hover, expand status bubble to fit long URL after this delay.
|
|
|
|
- static const int kExpandHoverDelayMS = 1600;
|
2024-11-12 23:55:35 -03:00
|
|
|
+ static const int kExpandHoverDelayMS = 1;
|
2024-10-03 08:24:53 -03:00
|
|
|
|
|
|
|
virtual ~StatusBubble() {}
|
|
|
|
|
2024-08-22 15:23:09 -04:00
|
|
|
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index fba81d1815359..88415257b897c 100644
|
2024-08-22 15:23:09 -04:00
|
|
|
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
|
|
|
|
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
|
2024-08-23 18:57:48 -04:00
|
|
|
@@ -105,6 +105,10 @@ void TabMenuModel::Build(TabStripModel* tab_strip, int index) {
|
|
|
|
AddItemWithStringId(TabStripModel::CommandNewTabToRight,
|
|
|
|
base::i18n::IsRTL() ? IDS_TAB_CXMENU_NEWTABTOLEFT
|
|
|
|
: IDS_TAB_CXMENU_NEWTABTORIGHT);
|
|
|
|
+ AddItemWithStringId(TabStripModel::CommandNewTabToLeft,
|
|
|
|
+ base::i18n::IsRTL() ? IDS_TAB_CXMENU_NEWTABTORIGHT
|
|
|
|
+ : IDS_TAB_CXMENU_NEWTABTOLEFT);
|
|
|
|
+ //AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB);
|
2024-08-22 15:23:09 -04:00
|
|
|
if (tab_strip->delegate()->SupportsReadLater()) {
|
|
|
|
AddItem(
|
|
|
|
TabStripModel::CommandAddToReadLater,
|
2024-09-27 22:23:12 -03:00
|
|
|
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 91513d4488166..4fa0ac198e9c6 100644
|
2024-09-27 22:23:12 -03:00
|
|
|
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
|
|
|
|
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
|
2024-11-23 16:43:11 -03:00
|
|
|
@@ -1298,6 +1298,7 @@ bool TabStripModel::IsContextMenuCommandEnabled(
|
2024-09-27 22:23:12 -03:00
|
|
|
ContextMenuCommand command_id) const {
|
|
|
|
DCHECK(command_id > CommandFirst && command_id < CommandLast);
|
|
|
|
switch (command_id) {
|
|
|
|
+ case CommandNewTabToLeft:
|
|
|
|
case CommandNewTabToRight:
|
|
|
|
case CommandCloseTab:
|
|
|
|
return true;
|
2024-11-23 16:43:11 -03:00
|
|
|
@@ -1399,6 +1400,16 @@ void TabStripModel::ExecuteContextMenuCommand(int context_index,
|
2024-09-27 22:23:12 -03:00
|
|
|
if (!ContainsIndex(context_index))
|
|
|
|
return;
|
|
|
|
switch (command_id) {
|
|
|
|
+
|
|
|
|
+ case CommandNewTabToLeft: {
|
|
|
|
+ base::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
|
|
|
|
+ UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", NewTabTypes::NEW_TAB_CONTEXT_MENU,
|
|
|
|
+ NewTabTypes::NEW_TAB_ENUM_COUNT);
|
|
|
|
+ delegate()->AddTabAt(GURL(), context_index, true,
|
|
|
|
+ GetTabGroupForTab(context_index));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
case CommandNewTabToRight: {
|
|
|
|
base::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
|
|
|
|
UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", NewTabTypes::NEW_TAB_CONTEXT_MENU,
|
|
|
|
diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index 4d900c4a7f58c..8daa4634abeaf 100644
|
2024-09-27 22:23:12 -03:00
|
|
|
--- a/chrome/browser/ui/tabs/tab_strip_model.h
|
|
|
|
+++ b/chrome/browser/ui/tabs/tab_strip_model.h
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -545,6 +545,7 @@ class TabStripModel : public TabGroupController {
|
2024-09-27 22:23:12 -03:00
|
|
|
// for entries in the 'Add to existing group' submenu.
|
|
|
|
enum ContextMenuCommand {
|
|
|
|
CommandFirst,
|
|
|
|
+ CommandNewTabToLeft,
|
|
|
|
CommandNewTabToRight,
|
|
|
|
CommandReload,
|
|
|
|
CommandDuplicate,
|
2024-08-12 10:53:10 -04:00
|
|
|
diff --git a/chrome/browser/ui/tabs/tab_style.cc b/chrome/browser/ui/tabs/tab_style.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index d48223986946d..9e5df278ea2b6 100644
|
2024-08-12 10:53:10 -04:00
|
|
|
--- a/chrome/browser/ui/tabs/tab_style.cc
|
|
|
|
+++ b/chrome/browser/ui/tabs/tab_style.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -11,6 +11,7 @@
|
2024-08-14 23:30:11 -04:00
|
|
|
|
|
|
|
#include "chrome/browser/ui/layout_constants.h"
|
2024-09-24 07:56:24 -03:00
|
|
|
#include "chrome/browser/ui/tabs/features.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
2024-08-14 23:30:11 -04:00
|
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
|
|
#include "ui/base/ui_base_features.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
#include "ui/color/color_provider.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -21,13 +22,18 @@ namespace {
|
2024-08-14 23:30:11 -04:00
|
|
|
|
|
|
|
// Thickness in DIPs of the separator painted on the left and right edges of
|
2024-08-12 10:53:10 -04:00
|
|
|
// the tab.
|
2024-10-11 21:50:44 -03:00
|
|
|
+constexpr int kThoriumSeparatorThickness = 2;
|
2024-08-12 10:53:10 -04:00
|
|
|
constexpr int kChromeRefreshSeparatorThickness = 2;
|
2024-10-11 21:50:44 -03:00
|
|
|
+constexpr float kThoriumSeparatorHorizontalMargin = 0.0f;
|
2024-08-14 23:30:11 -04:00
|
|
|
constexpr int kChromeRefreshSeparatorHorizontalMargin = 2;
|
2024-08-12 10:53:10 -04:00
|
|
|
// TODO (crbug.com/1451400): This constant should be in LayoutConstants.
|
2024-08-14 23:30:11 -04:00
|
|
|
+constexpr int kThoriumSeparatorHeight = 20;
|
|
|
|
constexpr int kChromeRefreshSeparatorHeight = 16;
|
2024-08-12 10:53:10 -04:00
|
|
|
|
|
|
|
// The padding from the top of the tab to the content area.
|
2024-08-14 23:30:11 -04:00
|
|
|
+constexpr int kThoriumTabVerticalPadding = 9;
|
|
|
|
constexpr int kChromeRefreshTabVerticalPadding = 6;
|
2024-08-17 08:28:28 -04:00
|
|
|
+constexpr int kThoriumTabHorizontalPadding = 6;
|
2024-08-12 10:53:10 -04:00
|
|
|
constexpr int kChromeRefreshTabHorizontalPadding = 8;
|
|
|
|
|
2024-09-24 07:56:24 -03:00
|
|
|
class ChromeRefresh2023TabStyle : public TabStyle {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -59,8 +65,28 @@ class ChromeRefresh2023TabStyle : public TabStyle {
|
2024-09-04 02:33:23 -04:00
|
|
|
TabStyle::~TabStyle() = default;
|
|
|
|
|
2024-09-24 07:56:24 -03:00
|
|
|
int ChromeRefresh2023TabStyle::GetStandardWidth() const {
|
2024-09-04 02:33:23 -04:00
|
|
|
+
|
|
|
|
+ const std::string custom_tab_width = base::CommandLine::ForCurrentProcess()->
|
|
|
|
+ GetSwitchValueASCII("custom-tab-width");
|
2024-10-05 04:48:49 -03:00
|
|
|
+ int kTabWidthValue;
|
2024-09-04 02:33:23 -04:00
|
|
|
+ if (custom_tab_width == "60") {
|
|
|
|
+ kTabWidthValue = 60;
|
|
|
|
+ } else if (custom_tab_width == "120") {
|
|
|
|
+ kTabWidthValue = 120;
|
2024-10-03 08:24:53 -03:00
|
|
|
+ } else if (custom_tab_width == "180") {
|
|
|
|
+ kTabWidthValue = 180;
|
2024-09-04 02:33:23 -04:00
|
|
|
+ } else if (custom_tab_width == "240") {
|
|
|
|
+ kTabWidthValue = 240;
|
|
|
|
+ } else if (custom_tab_width == "300") {
|
|
|
|
+ kTabWidthValue = 300;
|
|
|
|
+ } else if (custom_tab_width == "400") {
|
|
|
|
+ kTabWidthValue = 400;
|
|
|
|
+ } else {
|
|
|
|
+ kTabWidthValue = 240;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// The standard tab width is 240 DIP including both separators.
|
|
|
|
- constexpr int kTabWidth = 240;
|
|
|
|
+ const int kTabWidth = kTabWidthValue;
|
|
|
|
// The overlap includes one separator, so subtract it here.
|
|
|
|
return kTabWidth + GetTabOverlap() - GetSeparatorSize().width();
|
|
|
|
}
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -107,19 +133,42 @@ int ChromeRefresh2023TabStyle::GetMinimumInactiveWidth() const {
|
2024-08-14 23:30:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int ChromeRefresh2023TabStyle::GetTopCornerRadius() const {
|
|
|
|
- return 10;
|
2024-08-17 08:28:28 -04:00
|
|
|
+ static const bool rectangular_tabs =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024() && !rectangular_tabs) {
|
2024-08-14 23:30:11 -04:00
|
|
|
+ return 8;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-14 23:30:11 -04:00
|
|
|
+ } else {
|
|
|
|
+ return 10;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int ChromeRefresh2023TabStyle::GetBottomCornerRadius() const {
|
|
|
|
- return 12;
|
2024-08-17 08:28:28 -04:00
|
|
|
+ static const bool rectangular_tabs =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024() && !rectangular_tabs) {
|
2024-08-17 08:28:28 -04:00
|
|
|
+ return 10;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-14 23:30:11 -04:00
|
|
|
+ } else {
|
|
|
|
+ return 12;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int ChromeRefresh2023TabStyle::GetTabOverlap() const {
|
2024-09-24 23:18:15 -03:00
|
|
|
// The overlap removes the width and the margins of the separator.
|
2024-09-20 19:45:14 -03:00
|
|
|
- const float total_separator_width = GetSeparatorMargins().left() +
|
|
|
|
- GetSeparatorSize().width() +
|
|
|
|
- GetSeparatorMargins().right();
|
|
|
|
- return 2 * GetBottomCornerRadius() - total_separator_width;
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-09-24 23:18:15 -03:00
|
|
|
+ const float total_separator_width = GetSeparatorMargins().left() +
|
|
|
|
+ GetSeparatorSize().width() +
|
|
|
|
+ GetSeparatorMargins().right();
|
2024-09-20 19:45:14 -03:00
|
|
|
+ return 2 * GetBottomCornerRadius() - total_separator_width;
|
|
|
|
+ } else {
|
|
|
|
+ const float total_separator_width = GetSeparatorMargins().left() +
|
|
|
|
+ GetSeparatorSize().width() +
|
|
|
|
+ GetSeparatorMargins().right();
|
|
|
|
+ return 2 * GetBottomCornerRadius() - total_separator_width;
|
|
|
|
+ }
|
2024-08-14 23:30:11 -04:00
|
|
|
}
|
|
|
|
|
2024-09-24 07:56:24 -03:00
|
|
|
gfx::Size ChromeRefresh2023TabStyle::GetPreviewImageSize() const {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -129,23 +178,43 @@ gfx::Size ChromeRefresh2023TabStyle::GetPreviewImageSize() const {
|
2024-09-24 07:56:24 -03:00
|
|
|
}
|
|
|
|
|
2024-08-14 23:30:11 -04:00
|
|
|
gfx::Size ChromeRefresh2023TabStyle::GetSeparatorSize() const {
|
|
|
|
- return gfx::Size(kChromeRefreshSeparatorThickness,
|
|
|
|
- kChromeRefreshSeparatorHeight);
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-08-14 23:30:11 -04:00
|
|
|
+ return gfx::Size(kThoriumSeparatorThickness,
|
|
|
|
+ kThoriumSeparatorHeight);
|
|
|
|
+ } else {
|
|
|
|
+ return gfx::Size(kChromeRefreshSeparatorThickness,
|
|
|
|
+ kChromeRefreshSeparatorHeight);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Insets ChromeRefresh2023TabStyle::GetSeparatorMargins() const {
|
|
|
|
- return gfx::Insets::TLBR(GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
- kChromeRefreshSeparatorHorizontalMargin,
|
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
- kChromeRefreshSeparatorHorizontalMargin);
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-08-16 23:32:34 -04:00
|
|
|
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_INACTIVE_PADDING),
|
2024-08-14 23:30:11 -04:00
|
|
|
+ kThoriumSeparatorHorizontalMargin,
|
2024-08-16 23:32:34 -04:00
|
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING),
|
2024-08-14 23:30:11 -04:00
|
|
|
+ kThoriumSeparatorHorizontalMargin);
|
|
|
|
+ } else {
|
|
|
|
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ kChromeRefreshSeparatorHorizontalMargin,
|
|
|
|
+ GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ kChromeRefreshSeparatorHorizontalMargin);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int ChromeRefresh2023TabStyle::GetSeparatorCornerRadius() const {
|
2024-09-20 19:45:14 -03:00
|
|
|
- return GetSeparatorSize().width() / 2;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return 0;
|
|
|
|
+ } else {
|
|
|
|
+ return GetSeparatorSize().width() / 2;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int ChromeRefresh2023TabStyle::GetDragHandleExtension(int height) const {
|
|
|
|
- return 6;
|
2024-09-20 19:45:53 -03:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-09-24 23:18:15 -03:00
|
|
|
+ return (height - GetSeparatorSize().height()) / 2 - 1;
|
2024-09-20 19:45:53 -03:00
|
|
|
+ } else {
|
|
|
|
+ return 6;
|
|
|
|
+ }
|
2024-09-20 19:45:14 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
SkColor ChromeRefresh2023TabStyle::GetTabBackgroundColor(
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -182,11 +251,19 @@ SkColor ChromeRefresh2023TabStyle::GetTabBackgroundColor(
|
2024-09-24 07:56:24 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Insets ChromeRefresh2023TabStyle::GetContentsInsets() const {
|
|
|
|
- return gfx::Insets::TLBR(
|
|
|
|
- kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
|
|
|
|
- kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return gfx::Insets::TLBR(
|
|
|
|
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding,
|
|
|
|
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding);
|
|
|
|
+ } else {
|
|
|
|
+ return gfx::Insets::TLBR(
|
|
|
|
+ kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
|
|
|
|
+ kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
|
|
|
|
+ GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
float ChromeRefresh2023TabStyle::GetSelectedTabOpacity() const {
|
2024-09-01 15:48:46 -04:00
|
|
|
diff --git a/chrome/browser/ui/thorium_2024.h b/chrome/browser/ui/thorium_2024.h
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000..de40b42fcc722
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/thorium_2024.h
|
|
|
|
@@ -0,0 +1,14 @@
|
|
|
|
+// Copyright 2024 Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#ifndef CHROME_BROWSER_UI_THORIUM_2024_UI_H_
|
|
|
|
+#define CHROME_BROWSER_UI_THORIUM_2024_UI_H_
|
|
|
|
+
|
|
|
|
+#include "base/command_line.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
+
|
|
|
|
+// Blanking out until moving file to //ui/base
|
|
|
|
+//static const bool thor24 = features::IsThorium2024();
|
|
|
|
+
|
|
|
|
+#endif // CHROME_BROWSER_UI_THORIUM_2024_UI_H_
|
2024-10-12 23:06:59 -03:00
|
|
|
diff --git a/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.cc b/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
index 6a91493f7c2bc..fdeb2a4a0916e 100644
|
2024-10-12 23:06:59 -03:00
|
|
|
--- a/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.cc
|
|
|
|
+++ b/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -49,6 +49,38 @@ const std::vector<LabInfo>& GetData() {
|
2024-10-12 23:06:59 -03:00
|
|
|
l10n_util::GetStringUTF16(IDS_TABS_SHRINK_TO_LARGE_WIDTH),
|
|
|
|
l10n_util::GetStringUTF16(IDS_TABS_DO_NOT_SHRINK)};
|
|
|
|
|
|
|
|
+ const char kThorium2024FlagId[] = "thorium-2024";
|
2024-11-18 05:04:15 -03:00
|
|
|
+ const std::u16string kThorium2024FlagName = u"Enable Thorium 2024 UI";
|
|
|
|
+ const std::u16string kThorium2024FlagDescription = u"Enable an experimental UI, which restores many parts of the pre-Chrome Refresh 2023 UI.";
|
2024-10-12 23:06:59 -03:00
|
|
|
+
|
|
|
|
+ lab_info.emplace_back(
|
|
|
|
+ kThorium2024FlagId,
|
|
|
|
+ kThorium2024FlagName,
|
|
|
|
+ kThorium2024FlagDescription,
|
|
|
|
+ "chrome-labs-thorium-2024", version_info::Channel::BETA);
|
2024-11-18 05:04:15 -03:00
|
|
|
+
|
|
|
|
+ const char kRestoreTabsFlagId[] = "restore-tab-button";
|
|
|
|
+ const std::u16string kRestoreTabsFlagName = u"Restore Tab Button";
|
|
|
|
+ const std::u16string kRestoreTabsFlagDescription = u"Enable a new toolbar button to restore your recently closed tabs.";
|
|
|
|
+
|
|
|
|
+ lab_info.emplace_back(
|
|
|
|
+ kRestoreTabsFlagId,
|
|
|
|
+ kRestoreTabsFlagName,
|
|
|
|
+ kRestoreTabsFlagDescription,
|
|
|
|
+ "chrome-labs-restore-tab-button", version_info::Channel::BETA);
|
|
|
|
+
|
|
|
|
+#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
|
|
|
|
+ const char kMiddleScrollFlagId[] = "middle-click-autoscroll";
|
|
|
|
+ const std::u16string kMiddleScrollFlagName = u"Middle Click Autoscroll";
|
|
|
|
+ const std::u16string kMiddleScrollFlagDescription = u"Enables autoscrolling when the middle mouse button is pressed.";
|
|
|
|
+
|
|
|
|
+ lab_info.emplace_back(
|
|
|
|
+ kMiddleScrollFlagId,
|
|
|
|
+ kMiddleScrollFlagName,
|
|
|
|
+ kMiddleScrollFlagDescription,
|
|
|
|
+ "chrome-labs-middle-click-autoscroll", version_info::Channel::BETA);
|
|
|
|
+#endif
|
2024-10-12 23:06:59 -03:00
|
|
|
+
|
|
|
|
lab_info.emplace_back(
|
|
|
|
flag_descriptions::kScrollableTabStripFlagId,
|
|
|
|
l10n_util::GetStringUTF16(IDS_TAB_SCROLLING_EXPERIMENT_NAME),
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/view_ids.h b/chrome/browser/ui/view_ids.h
|
|
|
|
index fb9afeed5a60e..d40af6311e073 100644
|
|
|
|
--- a/chrome/browser/ui/view_ids.h
|
|
|
|
+++ b/chrome/browser/ui/view_ids.h
|
|
|
|
@@ -16,6 +16,7 @@ enum ViewID {
|
|
|
|
|
|
|
|
// Views which make up the skyline. These are used only
|
|
|
|
// on views.
|
|
|
|
+ VIEW_ID_TAB_SEARCH_BUTTON,
|
|
|
|
VIEW_ID_MINIMIZE_BUTTON,
|
|
|
|
VIEW_ID_MAXIMIZE_BUTTON,
|
|
|
|
VIEW_ID_RESTORE_BUTTON,
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
index 9cecb25b41d3b..65fd377e98ae6 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -56,6 +56,7 @@
|
|
|
|
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
|
|
|
|
#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h"
|
2024-09-24 23:18:15 -03:00
|
|
|
#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
|
|
#include "chrome/browser/ui/view_ids.h"
|
|
|
|
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view_observer.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -339,8 +340,8 @@ class BookmarkBarView::ButtonSeparatorView : public views::Separator {
|
2024-09-24 23:18:15 -03:00
|
|
|
|
|
|
|
public:
|
|
|
|
ButtonSeparatorView() {
|
|
|
|
- const int leading_padding = 8;
|
|
|
|
- const int trailing_padding = 8;
|
|
|
|
+ const int leading_padding = features::IsThorium2024() ? 4 : 8;
|
|
|
|
+ const int trailing_padding = features::IsThorium2024() ? 3 : 8;
|
|
|
|
separator_thickness_ = kBookmarkBarSeparatorThickness;
|
|
|
|
const gfx::Insets border_insets =
|
|
|
|
gfx::Insets::TLBR(0, leading_padding, 0, trailing_padding);
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -702,7 +703,7 @@ void BookmarkBarView::Layout(PassKey) {
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int x = GetLeadingMargin();
|
|
|
|
- static constexpr int kBookmarkBarTrailingMargin = 8;
|
|
|
|
+ static const int kBookmarkBarTrailingMargin = features::IsThorium2024() ? 0 : 8;
|
|
|
|
int width = View::width() - x - kBookmarkBarTrailingMargin;
|
|
|
|
|
|
|
|
const int button_height = GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT);
|
2024-09-01 14:35:00 -04:00
|
|
|
diff --git a/chrome/browser/ui/views/chrome_layout_provider.cc b/chrome/browser/ui/views/chrome_layout_provider.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 9b189df8d8ffd..7c2ae3a3c94fa 100644
|
2024-09-01 14:35:00 -04:00
|
|
|
--- a/chrome/browser/ui/views/chrome_layout_provider.cc
|
|
|
|
+++ b/chrome/browser/ui/views/chrome_layout_provider.cc
|
2024-09-24 23:18:15 -03:00
|
|
|
@@ -7,6 +7,7 @@
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
#include "base/feature_list.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
#include "chrome/browser/ui/views/chrome_typography.h"
|
|
|
|
#include "components/omnibox/common/omnibox_features.h"
|
|
|
|
#include "ui/base/pointer/touch_ui_controller.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -157,7 +158,7 @@ int ChromeLayoutProvider::GetDistanceMetric(int metric) const {
|
2024-09-01 14:35:00 -04:00
|
|
|
case DISTANCE_INFOBAR_HEIGHT:
|
|
|
|
// Spec says height of button should be 36dp, vertical padding on both
|
|
|
|
// top and bottom should be 8dp.
|
|
|
|
- return 36 + 2 * 8;
|
2024-09-17 01:11:38 -03:00
|
|
|
+ return features::IsThorium2024() ? 42 : 36 + 2 * 8;
|
2024-09-01 14:35:00 -04:00
|
|
|
case DISTANCE_PERMISSION_PROMPT_HORIZONTAL_ICON_LABEL_PADDING:
|
2024-09-24 07:56:24 -03:00
|
|
|
return 8;
|
|
|
|
case DISTANCE_RICH_HOVER_BUTTON_ICON_HORIZONTAL:
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc b/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc
|
|
|
|
index b4ed00fe214a9..cbd69f5565a61 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_caption_button_container_win.cc
|
|
|
|
@@ -10,6 +10,8 @@
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_frame_view_win.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_view.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/windows_caption_button.h"
|
|
|
|
+#include "chrome/browser/ui/views/frame/window_caption_util.h"
|
|
|
|
+#include "chrome/browser/ui/views/frame/windows_tab_search_caption_button.h"
|
|
|
|
#include "chrome/browser/win/titlebar_config.h"
|
|
|
|
#include "chrome/grit/generated_resources.h"
|
|
|
|
#include "ui/base/l10n/l10n_util.h"
|
|
|
|
@@ -66,6 +68,14 @@ BrowserCaptionButtonContainer::BrowserCaptionButtonContainer(
|
|
|
|
frame_view_,
|
|
|
|
VIEW_ID_CLOSE_BUTTON,
|
|
|
|
IDS_APP_ACCNAME_CLOSE))) {
|
|
|
|
+ if (WindowCaptionUtil::IsWindowsTabSearchCaptionButtonEnabled(
|
|
|
|
+ frame_view_->browser_view()->browser())) {
|
|
|
|
+ tab_search_button_ =
|
|
|
|
+ AddChildViewAt(std::make_unique<WindowsTabSearchCaptionButton>(
|
|
|
|
+ frame_view_, VIEW_ID_TAB_SEARCH_BUTTON,
|
|
|
|
+ l10n_util::GetStringUTF16(IDS_ACCNAME_TAB_SEARCH)),
|
|
|
|
+ 0);
|
|
|
|
+ }
|
|
|
|
// Layout is horizontal, with buttons placed at the trailing end of the view.
|
|
|
|
// This allows the container to expand to become a faux titlebar/drag handle.
|
|
|
|
auto* const layout = SetLayoutManager(std::make_unique<views::FlexLayout>());
|
|
|
|
@@ -91,6 +101,9 @@ int BrowserCaptionButtonContainer::NonClientHitTest(
|
|
|
|
const gfx::Point& point) const {
|
|
|
|
DCHECK(HitTestPoint(point))
|
|
|
|
<< "should only be called with a point inside this view's bounds";
|
|
|
|
+ if (tab_search_button_ && HitTestCaptionButton(tab_search_button_, point)) {
|
|
|
|
+ return HTCLIENT;
|
|
|
|
+ }
|
|
|
|
// BrowserView covers the frame view when Window Controls Overlay is enabled.
|
|
|
|
// The native window that encompasses Web Contents gets the mouse events meant
|
|
|
|
// for the caption buttons, so returning HTClient allows these buttons to be
|
|
|
|
@@ -132,6 +145,11 @@ void BrowserCaptionButtonContainer::OnWindowControlsOverlayEnabledChanged() {
|
|
|
|
UpdateButtonToolTipsForWindowControlsOverlay();
|
|
|
|
}
|
|
|
|
|
|
|
|
+TabSearchBubbleHost* BrowserCaptionButtonContainer::GetTabSearchBubbleHost() {
|
|
|
|
+ return tab_search_button_ ? tab_search_button_->tab_search_bubble_host()
|
|
|
|
+ : nullptr;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void BrowserCaptionButtonContainer::OnThemeChanged() {
|
|
|
|
if (frame_view_->browser_view()->IsWindowControlsOverlayEnabled()) {
|
|
|
|
SetBackground(
|
|
|
|
@@ -141,6 +159,9 @@ void BrowserCaptionButtonContainer::OnThemeChanged() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void BrowserCaptionButtonContainer::ResetWindowControls() {
|
|
|
|
+ if (tab_search_button_) {
|
|
|
|
+ tab_search_button_->SetState(views::Button::STATE_NORMAL);
|
|
|
|
+ }
|
|
|
|
minimize_button_->SetState(views::Button::STATE_NORMAL);
|
|
|
|
maximize_button_->SetState(views::Button::STATE_NORMAL);
|
|
|
|
restore_button_->SetState(views::Button::STATE_NORMAL);
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_caption_button_container_win.h b/chrome/browser/ui/views/frame/browser_caption_button_container_win.h
|
|
|
|
index bda5b2b0ab02d..a8dac38d7b61b 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/browser_caption_button_container_win.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_caption_button_container_win.h
|
|
|
|
@@ -15,7 +15,9 @@
|
|
|
|
#include "ui/views/widget/widget_observer.h"
|
|
|
|
|
|
|
|
class BrowserFrameViewWin;
|
|
|
|
+class TabSearchBubbleHost;
|
|
|
|
class WindowsCaptionButton;
|
|
|
|
+class WindowsTabSearchCaptionButton;
|
|
|
|
|
|
|
|
// Provides a container for Windows caption buttons that can be moved between
|
|
|
|
// frame and browser window as needed. When extended horizontally, becomes a
|
|
|
|
@@ -38,6 +40,8 @@ class BrowserCaptionButtonContainer : public views::View,
|
|
|
|
|
|
|
|
void OnWindowControlsOverlayEnabledChanged();
|
|
|
|
|
|
|
|
+ TabSearchBubbleHost* GetTabSearchBubbleHost();
|
|
|
|
+
|
|
|
|
private:
|
|
|
|
friend class BrowserFrameViewWin;
|
|
|
|
|
|
|
|
@@ -64,6 +68,7 @@ class BrowserCaptionButtonContainer : public views::View,
|
|
|
|
void UpdateButtonToolTipsForWindowControlsOverlay();
|
|
|
|
|
|
|
|
const raw_ptr<BrowserFrameViewWin> frame_view_;
|
|
|
|
+ raw_ptr<WindowsTabSearchCaptionButton> tab_search_button_ = nullptr;
|
|
|
|
const raw_ptr<WindowsCaptionButton> minimize_button_;
|
|
|
|
const raw_ptr<WindowsCaptionButton> maximize_button_;
|
|
|
|
const raw_ptr<WindowsCaptionButton> restore_button_;
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 84930758ab743..8b762a0c37582 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -74,5 +74,5 @@ gfx::Insets BrowserFrameViewLayoutLinux::RestoredFrameEdgeInsets() const {
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int BrowserFrameViewLayoutLinux::NonClientExtraTopThickness() const {
|
|
|
|
- return delegate_->IsTabStripVisible() ? 0 : kExtraTopBorder;
|
|
|
|
+ return (!features::IsThorium2024() && delegate_->IsTabStripVisible()) ? 0 : kExtraTopBorder;
|
|
|
|
}
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_win.cc b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index eabc844883aca..291633d064be4 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -259,6 +259,10 @@ void BrowserFrameViewWin::WindowControlsOverlayEnabledChanged() {
|
2024-11-18 05:04:15 -03:00
|
|
|
caption_button_container_->OnWindowControlsOverlayEnabledChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
+TabSearchBubbleHost* BrowserFrameViewWin::GetTabSearchBubbleHost() {
|
|
|
|
+ return caption_button_container_->GetTabSearchBubbleHost();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void BrowserFrameViewWin::PaintAsActiveChanged() {
|
|
|
|
BrowserNonClientFrameView::PaintAsActiveChanged();
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -321,7 +325,9 @@ int BrowserFrameViewWin::NonClientHitTest(const gfx::Point& point) {
|
2024-09-24 23:18:15 -03:00
|
|
|
// pixels at the end of the top and bottom edges trigger diagonal resizing.
|
|
|
|
constexpr int kResizeCornerWidth = 16;
|
|
|
|
|
|
|
|
- const int top_border_thickness = GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
+ const int top_border_thickness = features::IsThorium2024()
|
|
|
|
+ ? GetLayoutConstant(TAB_INACTIVE_PADDING)
|
2024-11-19 13:58:44 -03:00
|
|
|
+ : FrameTopBorderThickness(false);
|
2024-09-24 23:18:15 -03:00
|
|
|
|
|
|
|
const int window_component = GetHTComponentForFrame(
|
|
|
|
point, gfx::Insets::TLBR(top_border_thickness, 0, 0, 0),
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -501,7 +507,7 @@ int BrowserFrameViewWin::FrameTopBorderThickness(bool restored) const {
|
2024-09-24 23:18:15 -03:00
|
|
|
// default. When maximized, the OS sizes the window such that the border
|
|
|
|
// extends beyond the screen edges. In that case, we must return the
|
|
|
|
// default value.
|
|
|
|
- const int kTopResizeFrameArea = 0;
|
2024-11-19 13:58:44 -03:00
|
|
|
+ const int kTopResizeFrameArea = features::IsThorium2024() ? 5 : 0;
|
2024-09-24 23:18:15 -03:00
|
|
|
return kTopResizeFrameArea;
|
|
|
|
}
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -561,6 +567,22 @@ int BrowserFrameViewWin::TopAreaHeight(bool restored) const {
|
2024-09-24 23:18:15 -03:00
|
|
|
return top;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // In maximized mode, we do not add any additional thickness to the grab
|
|
|
|
+ // handle above the tabs; just return the frame thickness.
|
|
|
|
+ if (maximized) {
|
|
|
|
+ return top;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Besides the frame border, there's empty space atop the window in restored
|
|
|
|
+ // mode, to use to drag the window around.
|
2024-11-14 17:30:18 -03:00
|
|
|
+ constexpr int kNonClientRestoredExtraThickness = 8;
|
2024-11-16 01:42:47 -03:00
|
|
|
+ int thickness = kNonClientRestoredExtraThickness;
|
2024-09-24 23:18:15 -03:00
|
|
|
+ if (EverHasVisibleBackgroundTabShapes() && features::IsThorium2024()) {
|
|
|
|
+ thickness =
|
|
|
|
+ std::max(thickness, BrowserNonClientFrameView::kMinimumDragHeight);
|
|
|
|
+ return top + thickness;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
// The tabstrip controls its own top padding.
|
|
|
|
return top;
|
|
|
|
}
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -810,17 +832,30 @@ void BrowserFrameViewWin::LayoutCaptionButtons() {
|
2024-09-24 23:18:15 -03:00
|
|
|
|
|
|
|
const gfx::Size preferred_size =
|
|
|
|
caption_button_container_->GetPreferredSize();
|
|
|
|
+ int height = preferred_size.height();
|
|
|
|
+ // We use the standard caption bar height when maximized in tablet mode, which
|
|
|
|
+ // is smaller than our preferred button size.
|
|
|
|
+ if (IsWebUITabStrip() && IsMaximized()) {
|
|
|
|
+ height = std::min(height, TitlebarMaximizedVisualHeight());
|
|
|
|
+ }
|
|
|
|
+ if (!browser_view()->GetWebAppFrameToolbarPreferredSize().IsEmpty()) {
|
|
|
|
+ height = IsMaximized() ? TitlebarMaximizedVisualHeight()
|
|
|
|
+ : TitlebarHeight(false) - WindowTopY();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const int system_caption_buttons_width =
|
|
|
|
ShouldBrowserCustomDrawTitlebar(browser_view())
|
|
|
|
? 0
|
|
|
|
: width() - frame()->GetMinimizeButtonOffset();
|
|
|
|
|
|
|
|
+ height = features::IsThorium2024() ? std::min(GetFrameHeight(), height)
|
|
|
|
+ : GetFrameHeight();
|
|
|
|
+
|
|
|
|
caption_button_container_->SetBounds(
|
|
|
|
CaptionButtonsOnLeadingEdge()
|
|
|
|
? system_caption_buttons_width
|
|
|
|
: width() - system_caption_buttons_width - preferred_size.width(),
|
|
|
|
- WindowTopY(), preferred_size.width(), GetFrameHeight());
|
|
|
|
+ WindowTopY(), preferred_size.width(), height);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BrowserFrameViewWin::LayoutClientView() {
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_win.h b/chrome/browser/ui/views/frame/browser_frame_view_win.h
|
|
|
|
index 27caea181a279..d3210e6c02922 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/browser_frame_view_win.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_frame_view_win.h
|
|
|
|
@@ -17,6 +17,7 @@
|
|
|
|
#include "ui/views/window/non_client_view.h"
|
|
|
|
|
|
|
|
class BrowserView;
|
|
|
|
+class TabSearchBubbleHost;
|
|
|
|
class BrowserCaptionButtonContainer;
|
|
|
|
|
|
|
|
class BrowserFrameViewWin : public BrowserNonClientFrameView,
|
|
|
|
@@ -45,6 +46,7 @@ class BrowserFrameViewWin : public BrowserNonClientFrameView,
|
|
|
|
void UpdateThrobber(bool running) override;
|
|
|
|
gfx::Size GetMinimumSize() const override;
|
|
|
|
void WindowControlsOverlayEnabledChanged() override;
|
|
|
|
+ TabSearchBubbleHost* GetTabSearchBubbleHost() override;
|
|
|
|
|
|
|
|
// views::NonClientFrameView:
|
|
|
|
gfx::Rect GetBoundsForClientView() const override;
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
index 3f1568d7a1c94..6483d1cbc5162 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
|
|
|
|
@@ -202,6 +202,10 @@ void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
|
|
|
|
OnProfileAvatarChanged(base::FilePath());
|
|
|
|
}
|
|
|
|
|
|
|
|
+TabSearchBubbleHost* BrowserNonClientFrameView::GetTabSearchBubbleHost() {
|
|
|
|
+ return nullptr;
|
|
|
|
+}
|
|
|
|
+
|
2024-11-18 06:48:10 -03:00
|
|
|
gfx::Insets BrowserNonClientFrameView::RestoredMirroredFrameBorderInsets()
|
|
|
|
const {
|
|
|
|
NOTREACHED();
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index 2238e76440194..df37021bf766f 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
|
|
|
|
@@ -13,6 +13,7 @@
|
|
|
|
#include "ui/views/window/non_client_view.h"
|
|
|
|
|
|
|
|
class BrowserView;
|
|
|
|
+class TabSearchBubbleHost;
|
|
|
|
|
|
|
|
// Type used for functions whose return values depend on the active state of
|
|
|
|
// the frame.
|
|
|
|
@@ -133,6 +134,10 @@ class BrowserNonClientFrameView : public views::NonClientFrameView,
|
|
|
|
using views::NonClientFrameView::ShouldPaintAsActive;
|
|
|
|
void VisibilityChanged(views::View* starting_from, bool is_visible) override;
|
|
|
|
|
|
|
|
+ // Gets the TabSearchBubbleHost if present in the NonClientFrameView. Can
|
|
|
|
+ // return null.
|
|
|
|
+ virtual TabSearchBubbleHost* GetTabSearchBubbleHost();
|
|
|
|
+
|
|
|
|
// Returns the insets from the edge of the native window to the client view in
|
|
|
|
// DIPs. The value is left-to-right even on RTL locales. That is,
|
|
|
|
// insets.left() will be on the left in screen coordinates.
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 63cc8cddfe04e..a0c81619fb666 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -283,7 +283,11 @@ int BrowserNonClientFrameViewChromeOS::GetTopInset(bool restored) const {
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (browser_view()->GetTabStripVisible()) {
|
|
|
|
- return 0;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return header_height - browser_view()->GetTabStripHeight();
|
|
|
|
+ } else {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
Browser* browser = browser_view()->browser();
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -349,6 +353,11 @@ SkColor BrowserNonClientFrameViewChromeOS::GetFrameColor(
|
2024-11-18 05:04:15 -03:00
|
|
|
return color.value_or(fallback_color);
|
|
|
|
}
|
|
|
|
|
|
|
|
+TabSearchBubbleHost*
|
|
|
|
+BrowserNonClientFrameViewChromeOS::GetTabSearchBubbleHost() {
|
|
|
|
+ return tab_search_bubble_host_;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void BrowserNonClientFrameViewChromeOS::UpdateMinimumSize() {
|
|
|
|
gfx::Size current_min_size = GetMinimumSize();
|
|
|
|
if (last_minimum_size_ == current_min_size)
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index 73458b42a53e7..1a602a719da5a 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h
|
|
|
|
@@ -69,6 +69,7 @@ class BrowserNonClientFrameViewChromeOS
|
|
|
|
bool CanUserExitFullscreen() const override;
|
|
|
|
SkColor GetCaptionColor(BrowserFrameActiveState active_state) const override;
|
|
|
|
SkColor GetFrameColor(BrowserFrameActiveState active_state) const override;
|
|
|
|
+ TabSearchBubbleHost* GetTabSearchBubbleHost() override;
|
|
|
|
void UpdateMinimumSize() override;
|
|
|
|
|
|
|
|
// views::NonClientFrameView:
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -236,6 +237,8 @@ class BrowserNonClientFrameViewChromeOS
|
2024-11-18 05:04:15 -03:00
|
|
|
raw_ptr<chromeos::FrameCaptionButtonContainerView> caption_button_container_ =
|
|
|
|
nullptr;
|
|
|
|
|
|
|
|
+ raw_ptr<TabSearchBubbleHost> tab_search_bubble_host_ = nullptr;
|
|
|
|
+
|
|
|
|
// For popups, the window icon.
|
|
|
|
raw_ptr<TabIconView> window_icon_ = nullptr;
|
|
|
|
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h
|
|
|
|
index 263261b1c8204..93335609f27da 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h
|
|
|
|
@@ -105,6 +105,8 @@ class BrowserNonClientFrameViewMac : public BrowserNonClientFrameView,
|
|
|
|
const gfx::Rect& frame,
|
|
|
|
const gfx::Insets& caption_button_insets);
|
|
|
|
|
|
|
|
+ CGFloat FullscreenBackingBarHeight() const;
|
|
|
|
+
|
|
|
|
// Calculate the y offset the top UI needs to shift down due to showing the
|
|
|
|
// slide down menu bar at the very top in full screen.
|
|
|
|
int TopUIFullscreenYOffset() const;
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
|
2024-11-18 06:48:10 -03:00
|
|
|
index 2caa04674d405..85c6d434c537b 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
|
|
|
|
@@ -50,6 +50,8 @@ namespace {
|
|
|
|
// Keep in sync with web_app_frame_toolbar_browsertest.cc
|
|
|
|
constexpr double kTitlePaddingWidthFraction = 0.1;
|
|
|
|
|
|
|
|
+constexpr int kResizeHandleHeight = 1;
|
|
|
|
+
|
|
|
|
// Empirical measurements of the traffic lights.
|
|
|
|
constexpr int kCaptionButtonsWidth = 52;
|
2024-11-18 06:48:10 -03:00
|
|
|
constexpr int kCaptionButtonsLeadingPadding = 20;
|
|
|
|
@@ -224,7 +226,46 @@ void BrowserNonClientFrameViewMac::LayoutWebAppWindowTitle(
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int BrowserNonClientFrameViewMac::GetTopInset(bool restored) const {
|
|
|
|
- return 0;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ if (!browser_view()->ShouldDrawTabStrip()) {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Mac seems to reserve 1 DIP of the top inset as a resize handle.
|
|
|
|
+ const int kTabstripTopInset = 8;
|
|
|
|
+ int top_inset = kTabstripTopInset;
|
|
|
|
+ if (EverHasVisibleBackgroundTabShapes()) {
|
|
|
|
+ top_inset =
|
|
|
|
+ std::max(top_inset, BrowserNonClientFrameView::kMinimumDragHeight +
|
|
|
|
+ kResizeHandleHeight);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Immersive fullscreen attaches the tab strip to the title bar, no need to
|
|
|
|
+ // calculate the y_offset below.
|
|
|
|
+ if (browser_view()->UsesImmersiveFullscreenMode()) {
|
|
|
|
+ return top_inset;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Calculate the y offset for the tab strip because in fullscreen mode the tab
|
|
|
|
+ // strip may need to move under the slide down menu bar.
|
|
|
|
+ CGFloat y_offset = TopUIFullscreenYOffset();
|
|
|
|
+ if (y_offset > 0) {
|
|
|
|
+ // When menubar shows up, we need to update mouse tracking area.
|
|
|
|
+ NSWindow* window = GetWidget()->GetNativeWindow().GetNativeNSWindow();
|
|
|
|
+ NSRect content_bounds = [[window contentView] bounds];
|
|
|
|
+ // Backing bar tracking area uses native coordinates.
|
|
|
|
+ CGFloat tracking_height =
|
|
|
|
+ FullscreenBackingBarHeight() + top_inset + y_offset;
|
|
|
|
+ NSRect backing_bar_area =
|
|
|
|
+ NSMakeRect(0, NSMaxY(content_bounds) - tracking_height,
|
|
|
|
+ NSWidth(content_bounds), tracking_height);
|
|
|
|
+ [fullscreen_toolbar_controller_ updateToolbarFrame:backing_bar_area];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return y_offset + top_inset;
|
|
|
|
+ } else {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
void BrowserNonClientFrameViewMac::UpdateFullscreenTopUI() {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -485,6 +526,21 @@ void BrowserNonClientFrameViewMac::PaintThemedFrame(gfx::Canvas* canvas) {
|
2024-09-24 23:18:15 -03:00
|
|
|
canvas->DrawImageInt(overlay, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
+CGFloat BrowserNonClientFrameViewMac::FullscreenBackingBarHeight() const {
|
|
|
|
+ BrowserView* browser_view = this->browser_view();
|
|
|
|
+ DCHECK(browser_view->IsFullscreen());
|
|
|
|
+
|
|
|
|
+ CGFloat total_height = 0;
|
|
|
|
+ if (browser_view->ShouldDrawTabStrip()) {
|
|
|
|
+ total_height += browser_view->GetTabStripHeight();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (browser_view->IsToolbarVisible())
|
|
|
|
+ total_height += browser_view->toolbar()->bounds().height();
|
|
|
|
+
|
|
|
|
+ return total_height;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
int BrowserNonClientFrameViewMac::TopUIFullscreenYOffset() const {
|
|
|
|
if (!browser_view()->GetTabStripVisible() ||
|
|
|
|
!browser_view()->IsFullscreen() ||
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index c3241e411d46d..2119bfe02bc32 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -1239,6 +1239,10 @@ bool BrowserView::UsesImmersiveFullscreenTabbedMode() const {
|
2024-11-18 05:04:15 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
TabSearchBubbleHost* BrowserView::GetTabSearchBubbleHost() {
|
|
|
|
+ if (auto* tab_search_host =
|
|
|
|
+ frame_->GetFrameView()->GetTabSearchBubbleHost()) {
|
|
|
|
+ return tab_search_host;
|
|
|
|
+ }
|
|
|
|
if (auto* tab_search_container =
|
|
|
|
tab_strip_region_view_->tab_search_container()) {
|
|
|
|
return tab_search_container->tab_search_button()->tab_search_bubble_host();
|
2024-11-18 06:48:10 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
|
|
|
|
index cb14b46b727ca..c6523a0985809 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
|
|
|
|
@@ -606,7 +606,7 @@ int BrowserViewLayout::LayoutTabStripRegion(int top) {
|
|
|
|
// anything to the left of it, like the incognito avatar.
|
|
|
|
gfx::Rect tab_strip_region_bounds(
|
|
|
|
delegate_->GetBoundsForTabStripRegionInBrowserView());
|
|
|
|
- if (is_compact_mode_) {
|
|
|
|
+ if (is_compact_mode_ && !features::IsThorium2024()) {
|
|
|
|
constexpr int retain_some_padding = 2;
|
|
|
|
int height = GetLayoutConstant(TAB_STRIP_HEIGHT) -
|
|
|
|
GetLayoutConstant(TAB_STRIP_PADDING) + retain_some_padding;
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 4c5356d8f20f6..ccbe7a8ead81e 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -257,7 +257,9 @@ void OpaqueBrowserFrameView::LayoutWebAppWindowTitle(
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int OpaqueBrowserFrameView::GetTopInset(bool restored) const {
|
|
|
|
- return layout_->NonClientTopHeight(restored);
|
2024-10-11 21:50:44 -03:00
|
|
|
+ return browser_view()->ShouldDrawTabStrip() && features::IsThorium2024()
|
2024-09-24 23:18:15 -03:00
|
|
|
+ ? layout_->GetTabStripInsetsTop(restored)
|
|
|
|
+ : layout_->NonClientTopHeight(restored);
|
|
|
|
}
|
|
|
|
|
|
|
|
void OpaqueBrowserFrameView::UpdateThrobber(bool running) {
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 5c82d24686e9f..2e7d5d0bbf04e 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
|
|
|
|
@@ -78,7 +78,7 @@ gfx::Rect OpaqueBrowserFrameViewLayout::GetBoundsForTabStripRegion(
|
|
|
|
int total_width) const {
|
|
|
|
const int x = available_space_leading_x_;
|
|
|
|
const int available_width = available_space_trailing_x_ - x;
|
|
|
|
- return gfx::Rect(x, NonClientTopHeight(false), std::max(0, available_width),
|
|
|
|
+ return gfx::Rect(x, GetTabStripInsetsTop(false), std::max(0, available_width),
|
|
|
|
tabstrip_minimum_size.height());
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -181,6 +181,15 @@ int OpaqueBrowserFrameViewLayout::NonClientTopHeight(bool restored) const {
|
|
|
|
kContentEdgeShadowThickness;
|
|
|
|
}
|
|
|
|
|
|
|
|
+int OpaqueBrowserFrameViewLayout::GetTabStripInsetsTop(bool restored) const {
|
|
|
|
+ const int top = NonClientTopHeight(restored);
|
|
|
|
+ const bool start_at_top_of_frame = !restored &&
|
|
|
|
+ delegate_->IsFrameCondensed() &&
|
|
|
|
+ features::IsThorium2024();
|
|
|
|
+ return start_at_top_of_frame ? top
|
|
|
|
+ : (top + GetNonClientRestoredExtraThickness());
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
gfx::Insets OpaqueBrowserFrameViewLayout::FrameEdgeInsets(bool restored) const {
|
|
|
|
return IsFrameEdgeVisible(restored) ? RestoredFrameEdgeInsets()
|
|
|
|
: gfx::Insets();
|
|
|
|
@@ -190,7 +199,12 @@ int OpaqueBrowserFrameViewLayout::DefaultCaptionButtonY(bool restored) const {
|
|
|
|
// Maximized buttons start at window top, since the window has no border. This
|
|
|
|
// offset is for the image (the actual clickable bounds extend all the way to
|
|
|
|
// the top to take Fitts' Law into account).
|
|
|
|
- return views::NonClientFrameView::kFrameShadowThickness;
|
|
|
|
+ const bool start_at_top_of_frame = !restored &&
|
|
|
|
+ delegate_->IsFrameCondensed() &&
|
|
|
|
+ features::IsThorium2024();
|
|
|
|
+ return start_at_top_of_frame
|
|
|
|
+ ? FrameBorderInsets(false).top()
|
|
|
|
+ : views::NonClientFrameView::kFrameShadowThickness;
|
|
|
|
}
|
|
|
|
|
|
|
|
int OpaqueBrowserFrameViewLayout::CaptionButtonY(views::FrameButton button_id,
|
2024-11-19 13:58:44 -03:00
|
|
|
@@ -236,6 +250,22 @@ int OpaqueBrowserFrameViewLayout::GetWindowCaptionSpacing(
|
2024-09-24 23:18:15 -03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+int OpaqueBrowserFrameViewLayout::GetNonClientRestoredExtraThickness() const {
|
|
|
|
+ // In Refresh, the tabstrip controls its own top padding.
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ // Besides the frame border, there's empty space atop the window in restored
|
|
|
|
+ // mode, to use to drag the window around.
|
2024-11-19 13:58:44 -03:00
|
|
|
+ constexpr int kNonClientRestoredExtraThickness = 8;
|
|
|
|
+ int thickness = kNonClientRestoredExtraThickness;
|
2024-09-24 23:18:15 -03:00
|
|
|
+ if (delegate_->EverHasVisibleBackgroundTabShapes()) {
|
|
|
|
+ thickness =
|
|
|
|
+ std::max(thickness, BrowserNonClientFrameView::kMinimumDragHeight);
|
|
|
|
+ }
|
|
|
|
+ return thickness;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void OpaqueBrowserFrameViewLayout::SetWindowControlsOverlayEnabled(
|
|
|
|
bool enabled,
|
|
|
|
views::View* host) {
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h
|
|
|
|
index 707226e0e8c70..5e1a2b4dd9921 100644
|
|
|
|
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h
|
|
|
|
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h
|
|
|
|
@@ -89,6 +89,8 @@ class OpaqueBrowserFrameViewLayout : public views::LayoutManager {
|
|
|
|
// if the window was restored, regardless of its current state.
|
|
|
|
int NonClientTopHeight(bool restored) const;
|
|
|
|
|
|
|
|
+ int GetTabStripInsetsTop(bool restored) const;
|
|
|
|
+
|
|
|
|
// Returns the y-coordinate of the caption button when native frame buttons
|
|
|
|
// are disabled. If |restored| is true, acts as if the window is restored
|
|
|
|
// regardless of the real mode.
|
|
|
|
@@ -125,6 +127,9 @@ class OpaqueBrowserFrameViewLayout : public views::LayoutManager {
|
|
|
|
|
|
|
|
const gfx::Rect& client_view_bounds() const { return client_view_bounds_; }
|
|
|
|
|
|
|
|
+ // Returns the extra thickness of the area above the tabs.
|
|
|
|
+ int GetNonClientRestoredExtraThickness() const;
|
|
|
|
+
|
|
|
|
// Enables or disables WCO and updates child views accordingly.
|
|
|
|
void SetWindowControlsOverlayEnabled(bool enabled, views::View* host);
|
|
|
|
|
2024-08-14 23:30:11 -04:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.cc b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
2024-11-25 13:25:03 -03:00
|
|
|
index e7660352853f2..e36d7b187168d 100644
|
2024-08-14 23:30:11 -04:00
|
|
|
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -19,6 +19,7 @@
|
2024-11-18 05:04:15 -03:00
|
|
|
#include "chrome/browser/ui/ui_features.h"
|
|
|
|
#include "chrome/browser/ui/views/chrome_layout_provider.h"
|
|
|
|
#include "chrome/browser/ui/views/commerce/product_specifications_button.h"
|
|
|
|
+#include "chrome/browser/ui/views/frame/window_caption_util.h"
|
|
|
|
#include "chrome/browser/ui/views/tab_search_bubble_host.h"
|
|
|
|
#include "chrome/browser/ui/views/tabs/new_tab_button.h"
|
|
|
|
#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -115,7 +116,8 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
2024-10-03 08:24:53 -03:00
|
|
|
|
|
|
|
// Add and configure the TabSearchContainer.
|
|
|
|
std::unique_ptr<TabSearchContainer> tab_search_container;
|
|
|
|
- if (browser && browser->is_type_normal()) {
|
|
|
|
+ if (browser && browser->is_type_normal() &&
|
|
|
|
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
|
|
|
|
tab_search_container = std::make_unique<TabSearchContainer>(
|
|
|
|
tab_strip_->controller(), browser->tab_strip_model(),
|
2024-11-18 06:48:10 -03:00
|
|
|
render_tab_search_before_tab_strip_, this,
|
|
|
|
@@ -192,7 +194,10 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
|
|
|
tab_strip_->controller(),
|
|
|
|
base::BindRepeating(&TabStrip::NewTabButtonPressed,
|
|
|
|
base::Unretained(tab_strip_)),
|
|
|
|
- vector_icons::kAddIcon);
|
|
|
|
+ features::IsThorium2024()
|
|
|
|
+ ? kAddIcon
|
2024-11-23 16:43:11 -03:00
|
|
|
+ : vector_icons::kAddIcon
|
2024-11-18 06:48:10 -03:00
|
|
|
+ );
|
2024-11-18 05:04:15 -03:00
|
|
|
tab_strip_control_button->SetProperty(views::kElementIdentifierKey,
|
|
|
|
kNewTabButtonElementId);
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -205,12 +210,10 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
2024-10-03 08:24:53 -03:00
|
|
|
|
|
|
|
// TODO(crbug.com/40118868): Revisit the macro expression once build flag
|
|
|
|
// switch of lacros-chrome is complete.
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
|
|
|
|
// The New Tab Button can be middle-clicked on Linux.
|
|
|
|
new_tab_button_->SetTriggerableEventFlags(
|
|
|
|
new_tab_button_->GetTriggerableEventFlags() |
|
|
|
|
ui::EF_MIDDLE_MOUSE_BUTTON);
|
|
|
|
-#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
reserved_grab_handle_space_ =
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -223,7 +226,9 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
2024-11-18 05:04:15 -03:00
|
|
|
|
|
|
|
SetProperty(views::kElementIdentifierKey, kTabStripRegionElementId);
|
|
|
|
|
|
|
|
- if (browser && tab_search_container && !render_tab_search_before_tab_strip_) {
|
|
|
|
+ if (browser && tab_search_container &&
|
|
|
|
+ !WindowCaptionUtil::IsWindowsTabSearchCaptionButtonEnabled(browser) &&
|
|
|
|
+ !render_tab_search_before_tab_strip_) {
|
|
|
|
if (product_specifications_button) {
|
|
|
|
product_specifications_button_ =
|
|
|
|
AddChildView(std::move(product_specifications_button));
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -231,7 +236,7 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip)
|
2024-09-24 07:56:24 -03:00
|
|
|
tab_search_container_ = AddChildView(std::move(tab_search_container));
|
|
|
|
tab_search_container_->SetProperty(
|
|
|
|
views::kMarginsKey,
|
|
|
|
- gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_STRIP_PADDING)));
|
|
|
|
+ gfx::Insets::TLBR(0, 0, 0, GetLayoutConstant(TAB_SEARCH_PADDING)));
|
|
|
|
}
|
2024-08-17 08:28:28 -04:00
|
|
|
|
2024-09-24 07:56:24 -03:00
|
|
|
UpdateTabStripMargin();
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -369,27 +374,49 @@ void TabStripRegionView::Layout(PassKey) {
|
2024-10-11 19:33:00 -03:00
|
|
|
// The NTB needs to be layered on top of the tabstrip to achieve negative
|
|
|
|
// margins.
|
|
|
|
gfx::Size new_tab_button_size = new_tab_button_->GetPreferredSize();
|
|
|
|
+ int Th24XOffset;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ Th24XOffset = 4;
|
|
|
|
+ } else {
|
|
|
|
+ Th24XOffset = GetLayoutConstant(TAB_MARGIN);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// The y position is measured from the bottom of the tabstrip, and then
|
2024-11-18 06:48:10 -03:00
|
|
|
// padding and button height are removed.
|
|
|
|
int x = tab_strip_container_->bounds().right() -
|
|
|
|
TabStyle::Get()->GetBottomCornerRadius() +
|
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
+ Th24XOffset;
|
|
|
|
|
|
|
|
if (base::FeatureList::IsEnabled(features::kCompactMode)) {
|
|
|
|
if (profile_->GetPrefs()->GetBoolean(prefs::kCompactModeEnabled)) {
|
|
|
|
- x -= GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
+ x -= Th24XOffset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- gfx::Point new_tab_button_new_position = gfx::Point(x, 0);
|
2024-11-19 13:58:44 -03:00
|
|
|
+ gfx::Point new_tab_button_new_position = gfx::Point(x, GetLayoutConstant(TAB_BUTTON_OFFSET));
|
2024-08-14 23:30:11 -04:00
|
|
|
|
2024-11-18 05:04:15 -03:00
|
|
|
- gfx::Rect new_tab_button_new_bounds =
|
|
|
|
+ const gfx::Rect new_tab_button_new_bounds =
|
2024-09-20 19:45:14 -03:00
|
|
|
gfx::Rect(new_tab_button_new_position, new_tab_button_size);
|
2024-11-18 05:04:15 -03:00
|
|
|
|
|
|
|
// If the tabsearch button is before the tabstrip container, then manually
|
|
|
|
// set the bounds.
|
|
|
|
new_tab_button_->SetBoundsRect(new_tab_button_new_bounds);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ if (tab_search_container_ && !render_tab_search_before_tab_strip_ && features::IsThorium2024()) {
|
|
|
|
+ gfx::Size tab_search_container_size = tab_search_container_->GetPreferredSize();
|
|
|
|
+ const int tab_search_container_width = tab_search_container_->GetPreferredSize().width();
|
|
|
|
+ gfx::Point tab_search_container_new_position =
|
|
|
|
+ gfx::Point(tab_search_container_->bounds().right() -
|
|
|
|
+ tab_search_container_width,
|
|
|
|
+ GetLayoutConstant(TAB_BUTTON_OFFSET));
|
|
|
|
+
|
|
|
|
+ const gfx::Rect tab_search_container_new_bounds =
|
|
|
|
+ gfx::Rect(tab_search_container_new_position, tab_search_container_size);
|
|
|
|
+
|
|
|
|
+ // If the tabsearch button is before the tabstrip container, then manually
|
|
|
|
+ // set the bounds.
|
|
|
|
+ tab_search_container_->SetBoundsRect(tab_search_container_new_bounds);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TabStripRegionView::CanDrop(const OSExchangeData& data) {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -519,7 +546,7 @@ void TabStripRegionView::UpdateTabStripMargin() {
|
2024-08-17 08:28:28 -04:00
|
|
|
new_tab_button_->SetProperty(views::kViewIgnoredByLayoutKey, true);
|
2024-08-16 23:32:34 -04:00
|
|
|
|
2024-08-17 08:28:28 -04:00
|
|
|
tab_strip_right_margin = new_tab_button_->GetPreferredSize().width() +
|
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
+ GetLayoutConstant(TAB_MARGIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the tab search button is before the tab strip, it also overlaps the
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -545,8 +572,8 @@ void TabStripRegionView::UpdateTabStripMargin() {
|
2024-08-17 08:28:28 -04:00
|
|
|
// should have 6 px of padding between it and the tab_search button (not
|
|
|
|
// including the corner radius).
|
|
|
|
tab_strip_left_margin = tab_strip_left_margin.value() +
|
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING) +
|
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING) -
|
|
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING) +
|
|
|
|
+ GetLayoutConstant(TAB_INACTIVE_PADDING) -
|
|
|
|
TabStyle::Get()->GetBottomCornerRadius();
|
|
|
|
}
|
2024-08-16 23:32:34 -04:00
|
|
|
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -564,7 +591,7 @@ void TabStripRegionView::AdjustViewBoundsRect(View* view, int offset) {
|
2024-10-11 19:33:00 -03:00
|
|
|
const gfx::Size view_size = view->GetPreferredSize();
|
|
|
|
const int x =
|
|
|
|
tab_strip_container_->x() + TabStyle::Get()->GetBottomCornerRadius() -
|
2024-11-25 13:25:03 -03:00
|
|
|
- GetLayoutConstant(TAB_STRIP_PADDING) - view_size.width() - offset;
|
|
|
|
+ GetLayoutConstant(TAB_SEARCH_PADDING) - view_size.width() - offset;
|
2024-10-11 19:33:00 -03:00
|
|
|
const gfx::Rect new_bounds = gfx::Rect(gfx::Point(x, 0), view_size);
|
|
|
|
view->SetBoundsRect(new_bounds);
|
2024-11-25 13:25:03 -03:00
|
|
|
}
|
2024-11-18 07:00:08 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/window_caption_util.cc b/chrome/browser/ui/views/frame/window_caption_util.cc
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000..04703d70ecf9b
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/views/frame/window_caption_util.cc
|
2024-11-22 19:22:47 -03:00
|
|
|
@@ -0,0 +1,26 @@
|
2024-11-18 07:00:08 -03:00
|
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#include "chrome/browser/ui/views/frame/window_caption_util.h"
|
|
|
|
+
|
|
|
|
+#include "build/build_config.h"
|
|
|
|
+#include "chrome/browser/ui/browser.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
+
|
|
|
|
+// static
|
|
|
|
+bool WindowCaptionUtil::IsWindowsTabSearchCaptionButtonEnabled(
|
|
|
|
+ const Browser* browser) {
|
|
|
|
+#if BUILDFLAG(IS_WIN)
|
|
|
|
+ static const bool remove_tabsearch_button =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
|
|
|
|
+ static const bool disable_caption_button =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("disable-caption-button");
|
2024-11-22 19:22:47 -03:00
|
|
|
+ static const bool left_aligned_tab_search_button =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("left-aligned-tab-search-button");
|
2024-11-18 07:00:08 -03:00
|
|
|
+ return features::IsThorium2024() && browser->is_type_normal() &&
|
2024-11-22 19:22:47 -03:00
|
|
|
+ !remove_tabsearch_button && !disable_caption_button && !left_aligned_tab_search_button;
|
2024-11-18 07:00:08 -03:00
|
|
|
+#else
|
|
|
|
+ return false;
|
|
|
|
+#endif // BUILDFLAG(IS_WIN)
|
|
|
|
+}
|
|
|
|
diff --git a/chrome/browser/ui/views/frame/window_caption_util.h b/chrome/browser/ui/views/frame/window_caption_util.h
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000..92e166d7ca93c
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/views/frame/window_caption_util.h
|
|
|
|
@@ -0,0 +1,21 @@
|
|
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_WINDOW_CAPTION_UTIL_H_
|
|
|
|
+#define CHROME_BROWSER_UI_VIEWS_FRAME_WINDOW_CAPTION_UTIL_H_
|
|
|
|
+
|
|
|
|
+class Browser;
|
|
|
|
+
|
|
|
|
+// Static-only class containing values and helper functions for frame classes
|
|
|
|
+// that need to be accessible outside of /browser/ui/views.
|
|
|
|
+class WindowCaptionUtil {
|
|
|
|
+ public:
|
|
|
|
+ // Returns true if the Windows caption button is enabled.
|
|
|
|
+ static bool IsWindowsTabSearchCaptionButtonEnabled(const Browser* browser);
|
|
|
|
+
|
|
|
|
+ private:
|
|
|
|
+ WindowCaptionUtil() {}
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#endif // CHROME_BROWSER_UI_VIEWS_FRAME_WINDOW_CAPTION_UTIL_H_
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/frame/windows_caption_button.cc b/chrome/browser/ui/views/frame/windows_caption_button.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index d8000f801d188..7f69dd091d42a 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/frame/windows_caption_button.cc
|
|
|
|
+++ b/chrome/browser/ui/views/frame/windows_caption_button.cc
|
|
|
|
@@ -14,6 +14,7 @@
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_frame_view_win.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_view.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
|
|
|
|
+#include "chrome/browser/ui/views/frame/window_caption_util.h"
|
|
|
|
#include "chrome/grit/theme_resources.h"
|
|
|
|
#include "ui/base/metadata/metadata_impl_macros.h"
|
|
|
|
#include "ui/base/theme_provider.h"
|
|
|
|
@@ -155,16 +156,22 @@ int WindowsCaptionButton::GetBetweenButtonSpacing() const {
|
|
|
|
|
|
|
|
int WindowsCaptionButton::GetButtonDisplayOrderIndex() const {
|
|
|
|
int button_display_order = 0;
|
|
|
|
+ const bool tab_search_enabled =
|
|
|
|
+ WindowCaptionUtil::IsWindowsTabSearchCaptionButtonEnabled(
|
|
|
|
+ frame_view_->browser_view()->browser());
|
|
|
|
switch (button_type_) {
|
|
|
|
- case VIEW_ID_MINIMIZE_BUTTON:
|
|
|
|
+ case VIEW_ID_TAB_SEARCH_BUTTON:
|
|
|
|
button_display_order = 0;
|
|
|
|
break;
|
|
|
|
+ case VIEW_ID_MINIMIZE_BUTTON:
|
|
|
|
+ button_display_order = 0 + (tab_search_enabled ? 1 : 0);
|
|
|
|
+ break;
|
|
|
|
case VIEW_ID_MAXIMIZE_BUTTON:
|
|
|
|
case VIEW_ID_RESTORE_BUTTON:
|
|
|
|
- button_display_order = 1;
|
|
|
|
+ button_display_order = 1 + (tab_search_enabled ? 1 : 0);
|
|
|
|
break;
|
|
|
|
case VIEW_ID_CLOSE_BUTTON:
|
|
|
|
- button_display_order = 2;
|
|
|
|
+ button_display_order = 2 + (tab_search_enabled ? 1 : 0);
|
|
|
|
break;
|
|
|
|
default:
|
2024-11-18 06:48:10 -03:00
|
|
|
NOTREACHED();
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -172,7 +179,7 @@ int WindowsCaptionButton::GetButtonDisplayOrderIndex() const {
|
|
|
|
|
|
|
|
// Reverse the ordering if we're in RTL mode
|
|
|
|
if (base::i18n::IsRTL()) {
|
|
|
|
- const int max_index = 2;
|
|
|
|
+ const int max_index = tab_search_enabled ? 3 : 2;
|
|
|
|
button_display_order = max_index - button_display_order;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -240,6 +247,10 @@ void WindowsCaptionButton::PaintSymbol(gfx::Canvas* canvas) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ case VIEW_ID_TAB_SEARCH_BUTTON:
|
|
|
|
+ icon_painter_->PaintTabSearchIcon(canvas, symbol_rect, flags);
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
default:
|
2024-11-18 06:48:10 -03:00
|
|
|
NOTREACHED();
|
2024-11-18 05:04:15 -03:00
|
|
|
}
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
2024-11-25 13:25:03 -03:00
|
|
|
index eca41f6f37b37..cb07f8510f298 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -199,18 +199,23 @@ LocationBarView::LocationBarView(Browser* browser,
|
2024-11-18 05:04:15 -03:00
|
|
|
is_popup_mode_(is_popup_mode) {
|
|
|
|
set_suppress_default_focus_handling();
|
|
|
|
if (!is_popup_mode_) {
|
|
|
|
- views::FocusRing::Install(this);
|
|
|
|
- views::FocusRing::Get(this)->SetHasFocusPredicate(
|
|
|
|
- base::BindRepeating([](const View* view) {
|
|
|
|
- const auto* v = views::AsViewClass<LocationBarView>(view);
|
|
|
|
- CHECK(v);
|
|
|
|
- // Show focus ring when the Omnibox is visibly focused and the popup
|
|
|
|
- // is closed.
|
|
|
|
- return v->omnibox_view_->model()->is_caret_visible() &&
|
|
|
|
- !v->GetOmniboxPopupView()->IsOpen();
|
|
|
|
- }));
|
|
|
|
- views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(true);
|
2024-10-03 08:24:53 -03:00
|
|
|
- views::InstallPillHighlightPathGenerator(this);
|
2024-11-18 05:04:15 -03:00
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ views::FocusRing::Install(this);
|
|
|
|
+ views::FocusRing::Get(this)->SetHasFocusPredicate(
|
|
|
|
+ base::BindRepeating([](const View* view) {
|
|
|
|
+ const auto* v = views::AsViewClass<LocationBarView>(view);
|
|
|
|
+ CHECK(v);
|
|
|
|
+ // Show focus ring when the Omnibox is visibly focused and the popup
|
|
|
|
+ // is closed.
|
|
|
|
+ return v->omnibox_view_->model()->is_caret_visible() &&
|
|
|
|
+ !v->GetOmniboxPopupView()->IsOpen();
|
|
|
|
+ }));
|
|
|
|
+ views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(true);
|
|
|
|
+ }
|
2024-10-03 08:24:53 -03:00
|
|
|
+ static const bool classic_omnibox = base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox");
|
|
|
|
+ if (!classic_omnibox) {
|
|
|
|
+ views::InstallPillHighlightPathGenerator(this);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
#if BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
|
|
|
|
if (features::IsOsLevelGeolocationPermissionSupportEnabled()) {
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -258,10 +263,16 @@ void LocationBarView::Init() {
|
|
|
|
const gfx::FontList& font_list = typography_provider.GetFont(
|
|
|
|
CONTEXT_OMNIBOX_PRIMARY, views::style::STYLE_PRIMARY);
|
|
|
|
|
|
|
|
- const gfx::FontList& omnibox_chip_font_list = typography_provider.GetFont(
|
|
|
|
- CONTEXT_OMNIBOX_PRIMARY, views::style::STYLE_BODY_4_EMPHASIS);
|
|
|
|
- const gfx::FontList& page_action_font_list = typography_provider.GetFont(
|
|
|
|
- CONTEXT_OMNIBOX_PRIMARY, views::style::STYLE_BODY_3_EMPHASIS);
|
|
|
|
+ const gfx::FontList& omnibox_chip_font_list =
|
|
|
|
+ features::IsThorium2024()
|
|
|
|
+ ? font_list
|
|
|
|
+ : typography_provider.GetFont(CONTEXT_OMNIBOX_PRIMARY,
|
|
|
|
+ views::style::STYLE_BODY_4_EMPHASIS);
|
|
|
|
+ const gfx::FontList& page_action_font_list =
|
|
|
|
+ features::IsThorium2024()
|
|
|
|
+ ? font_list
|
|
|
|
+ : typography_provider.GetFont(CONTEXT_OMNIBOX_PRIMARY,
|
|
|
|
+ views::style::STYLE_BODY_3_EMPHASIS);
|
|
|
|
|
|
|
|
auto location_icon_view =
|
|
|
|
std::make_unique<LocationIconView>(omnibox_chip_font_list, this, this);
|
|
|
|
@@ -400,12 +411,17 @@ void LocationBarView::Init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (browser_) {
|
|
|
|
+ if (sharing_hub::HasPageAction(profile_, is_popup_mode_)) {
|
|
|
|
+ params.types_enabled.push_back(PageActionIconType::kSharingHub);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
if (browser_ && !is_popup_mode_) {
|
|
|
|
params.types_enabled.push_back(PageActionIconType::kBookmarkStar);
|
2024-11-18 05:04:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
params.icon_color = color_provider->GetColor(kColorPageActionIcon);
|
|
|
|
- params.between_icon_spacing = 8;
|
|
|
|
+ params.between_icon_spacing = features::IsThorium2024() ? 6 : 8;
|
|
|
|
params.font_list = &page_action_font_list;
|
|
|
|
params.browser = browser_;
|
|
|
|
params.command_updater = command_updater();
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -438,8 +454,13 @@ bool LocationBarView::IsInitialized() const {
|
2024-10-03 08:24:53 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int LocationBarView::GetBorderRadius() const {
|
|
|
|
- return ChromeLayoutProvider::Get()->GetCornerRadiusMetric(
|
|
|
|
- views::Emphasis::kMaximum, size());
|
|
|
|
+ static const bool classic_omnibox = base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox");
|
|
|
|
+ if (classic_omnibox) {
|
|
|
|
+ return 4;
|
|
|
|
+ } else {
|
|
|
|
+ return ChromeLayoutProvider::Get()->GetCornerRadiusMetric(
|
|
|
|
+ views::Emphasis::kMaximum, size());
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<views::Background> LocationBarView::CreateRoundRectBackground(
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -703,7 +724,7 @@ void LocationBarView::Layout(PassKey) {
|
|
|
|
// The padding between the left edges of the location bar and the LHS icon
|
|
|
|
// (e.g. the page info icon, the google G icon, the selected suggestion icon,
|
|
|
|
// etc)
|
|
|
|
- int icon_left = 5;
|
|
|
|
+ int icon_left = features::IsThorium2024() ? 4 : 5;
|
|
|
|
// The padding between the LHS icon and the text.
|
|
|
|
int text_left = 8;
|
|
|
|
// Indentation to match the suggestion icons & texts.
|
|
|
|
@@ -738,7 +759,9 @@ void LocationBarView::Layout(PassKey) {
|
|
|
|
// positioned relative to them (e.g. the "bookmark added" bubble if the user
|
|
|
|
// hits ctrl-d).
|
|
|
|
const int vertical_padding =
|
|
|
|
- GetLayoutConstant(LOCATION_BAR_PAGE_INFO_ICON_VERTICAL_PADDING);
|
|
|
|
+ features::IsThorium2024()
|
|
|
|
+ ? 4
|
|
|
|
+ : GetLayoutConstant(LOCATION_BAR_PAGE_INFO_ICON_VERTICAL_PADDING);
|
|
|
|
const int trailing_decorations_edge_padding =
|
|
|
|
GetLayoutConstant(LOCATION_BAR_TRAILING_DECORATION_EDGE_PADDING);
|
|
|
|
|
|
|
|
@@ -1135,6 +1158,7 @@ gfx::Rect LocationBarView::GetLocalBoundsWithoutEndcaps() const {
|
2024-11-18 05:04:15 -03:00
|
|
|
void LocationBarView::RefreshBackground() {
|
|
|
|
const double opacity = hover_animation_.GetCurrentValue();
|
|
|
|
const bool is_caret_visible = omnibox_view_->model()->is_caret_visible();
|
|
|
|
+ const bool is_open = GetOmniboxPopupView()->IsOpen();
|
|
|
|
const bool input_in_progress =
|
|
|
|
omnibox_view_->model()->user_input_in_progress();
|
|
|
|
const bool high_contrast = GetNativeTheme()->UserHasContrastPreference();
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -1160,6 +1184,18 @@ void LocationBarView::RefreshBackground() {
|
2024-10-03 08:24:53 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
SkColor border_color = SK_ColorTRANSPARENT;
|
|
|
|
+
|
|
|
|
+ static const bool classic_omnibox = base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox");
|
2024-11-18 05:04:15 -03:00
|
|
|
+ if (classic_omnibox && !is_caret_visible) {
|
|
|
|
+ border_color = color_provider->GetColor(kColorLocationBarBorderOnMismatch);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ if (is_caret_visible && !is_open) {
|
|
|
|
+ border_color = color_provider->GetColor(ui::kColorFocusableBorderFocused);
|
|
|
|
+ }
|
2024-10-03 08:24:53 -03:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (high_contrast) {
|
|
|
|
// High contrast schemes get a border stroke even on a rounded omnibox.
|
|
|
|
border_color =
|
2024-10-11 19:33:00 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 5530486ee3bb3..352aacdbfe227 100644
|
2024-10-11 19:33:00 -03:00
|
|
|
--- a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
|
2024-10-27 16:34:01 -03:00
|
|
|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
#include "chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h"
|
|
|
|
|
|
|
|
+#include "base/command_line.h"
|
|
|
|
#include "base/functional/bind.h"
|
|
|
|
#include "base/memory/raw_ptr.h"
|
|
|
|
#include "base/ranges/algorithm.h"
|
|
|
|
@@ -139,7 +140,15 @@ class OmniboxSuggestionRowButton : public views::MdTextButton {
|
2024-10-11 19:33:00 -03:00
|
|
|
SetImageLabelSpacing(8);
|
|
|
|
SetCustomPadding(ChromeLayoutProvider::Get()->GetInsetsMetric(
|
|
|
|
INSETS_OMNIBOX_PILL_BUTTON));
|
|
|
|
- SetCornerRadius(GetLayoutConstant(TOOLBAR_CORNER_RADIUS));
|
2024-10-27 16:34:01 -03:00
|
|
|
+ static const bool classic_omnibox = base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox");
|
|
|
|
+ int corner_radius;
|
|
|
|
+ if (classic_omnibox) {
|
|
|
|
+ corner_radius = 4;
|
|
|
|
+ } else {
|
|
|
|
+ corner_radius = 8;
|
|
|
|
+ }
|
|
|
|
+ static const int kCornerRadius = corner_radius;
|
|
|
|
+ SetCornerRadius(kCornerRadius);
|
2024-10-11 19:33:00 -03:00
|
|
|
|
|
|
|
auto* const ink_drop = views::InkDrop::Get(this);
|
|
|
|
SetAnimationDuration(base::TimeDelta());
|
|
|
|
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 4bc8f9177f416..5a11b008a76bc 100644
|
2024-10-11 19:33:00 -03:00
|
|
|
--- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
|
|
|
|
+++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
|
|
|
|
@@ -244,6 +244,7 @@ RoundedOmniboxResultsFrame::RoundedOmniboxResultsFrame(
|
|
|
|
views::BubbleBorder::Shadow::STANDARD_SHADOW);
|
|
|
|
border->SetCornerRadius(corner_radius);
|
|
|
|
border->set_md_shadow_elevation(kElevation);
|
2024-11-18 05:04:15 -03:00
|
|
|
+ if (features::IsThorium2024()) { border->set_draw_border_stroke(true); }
|
2024-10-11 19:33:00 -03:00
|
|
|
SetBorder(std::move(border));
|
|
|
|
|
|
|
|
AddChildView(contents_host_.get());
|
|
|
|
@@ -275,11 +276,22 @@ void RoundedOmniboxResultsFrame::OnBeforeWidgetInit(
|
|
|
|
// static
|
|
|
|
int RoundedOmniboxResultsFrame::GetNonResultSectionHeight() {
|
|
|
|
return GetLayoutConstant(LOCATION_BAR_HEIGHT) +
|
|
|
|
- GetLocationBarAlignmentInsets().height();
|
|
|
|
+ GetNonResultSectionInsets().height();
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
gfx::Insets RoundedOmniboxResultsFrame::GetLocationBarAlignmentInsets() {
|
|
|
|
+ if (ui::TouchUiController::Get()->touch_ui()) {
|
|
|
|
+ return gfx::Insets::TLBR(6, 1, 5, 1);
|
|
|
|
+ }
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-12 23:55:35 -03:00
|
|
|
+ return gfx::Insets::VH(4, 6);
|
2024-10-11 19:33:00 -03:00
|
|
|
+ }
|
|
|
|
+ return gfx::Insets::VH(5, 6);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// static
|
|
|
|
+gfx::Insets RoundedOmniboxResultsFrame::GetNonResultSectionInsets() {
|
|
|
|
if (ui::TouchUiController::Get()->touch_ui()) {
|
|
|
|
return gfx::Insets::TLBR(6, 1, 5, 1);
|
|
|
|
}
|
|
|
|
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h
|
|
|
|
index d134918c8538e..7262833fbb715 100644
|
|
|
|
--- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h
|
|
|
|
+++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h
|
|
|
|
@@ -35,6 +35,9 @@ class RoundedOmniboxResultsFrame : public views::View {
|
|
|
|
// How the Widget is aligned relative to the location bar.
|
|
|
|
static gfx::Insets GetLocationBarAlignmentInsets();
|
|
|
|
|
|
|
|
+ // How the text area of the Widget is aligned relative to the location bar.
|
|
|
|
+ static gfx::Insets GetNonResultSectionInsets();
|
|
|
|
+
|
|
|
|
// Returns the blur region taken up by the Omnibox popup shadows.
|
|
|
|
static gfx::Insets GetShadowInsets();
|
|
|
|
|
2024-09-20 19:45:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/side_panel/side_panel_resize_area.cc b/chrome/browser/ui/views/side_panel/side_panel_resize_area.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index e65fda1bf0161..4942eeab45861 100644
|
2024-09-20 19:45:53 -03:00
|
|
|
--- a/chrome/browser/ui/views/side_panel/side_panel_resize_area.cc
|
|
|
|
+++ b/chrome/browser/ui/views/side_panel/side_panel_resize_area.cc
|
|
|
|
@@ -12,6 +12,7 @@
|
|
|
|
#include "ui/accessibility/mojom/ax_node_data.mojom.h"
|
|
|
|
#include "ui/base/l10n/l10n_util.h"
|
|
|
|
#include "ui/base/metadata/metadata_impl_macros.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/color/color_provider.h"
|
|
|
|
#include "ui/compositor/layer.h"
|
|
|
|
#include "ui/gfx/geometry/size.h"
|
2024-09-24 07:56:24 -03:00
|
|
|
@@ -32,7 +33,7 @@ SidePanelResizeHandle::SidePanelResizeHandle(SidePanel* side_panel)
|
2024-09-20 19:45:53 -03:00
|
|
|
SetCanProcessEventsWithinSubtree(false);
|
|
|
|
SetFocusBehavior(FocusBehavior::ALWAYS);
|
|
|
|
FocusRing::Install(this);
|
|
|
|
- if (lens::features::IsLensOverlayEnabled()) {
|
|
|
|
+ if (lens::features::IsLensOverlayEnabled() && !features::IsThorium2024()) {
|
|
|
|
const int resize_handle_left_margin = 2;
|
|
|
|
SetProperty(views::kMarginsKey,
|
|
|
|
gfx::Insets().set_left(resize_handle_left_margin));
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/tab_search_bubble_host.cc b/chrome/browser/ui/views/tab_search_bubble_host.cc
|
|
|
|
index fa14797259775..6031b27d539e6 100644
|
|
|
|
--- a/chrome/browser/ui/views/tab_search_bubble_host.cc
|
|
|
|
+++ b/chrome/browser/ui/views/tab_search_bubble_host.cc
|
|
|
|
@@ -202,7 +202,7 @@ bool TabSearchBubbleHost::ShowTabSearchBubble(
|
|
|
|
// Place the anchor similar to where the button would be in non-fullscreen
|
|
|
|
// mode.
|
|
|
|
const gfx::Rect bounds = button_->GetWidget()->GetWorkAreaBoundsInScreen();
|
|
|
|
- const int offset = GetLayoutConstant(TAB_STRIP_PADDING);
|
|
|
|
+ const int offset = GetLayoutConstant(TAB_INACTIVE_PADDING);
|
|
|
|
|
|
|
|
const int x = tabs::GetTabSearchTrailingTabstrip(profile_)
|
|
|
|
? bounds.right() - offset
|
2024-11-18 06:56:49 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.cc b/chrome/browser/ui/views/tabs/tab_close_button.cc
|
|
|
|
index ac335a68f3fd0..8eef7a2f256c8 100644
|
|
|
|
--- a/chrome/browser/ui/views/tabs/tab_close_button.cc
|
|
|
|
+++ b/chrome/browser/ui/views/tabs/tab_close_button.cc
|
|
|
|
@@ -38,7 +38,7 @@
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
-constexpr int kIconSize = 16;
|
|
|
|
+constexpr int kIconSize = 18;
|
|
|
|
constexpr gfx::Size kButtonSize = {28, 28};
|
|
|
|
} // namespace
|
|
|
|
|
2024-10-11 19:33:00 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_search_button.cc b/chrome/browser/ui/views/tabs/tab_search_button.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
index a42855ead9dbe..ba8b4271de1d7 100644
|
2024-10-11 19:33:00 -03:00
|
|
|
--- a/chrome/browser/ui/views/tabs/tab_search_button.cc
|
|
|
|
+++ b/chrome/browser/ui/views/tabs/tab_search_button.cc
|
|
|
|
@@ -21,6 +21,7 @@
|
|
|
|
#include "ui/views/view_class_properties.h"
|
|
|
|
|
|
|
|
namespace {
|
2024-11-19 13:58:44 -03:00
|
|
|
+//constexpr int kTh24CRTabSearchCornerRadius = 8;
|
2024-10-11 19:33:00 -03:00
|
|
|
constexpr int kCRTabSearchCornerRadius = 10;
|
|
|
|
constexpr int kCRTabSearchFlatCornerRadius = 4;
|
|
|
|
} // namespace
|
|
|
|
@@ -29,7 +30,9 @@ TabSearchButton::TabSearchButton(TabStripController* tab_strip_controller,
|
|
|
|
Edge flat_edge)
|
|
|
|
: TabStripControlButton(tab_strip_controller,
|
|
|
|
PressedCallback(),
|
|
|
|
- vector_icons::kExpandMoreIcon,
|
|
|
|
+ features::IsThorium2024()
|
|
|
|
+ ? vector_icons::kCaretDownIcon
|
|
|
|
+ : vector_icons::kExpandMoreIcon,
|
|
|
|
flat_edge),
|
|
|
|
tab_search_bubble_host_(std::make_unique<TabSearchBubbleHost>(
|
|
|
|
this,
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -42,9 +45,11 @@ TabSearchButton::TabSearchButton(TabStripController* tab_strip_controller,
|
|
|
|
|
|
|
|
SetForegroundFrameActiveColorId(kColorNewTabButtonForegroundFrameActive);
|
|
|
|
SetForegroundFrameInactiveColorId(kColorNewTabButtonForegroundFrameInactive);
|
|
|
|
- SetBackgroundFrameActiveColorId(kColorNewTabButtonCRBackgroundFrameActive);
|
|
|
|
- SetBackgroundFrameInactiveColorId(
|
|
|
|
- kColorNewTabButtonCRBackgroundFrameInactive);
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ SetBackgroundFrameActiveColorId(kColorNewTabButtonCRBackgroundFrameActive);
|
|
|
|
+ SetBackgroundFrameInactiveColorId(
|
|
|
|
+ kColorNewTabButtonCRBackgroundFrameInactive);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
UpdateColors();
|
|
|
|
}
|
|
|
|
@@ -61,7 +66,15 @@ void TabSearchButton::NotifyClick(const ui::Event& event) {
|
2024-10-11 19:33:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int TabSearchButton::GetCornerRadius() const {
|
|
|
|
- return kCRTabSearchCornerRadius;
|
|
|
|
+ static const bool rectangular_tabs =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
|
|
|
|
+ if (rectangular_tabs) {
|
|
|
|
+ return kCRTabSearchFlatCornerRadius;
|
|
|
|
+ } else {
|
|
|
|
+ return features::IsThorium2024()
|
2024-11-18 05:04:15 -03:00
|
|
|
+ ? TabStripControlButton::kButtonSize.width() / 2
|
2024-10-11 19:33:00 -03:00
|
|
|
+ : kCRTabSearchCornerRadius;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int TabSearchButton::GetFlatCornerRadius() const {
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.cc b/chrome/browser/ui/views/tabs/tab_style_views.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 65676013fece9..d45fc4f3e1754 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/tabs/tab_style_views.cc
|
|
|
|
+++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -7,10 +7,12 @@
|
|
|
|
#include <algorithm>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
+#include "base/command_line.h"
|
|
|
|
#include "base/i18n/rtl.h"
|
2024-10-27 16:34:01 -03:00
|
|
|
#include "base/memory/raw_ptr.h"
|
|
|
|
#include "base/numerics/safe_conversions.h"
|
|
|
|
#include "base/strings/strcat.h"
|
|
|
|
+#include "build/build_config.h"
|
|
|
|
#include "cc/paint/paint_record.h"
|
|
|
|
#include "cc/paint/paint_shader.h"
|
|
|
|
#include "chrome/browser/themes/theme_properties.h"
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -18,6 +20,7 @@
|
2024-09-24 23:18:15 -03:00
|
|
|
#include "chrome/browser/ui/layout_constants.h"
|
|
|
|
#include "chrome/browser/ui/tabs/tab_style.h"
|
|
|
|
#include "chrome/browser/ui/tabs/tab_types.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/browser_view.h"
|
|
|
|
#include "chrome/browser/ui/views/frame/top_container_background.h"
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -39,6 +42,7 @@
|
|
|
|
#include "ui/gfx/geometry/skia_conversions.h"
|
|
|
|
#include "ui/gfx/scoped_canvas.h"
|
|
|
|
#include "ui/views/controls/focus_ring.h"
|
|
|
|
+#include "ui/views/style/typography.h"
|
|
|
|
#include "ui/views/widget/widget.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
@@ -85,6 +89,7 @@ class TabStyleViewsImpl : public TabStyleViews {
|
|
|
|
float GetCurrentActiveOpacity() const override;
|
|
|
|
TabActive GetApparentActiveState() const override;
|
|
|
|
TabStyle::TabColors CalculateTargetColors() const override;
|
|
|
|
+ const gfx::FontList& GetFontList() const override;
|
|
|
|
void PaintTab(gfx::Canvas* canvas) const override;
|
|
|
|
void SetHoverLocation(const gfx::Point& location) override;
|
|
|
|
void ShowHover(TabStyle::ShowHoverStyle style) override;
|
|
|
|
@@ -190,6 +195,9 @@ class TabStyleViewsImpl : public TabStyleViews {
|
|
|
|
const raw_ptr<const Tab> tab_;
|
|
|
|
|
|
|
|
std::unique_ptr<GlowHoverController> hover_controller_;
|
|
|
|
+
|
|
|
|
+ gfx::FontList normal_font_;
|
|
|
|
+ gfx::FontList heavy_font_;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TabStyleViewsImpl ----------------------------------------------------------
|
|
|
|
@@ -198,7 +206,11 @@ TabStyleViewsImpl::TabStyleViewsImpl(Tab* tab)
|
|
|
|
: tab_(tab),
|
|
|
|
hover_controller_((tab && gfx::Animation::ShouldRenderRichAnimation())
|
|
|
|
? new GlowHoverController(tab)
|
|
|
|
- : nullptr) {
|
|
|
|
+ : nullptr),
|
|
|
|
+ normal_font_(views::TypographyProvider::Get().GetFont(views::style::CONTEXT_LABEL,
|
|
|
|
+ views::style::STYLE_PRIMARY)),
|
|
|
|
+ heavy_font_(views::TypographyProvider::Get().GetFont(views::style::CONTEXT_BUTTON_MD,
|
|
|
|
+ views::style::STYLE_PRIMARY)) {
|
|
|
|
// `tab_` must not be nullptr.
|
|
|
|
CHECK(tab_);
|
|
|
|
// TODO(dfried): create a new STYLE_PROMINENT or similar to use instead of
|
|
|
|
@@ -244,7 +256,8 @@ SkPath TabStyleViewsImpl::GetPath(TabStyle::PathType path_type,
|
2024-09-24 23:18:15 -03:00
|
|
|
// this. Detached tab shapes do not need to respect this.
|
|
|
|
if (path_type != TabStyle::PathType::kInteriorClip &&
|
|
|
|
path_type != TabStyle::PathType::kHitTest) {
|
|
|
|
- tab_height -= GetLayoutConstant(TAB_STRIP_PADDING) * scale;
|
|
|
|
+ // Keep this in Thorium
|
|
|
|
+ tab_height -= GetLayoutConstant(TAB_MARGIN) * scale;
|
|
|
|
tab_height -= GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP) * scale;
|
|
|
|
}
|
|
|
|
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -254,16 +267,19 @@ SkPath TabStyleViewsImpl::GetPath(TabStyle::PathType path_type,
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int left = aligned_bounds.x() + extension_corner_radius;
|
|
|
|
- int top = aligned_bounds.y() + GetLayoutConstant(TAB_STRIP_PADDING) * scale;
|
|
|
|
+ // Keep this in Thorium
|
|
|
|
+ int top = aligned_bounds.y() + GetLayoutConstant(TAB_INACTIVE_PADDING) * scale;
|
|
|
|
int right = aligned_bounds.right() - extension_corner_radius;
|
2024-10-11 19:33:00 -03:00
|
|
|
- const int bottom = top + tab_height;
|
2024-09-24 23:18:15 -03:00
|
|
|
+ // Keep this in Thorium
|
2024-10-11 19:33:00 -03:00
|
|
|
+ int bottom = top + tab_height;
|
2024-09-24 23:18:15 -03:00
|
|
|
|
|
|
|
// For maximized and full screen windows, extend the tab hit test to the top
|
2024-10-11 19:33:00 -03:00
|
|
|
// of the tab, encompassing the top padding. This makes it easy to click on
|
2024-09-24 23:18:15 -03:00
|
|
|
// tabs by moving the mouse to the top of the screen.
|
|
|
|
if (path_type == TabStyle::PathType::kHitTest &&
|
|
|
|
tab()->controller()->IsFrameCondensed()) {
|
|
|
|
- top -= GetLayoutConstant(TAB_STRIP_PADDING) * scale;
|
|
|
|
+ // Keep this in Thorium
|
|
|
|
+ top -= GetLayoutConstant(TAB_MARGIN) * scale;
|
|
|
|
// Don't round the top corners to avoid creating dead space between tabs.
|
|
|
|
top_content_corner_radius = 0;
|
|
|
|
}
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -298,6 +314,21 @@ SkPath TabStyleViewsImpl::GetPath(TabStyle::PathType path_type,
|
2024-09-24 23:18:15 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-09 15:09:56 -03:00
|
|
|
+ #if BUILDFLAG(IS_LINUX)
|
2024-10-27 16:34:01 -03:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-09 15:09:56 -03:00
|
|
|
+ constexpr float Th24StrokeOffset = 1.0f;
|
|
|
|
+ top -= Th24StrokeOffset;
|
2024-10-11 21:55:14 -03:00
|
|
|
+ //bottom -= Th24StrokeOffset;
|
2024-09-24 23:18:15 -03:00
|
|
|
+ }
|
2024-10-27 16:34:01 -03:00
|
|
|
+ #else
|
|
|
|
+ VLOG(0) << "Th24StrokeOffset on Windows is imperfect";
|
|
|
|
+ if (features::IsThorium2024()) {
|
2024-11-18 05:04:15 -03:00
|
|
|
+ constexpr float Th24StrokeOffset = 1.0f;
|
|
|
|
+ top -= Th24StrokeOffset;
|
2024-10-27 16:34:01 -03:00
|
|
|
+ //bottom -= Th24StrokeOffset;
|
|
|
|
+ }
|
|
|
|
+ #endif
|
2024-09-24 23:18:15 -03:00
|
|
|
+
|
|
|
|
// Radii are clockwise from top left.
|
|
|
|
const SkVector radii[4] = {
|
|
|
|
SkVector(top_content_corner_radius, top_content_corner_radius),
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -581,6 +612,18 @@ TabStyle::TabColors TabStyleViewsImpl::CalculateTargetColors() const {
|
|
|
|
close_button_focus_ring_color};
|
|
|
|
}
|
|
|
|
|
|
|
|
+const gfx::FontList& TabStyleViewsImpl::GetFontList() const {
|
|
|
|
+ // Don't want to have to keep re-computing this value.
|
|
|
|
+ static const bool prominent_dark_mode_titles =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("prominent-active-tab-titles");
|
|
|
|
+
|
|
|
|
+ if (prominent_dark_mode_titles && tab_->IsActive()) {
|
|
|
|
+ return heavy_font_;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return normal_font_;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void TabStyleViewsImpl::PaintTab(gfx::Canvas* canvas) const {
|
|
|
|
std::optional<int> active_tab_fill_id;
|
|
|
|
if (tab_->GetThemeProvider()->HasCustomImage(IDR_THEME_TOOLBAR)) {
|
|
|
|
@@ -731,6 +774,11 @@ float TabStyleViewsImpl::GetSeparatorOpacity(bool for_layout,
|
2024-09-24 23:18:15 -03:00
|
|
|
const Tab* const adjacent_tab =
|
|
|
|
tab()->controller()->GetAdjacentTab(tab(), leading ? -1 : 1);
|
|
|
|
|
|
|
|
+ // The separator should never appear at the end of the tab strip.
|
|
|
|
+ //if (!adjacent_tab && !leading) {
|
|
|
|
+ //return 1.0f;
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
const Tab* const left_tab = leading ? adjacent_tab : tab();
|
|
|
|
const Tab* const right_tab = leading ? tab() : adjacent_tab;
|
|
|
|
const bool adjacent_to_header =
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -965,6 +1013,10 @@ void TabStyleViewsImpl::PaintTabBackgroundFill(
|
2024-09-24 23:18:15 -03:00
|
|
|
cc::PaintFlags flags;
|
|
|
|
flags.setAntiAlias(true);
|
|
|
|
flags.setColor(GetCurrentTabBackgroundColor(selection_state, hovered));
|
|
|
|
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("transparent-tabs") &&
|
2024-10-27 16:34:01 -03:00
|
|
|
+ selection_state != TabStyle::TabSelectionState::kActive) {
|
2024-09-24 23:18:15 -03:00
|
|
|
+ flags.setAlphaf(0.7f);
|
2024-10-27 16:34:01 -03:00
|
|
|
+ }
|
2024-09-24 23:18:15 -03:00
|
|
|
canvas->DrawRect(gfx::ScaleToEnclosingRect(tab_->GetLocalBounds(), scale),
|
|
|
|
flags);
|
|
|
|
}
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.h b/chrome/browser/ui/views/tabs/tab_style_views.h
|
|
|
|
index 4160d9c4d503f..54ae85ef82a3e 100644
|
|
|
|
--- a/chrome/browser/ui/views/tabs/tab_style_views.h
|
|
|
|
+++ b/chrome/browser/ui/views/tabs/tab_style_views.h
|
|
|
|
@@ -48,6 +48,9 @@ class TabStyleViews {
|
|
|
|
TabStyle::RenderUnits render_units =
|
|
|
|
TabStyle::RenderUnits::kPixels) const = 0;
|
|
|
|
|
|
|
|
+ // Returns the appropriate fonts for the current theme and active state.
|
|
|
|
+ virtual const gfx::FontList& GetFontList() const = 0;
|
|
|
|
+
|
|
|
|
// Paints the tab.
|
|
|
|
virtual void PaintTab(gfx::Canvas* canvas) const = 0;
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/BUILD.gn b/chrome/browser/ui/views/toolbar/BUILD.gn
|
|
|
|
index e368f860ec9a7..b81b109035cdd 100644
|
|
|
|
--- a/chrome/browser/ui/views/toolbar/BUILD.gn
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/BUILD.gn
|
|
|
|
@@ -39,6 +39,8 @@ source_set("toolbar") {
|
|
|
|
"pinned_toolbar_button_status_indicator.h",
|
|
|
|
"reload_button.cc",
|
|
|
|
"reload_button.h",
|
|
|
|
+ "restore_tab_button.cc",
|
|
|
|
+ "restore_tab_button.h",
|
|
|
|
"toolbar_action_hover_card_bubble_view.cc",
|
|
|
|
"toolbar_action_hover_card_bubble_view.h",
|
|
|
|
"toolbar_action_hover_card_controller.cc",
|
2024-11-25 13:25:03 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.cc
|
|
|
|
index b071682471a32..94123478b7fab 100644
|
|
|
|
--- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.cc
|
|
|
|
@@ -112,7 +112,7 @@ ChromeLabsBubbleView::ChromeLabsBubbleView(views::Button* anchor_view,
|
|
|
|
SetLayoutManager(std::make_unique<views::BoxLayout>())
|
|
|
|
->SetOrientation(views::BoxLayout::Orientation::kVertical);
|
|
|
|
set_fixed_width(views::LayoutProvider::Get()->GetDistanceMetric(
|
|
|
|
- views::DISTANCE_BUBBLE_PREFERRED_WIDTH));
|
|
|
|
+ views::DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH));
|
|
|
|
set_margins(gfx::Insets(0));
|
|
|
|
SetEnableArrowKeyTraversal(true);
|
|
|
|
// Set `kDialog` to avoid the BubbleDialogDelegate returning a default of
|
|
|
|
@@ -124,7 +124,7 @@ ChromeLabsBubbleView::ChromeLabsBubbleView(views::Button* anchor_view,
|
|
|
|
// TODO(crbug.com/40797818): Currently basing this off what extension menu
|
|
|
|
// uses for sizing as suggested as an initial fix by UI. Discuss a more formal
|
|
|
|
// solution.
|
|
|
|
- constexpr int kMaxChromeLabsHeightDp = 448;
|
2024-11-26 17:24:55 -03:00
|
|
|
+ constexpr int kMaxChromeLabsHeightDp = 550;
|
2024-11-25 13:25:03 -03:00
|
|
|
auto scroll_view = std::make_unique<views::ScrollView>(
|
|
|
|
views::ScrollView::ScrollWithLayers::kEnabled);
|
|
|
|
// TODO(elainechien): Check with UI whether we want to draw overflow
|
2024-11-18 07:00:08 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/restore_tab_button.cc b/chrome/browser/ui/views/toolbar/restore_tab_button.cc
|
|
|
|
new file mode 100644
|
2024-11-25 13:25:03 -03:00
|
|
|
index 0000000000000..d80d7b69ce583
|
2024-11-18 07:00:08 -03:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/restore_tab_button.cc
|
2024-11-19 13:58:44 -03:00
|
|
|
@@ -0,0 +1,70 @@
|
2024-11-18 07:00:08 -03:00
|
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#include "chrome/browser/ui/views/toolbar/restore_tab_button.h"
|
|
|
|
+
|
2024-11-19 13:58:44 -03:00
|
|
|
+#include "base/command_line.h"
|
|
|
|
+#include "base/logging.h"
|
|
|
|
+#include "base/strings/string_number_conversions.h"
|
2024-11-18 07:00:08 -03:00
|
|
|
+#include "chrome/app/chrome_command_ids.h"
|
|
|
|
+#include "chrome/browser/command_updater.h"
|
|
|
|
+#include "chrome/browser/external_protocol/external_protocol_handler.h"
|
|
|
|
+#include "chrome/browser/ui/browser.h"
|
|
|
|
+#include "components/vector_icons/vector_icons.h"
|
|
|
|
+//#include "ui/base/l10n/l10n_util.h"
|
|
|
|
+#include "ui/base/metadata/metadata_impl_macros.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
+#include "ui/views/accessibility/view_accessibility.h"
|
|
|
|
+#include "ui/views/controls/button/button_controller.h"
|
|
|
|
+
|
|
|
|
+RestoreTabButton::RestoreTabButton(CommandUpdater* command_updater)
|
|
|
|
+ : ToolbarButton(base::BindRepeating(&RestoreTabButton::ButtonPressed,
|
|
|
|
+ base::Unretained(this))),
|
|
|
|
+ command_updater_(command_updater) {
|
|
|
|
+
|
|
|
|
+ SetIcon();
|
|
|
|
+
|
|
|
|
+ constexpr char16_t RestoreTabAccessName[] = u"Restore Tab Button";
|
|
|
|
+ GetViewAccessibility().SetName(RestoreTabAccessName);
|
|
|
|
+ constexpr char16_t RestoreTabAccessToolTipName[] = u"Restore Tab";
|
|
|
|
+ SetTooltipText(RestoreTabAccessToolTipName);
|
|
|
|
+ button_controller()->set_notify_action(
|
|
|
|
+ views::ButtonController::NotifyAction::kOnPress);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+RestoreTabButton::~RestoreTabButton() = default;
|
|
|
|
+
|
|
|
|
+void RestoreTabButton::ButtonPressed() {
|
|
|
|
+ ExternalProtocolHandler::PermitLaunchUrl();
|
|
|
|
+
|
2024-11-19 13:58:44 -03:00
|
|
|
+ int command;
|
|
|
|
+ // See chrome/app/chrome_command_ids.h for all possible commands
|
|
|
|
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("button-command")) {
|
|
|
|
+ const std::string button_command =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("button-command");
|
|
|
|
+ command = base::StringToInt(button_command, &command);
|
|
|
|
+ LOG(ERROR) << command;
|
|
|
|
+ } else {
|
|
|
|
+ command = IDC_RESTORE_TAB;
|
|
|
|
+ }
|
|
|
|
+ const int command_to_exec = command;
|
|
|
|
+
|
|
|
|
+ ExecuteBrowserCommand(command_to_exec);
|
2024-11-18 07:00:08 -03:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void RestoreTabButton::SetIcon() {
|
2024-11-19 13:58:44 -03:00
|
|
|
+ const gfx::VectorIcon& restore_icon =
|
2024-11-25 13:25:03 -03:00
|
|
|
+ vector_icons::kRestoreTabIcon;
|
2024-11-19 13:58:44 -03:00
|
|
|
+ SetVectorIcons(restore_icon, restore_icon);
|
2024-11-18 07:00:08 -03:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void RestoreTabButton::ExecuteBrowserCommand(int command) {
|
|
|
|
+ if (!command_updater_) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ command_updater_->ExecuteCommand(command);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+BEGIN_METADATA(RestoreTabButton)
|
|
|
|
+END_METADATA
|
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/restore_tab_button.h b/chrome/browser/ui/views/toolbar/restore_tab_button.h
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000..43b9476bb127c
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/restore_tab_button.h
|
|
|
|
@@ -0,0 +1,31 @@
|
|
|
|
+// Copyright 2024 The Chromium Authors and Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_RESTORE_TAB_BUTTON_H_
|
|
|
|
+#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_RESTORE_TAB_BUTTON_H_
|
|
|
|
+
|
|
|
|
+#include "base/memory/raw_ptr.h"
|
|
|
|
+#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
|
|
|
|
+#include "ui/base/metadata/metadata_header_macros.h"
|
|
|
|
+
|
|
|
|
+class CommandUpdater;
|
|
|
|
+
|
|
|
|
+class RestoreTabButton : public ToolbarButton {
|
|
|
|
+ METADATA_HEADER(RestoreTabButton, ToolbarButton)
|
|
|
|
+
|
|
|
|
+ public:
|
|
|
|
+ explicit RestoreTabButton(CommandUpdater* command_updater);
|
|
|
|
+ RestoreTabButton(const RestoreTabButton&) = delete;
|
|
|
|
+ RestoreTabButton& operator=(const RestoreTabButton&) = delete;
|
|
|
|
+ ~RestoreTabButton() override;
|
|
|
|
+
|
|
|
|
+ private:
|
|
|
|
+ void SetIcon();
|
|
|
|
+ void ButtonPressed();
|
|
|
|
+ void ExecuteBrowserCommand(int command);
|
|
|
|
+
|
|
|
|
+ raw_ptr<CommandUpdater, DanglingUntriaged> command_updater_;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_RESTORE_TAB_BUTTON_H_
|
2024-11-18 05:04:15 -03:00
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 577215577d9ac..3d63a1a714ef3 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -81,6 +81,7 @@
|
2024-11-18 05:04:15 -03:00
|
|
|
#include "chrome/browser/ui/views/toolbar/home_button.h"
|
|
|
|
#include "chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h"
|
|
|
|
#include "chrome/browser/ui/views/toolbar/reload_button.h"
|
|
|
|
+#include "chrome/browser/ui/views/toolbar/restore_tab_button.h"
|
|
|
|
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
|
|
|
|
#include "chrome/browser/ui/views/toolbar/toolbar_controller.h"
|
|
|
|
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -358,8 +359,12 @@ void ToolbarView::Init() {
|
2024-11-18 05:04:15 -03:00
|
|
|
std::unique_ptr<HomeButton> home = std::make_unique<HomeButton>(
|
|
|
|
base::BindRepeating(callback, browser_, IDC_HOME), prefs);
|
|
|
|
|
|
|
|
+ std::unique_ptr<RestoreTabButton> restore =
|
|
|
|
+ std::make_unique<RestoreTabButton>(browser_->command_controller());
|
|
|
|
+
|
|
|
|
std::unique_ptr<ExtensionsToolbarContainer> extensions_container;
|
|
|
|
std::unique_ptr<views::View> toolbar_divider;
|
|
|
|
+ std::unique_ptr<views::View> toolbar_divider2;
|
|
|
|
|
|
|
|
// Do not create the extensions or browser actions container if it is a guest
|
|
|
|
// profile (only regular and incognito profiles host extensions).
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -369,6 +374,9 @@ void ToolbarView::Init() {
|
2024-11-18 05:04:15 -03:00
|
|
|
|
|
|
|
toolbar_divider = std::make_unique<views::View>();
|
|
|
|
}
|
|
|
|
+ if (features::EnableRestoreTabButton()) {
|
|
|
|
+ toolbar_divider2 = std::make_unique<views::View>();
|
|
|
|
+ }
|
|
|
|
std::unique_ptr<media_router::CastToolbarButton> cast;
|
|
|
|
if (media_router::MediaRouterEnabled(browser_->profile()))
|
|
|
|
cast = media_router::CastToolbarButton::Create(browser_);
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -393,6 +401,15 @@ void ToolbarView::Init() {
|
2024-11-18 05:04:15 -03:00
|
|
|
reload_ = container_view_->AddChildView(std::move(reload));
|
|
|
|
home_ = container_view_->AddChildView(std::move(home));
|
|
|
|
|
|
|
|
+ if (features::EnableRestoreTabButton()) {
|
|
|
|
+ toolbar_divider2_ =
|
|
|
|
+ container_view_->AddChildView(std::move(toolbar_divider2));
|
|
|
|
+ toolbar_divider2_->SetPreferredSize(
|
|
|
|
+ gfx::Size(GetLayoutConstant(TOOLBAR_DIVIDER_WIDTH),
|
|
|
|
+ GetLayoutConstant(TOOLBAR_DIVIDER_HEIGHT)));
|
|
|
|
+ restore_ = container_view_->AddChildView(std::move(restore));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
location_bar_ = container_view_->AddChildView(std::move(location_bar));
|
|
|
|
|
|
|
|
if (extensions_container) {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -494,6 +511,18 @@ void ToolbarView::Init() {
|
2024-11-18 05:04:15 -03:00
|
|
|
browser_->profile()->IsGuestSession() ||
|
|
|
|
browser_->profile()->IsRegularProfile();
|
|
|
|
#endif
|
|
|
|
+
|
|
|
|
+ const std::string sab_value = base::CommandLine::ForCurrentProcess()->
|
|
|
|
+ GetSwitchValueASCII("show-avatar-button");
|
|
|
|
+ if (sab_value == "always") {
|
|
|
|
+ show_avatar_toolbar_button = true;
|
|
|
|
+ } else if (sab_value == "incognito-and-guest") {
|
|
|
|
+ show_avatar_toolbar_button = browser_->profile()->IsIncognitoProfile() ||
|
|
|
|
+ browser_->profile()->IsGuestSession();
|
|
|
|
+ } else if (sab_value == "never") {
|
|
|
|
+ show_avatar_toolbar_button = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
avatar_->SetVisible(show_avatar_toolbar_button);
|
|
|
|
|
|
|
|
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -1004,6 +1033,12 @@ void ToolbarView::InitLayout() {
|
2024-11-18 05:04:15 -03:00
|
|
|
gfx::Insets::VH(0, GetLayoutConstant(TOOLBAR_DIVIDER_SPACING)));
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (toolbar_divider2_) {
|
|
|
|
+ toolbar_divider2_->SetProperty(
|
|
|
|
+ views::kMarginsKey,
|
|
|
|
+ gfx::Insets::VH(0, GetLayoutConstant(TOOLBAR_DIVIDER_SPACING)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (base::FeatureList::IsEnabled(features::kResponsiveToolbar)) {
|
|
|
|
constexpr int kToolbarFlexOrderStart = 1;
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -1076,15 +1111,21 @@ void ToolbarView::LayoutCommon() {
|
2024-11-18 05:04:15 -03:00
|
|
|
app_menu_button_->SetTrailingMargin(
|
|
|
|
extend_buttons_to_edge ? interior_margin.right() : 0);
|
|
|
|
|
|
|
|
+ const SkColor toolbar_extension_separator_color =
|
|
|
|
+ GetColorProvider()->GetColor(kColorToolbarExtensionSeparatorEnabled);
|
|
|
|
+
|
|
|
|
if (toolbar_divider_ && extensions_container_) {
|
|
|
|
views::ManualLayoutUtil(layout_manager_)
|
|
|
|
.SetViewHidden(toolbar_divider_, !extensions_container_->GetVisible());
|
|
|
|
- const SkColor toolbar_extension_separator_color =
|
|
|
|
- GetColorProvider()->GetColor(kColorToolbarExtensionSeparatorEnabled);
|
|
|
|
toolbar_divider_->SetBackground(views::CreateRoundedRectBackground(
|
|
|
|
toolbar_extension_separator_color,
|
|
|
|
GetLayoutConstant(TOOLBAR_DIVIDER_CORNER_RADIUS)));
|
|
|
|
}
|
|
|
|
+ if (toolbar_divider2_) {
|
|
|
|
+ toolbar_divider2_->SetBackground(views::CreateRoundedRectBackground(
|
|
|
|
+ toolbar_extension_separator_color,
|
|
|
|
+ GetLayoutConstant(TOOLBAR_DIVIDER_CORNER_RADIUS)));
|
|
|
|
+ }
|
|
|
|
// Cast button visibility is controlled externally.
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.h b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index 1688062ae52ab..55dba3d1d4d45 100644
|
2024-11-18 05:04:15 -03:00
|
|
|
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
|
|
|
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
|
|
|
@@ -54,6 +54,7 @@ class ExtensionsToolbarCoordinator;
|
|
|
|
class ManagementToolbarButton;
|
|
|
|
class MediaToolbarButtonView;
|
|
|
|
class ReloadButton;
|
|
|
|
+class RestoreTabButton;
|
|
|
|
class PinnedToolbarActionsContainer;
|
|
|
|
class ToolbarButton;
|
|
|
|
class AvatarToolbarButtonBrowserTest;
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -162,6 +163,7 @@ class ToolbarView : public views::AccessiblePaneView,
|
2024-11-18 05:04:15 -03:00
|
|
|
ToolbarButton* forward_button() const { return forward_; }
|
|
|
|
ExtensionsToolbarButton* GetExtensionsButton() const;
|
|
|
|
ReloadButton* reload_button() const { return reload_; }
|
|
|
|
+ RestoreTabButton* restore_tab_button() const { return restore_; }
|
|
|
|
LocationBarView* location_bar() const { return location_bar_; }
|
|
|
|
CustomTabBarView* custom_tab_bar() { return custom_tab_bar_; }
|
|
|
|
BatterySaverButton* battery_saver_button() const {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -298,11 +300,13 @@ class ToolbarView : public views::AccessiblePaneView,
|
2024-11-18 05:04:15 -03:00
|
|
|
raw_ptr<ToolbarButton> back_ = nullptr;
|
|
|
|
raw_ptr<ToolbarButton> forward_ = nullptr;
|
|
|
|
raw_ptr<ReloadButton> reload_ = nullptr;
|
|
|
|
+ raw_ptr<RestoreTabButton> restore_ = nullptr;
|
|
|
|
raw_ptr<HomeButton> home_ = nullptr;
|
|
|
|
raw_ptr<CustomTabBarView> custom_tab_bar_ = nullptr;
|
|
|
|
raw_ptr<LocationBarView> location_bar_ = nullptr;
|
|
|
|
raw_ptr<ExtensionsToolbarContainer> extensions_container_ = nullptr;
|
|
|
|
raw_ptr<views::View> toolbar_divider_ = nullptr;
|
|
|
|
+ raw_ptr<views::View> toolbar_divider2_ = nullptr;
|
|
|
|
raw_ptr<ChromeLabsButton> chrome_labs_button_ = nullptr;
|
|
|
|
raw_ptr<BatterySaverButton> battery_saver_button_ = nullptr;
|
|
|
|
raw_ptr<PerformanceInterventionButton> performance_intervention_button_ =
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
index 743fd86a35a10..e7679d12e2c8d 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
|
|
|
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -49,6 +49,7 @@
|
|
|
|
#include "chrome/browser/ui/webui/policy/policy_ui.h"
|
|
|
|
#include "chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_internals_ui.h"
|
2024-10-03 08:24:53 -03:00
|
|
|
#include "chrome/browser/ui/webui/suggest_internals/suggest_internals_ui.h"
|
|
|
|
+#include "chrome/browser/ui/webui/thorium_webui.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
#include "chrome/browser/ui/webui/webui_util.h"
|
|
|
|
#include "chrome/common/buildflags.h"
|
|
|
|
#include "chrome/common/chrome_features.h"
|
|
|
|
@@ -695,6 +696,10 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
|
2024-10-03 08:24:53 -03:00
|
|
|
return &NewWebUI<privacy_sandbox_internals::PrivacySandboxInternalsUI>;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (url.host_piece() == chrome::kChromeUIEggsHost) {
|
|
|
|
+ return &NewWebUI<ThoriumWebUILoad>;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/chrome/browser/ui/webui/thorium_webui.h b/chrome/browser/ui/webui/thorium_webui.h
|
|
|
|
new file mode 100644
|
2024-11-18 06:56:49 -03:00
|
|
|
index 0000000000000..897bacb966ca8
|
2024-10-03 08:24:53 -03:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/chrome/browser/ui/webui/thorium_webui.h
|
2024-10-03 12:17:22 -03:00
|
|
|
@@ -0,0 +1,78 @@
|
2024-10-03 08:24:53 -03:00
|
|
|
+// Copyright 2024 Alex313031
|
|
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
+// found in the LICENSE file.
|
|
|
|
+
|
|
|
|
+#ifndef THORIUM_WEBUI_H_
|
|
|
|
+#define THORIUM_WEBUI_H_
|
|
|
|
+
|
|
|
|
+#include "base/memory/ref_counted_memory.h"
|
|
|
|
+#include "chrome/browser/profiles/profile.h"
|
|
|
|
+#include "content/public/browser/url_data_source.h"
|
|
|
|
+#include "content/public/browser/web_ui.h"
|
|
|
|
+#include "content/public/browser/web_ui_controller.h"
|
|
|
|
+#include "services/network/public/mojom/content_security_policy.mojom.h"
|
|
|
|
+
|
|
|
|
+class ThoriumDataSource : public content::URLDataSource {
|
|
|
|
+ public:
|
|
|
|
+ ThoriumDataSource() {}
|
|
|
|
+ ThoriumDataSource(const ThoriumDataSource&) = delete;
|
|
|
|
+ ThoriumDataSource& operator=(const ThoriumDataSource&) = delete;
|
|
|
|
+ std::string GetSource() override;
|
|
|
|
+ std::string GetMimeType(const GURL& url) override;
|
|
|
|
+ std::string GetContentSecurityPolicy(network::mojom::CSPDirectiveName directive) override;
|
|
|
|
+ void StartDataRequest(const GURL& url,
|
|
|
|
+ const content::WebContents::Getter& wc_getter,
|
|
|
|
+ GotDataCallback callback) override;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+std::string ThoriumDataSource::GetSource() { return "eggs"; }
|
|
|
|
+std::string ThoriumDataSource::GetMimeType(const GURL& url) { return "text/html"; }
|
|
|
|
+std::string ThoriumDataSource::GetContentSecurityPolicy(network::mojom::CSPDirectiveName directive) {
|
|
|
|
+ if (directive == network::mojom::CSPDirectiveName::ScriptSrc)
|
|
|
|
+ return "script-src 'unsafe-inline'";
|
|
|
|
+ return std::string();
|
|
|
|
+}
|
|
|
|
+void ThoriumDataSource::StartDataRequest(const GURL& url,
|
|
|
|
+ const content::WebContents::Getter& wc_getter,
|
|
|
|
+ GotDataCallback callback) {
|
|
|
|
+ std::string source = R"(
|
2024-10-03 12:17:22 -03:00
|
|
|
+ <html>
|
|
|
|
+ <head>
|
|
|
|
+ <title>Thorium Easter Eggs</title>
|
|
|
|
+ <meta name="color-scheme" content="light dark">
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1">
|
2024-10-18 20:17:01 -03:00
|
|
|
+ <link rel="shortcut icon" type="image/x-icon" href="chrome://theme/current-channel-logo@2x">
|
2024-10-03 12:17:22 -03:00
|
|
|
+ <style>
|
|
|
|
+ @import url(chrome://resources/css/text_defaults_md.css);
|
|
|
|
+ body { text-align: center; align-content: center; max-width: 75%; margin: auto;}
|
|
|
|
+ img { max-width: 75%; height: auto; }
|
|
|
|
+ </style>
|
|
|
|
+ </head>
|
|
|
|
+ <body>
|
|
|
|
+ <h2><u>Thorium Easter Eggs WebUI Page</u></h3>
|
|
|
|
+ <hr>
|
|
|
|
+ <p>
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_THORIUM_ELEMENT">
|
|
|
|
+ <hr>
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_THORIUM_ATOMIC">
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_CHROMIUM_QUESTION">
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_THORIUM_GUY">
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_CHROMIUM_BLANK">
|
|
|
|
+ <img src="chrome://theme/IDR_PRODUCT_AI_CHROME">
|
|
|
|
+ </p>
|
|
|
|
+ </body>
|
|
|
|
+ </html>
|
2024-10-03 08:24:53 -03:00
|
|
|
+ )";
|
|
|
|
+ std::move(callback).Run(base::MakeRefCounted<base::RefCountedString>(std::move(source)));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+class ThoriumWebUILoad : public content::WebUIController {
|
|
|
|
+ public:
|
|
|
|
+ ThoriumWebUILoad(content::WebUI* web_ui) : content::WebUIController(web_ui) {
|
|
|
|
+ content::URLDataSource::Add(Profile::FromWebUI(web_ui), std::make_unique<ThoriumDataSource>());
|
|
|
|
+ }
|
|
|
|
+ ThoriumWebUILoad(const ThoriumWebUILoad&) = delete;
|
|
|
|
+ ThoriumWebUILoad& operator=(const ThoriumWebUILoad&) = delete;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#endif // THORIUM_WEBUI_H_
|
2024-11-12 23:55:35 -03:00
|
|
|
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
|
|
|
|
index 3c569bc610124..160d1bd4090a3 100644
|
|
|
|
--- a/chrome/common/chrome_paths.cc
|
|
|
|
+++ b/chrome/common/chrome_paths.cc
|
|
|
|
@@ -59,7 +59,7 @@ const base::FilePath::CharType kFilepathSinglePrefExtensions[] =
|
|
|
|
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
|
|
FILE_PATH_LITERAL("/usr/share/google-chrome/extensions");
|
|
|
|
#else
|
|
|
|
- FILE_PATH_LITERAL("/usr/share/chromium/extensions");
|
|
|
|
+ FILE_PATH_LITERAL("/usr/share/thorium/extensions");
|
|
|
|
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
|
|
|
|
|
|
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
|
|
@@ -573,8 +573,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
- cur = cur.Append(FILE_PATH_LITERAL("Google"))
|
|
|
|
- .Append(FILE_PATH_LITERAL("Chrome"))
|
|
|
|
+ cur = cur.Append(FILE_PATH_LITERAL("Thorium"))
|
|
|
|
.Append(FILE_PATH_LITERAL("External Extensions"));
|
|
|
|
#else
|
|
|
|
if (!base::PathService::Get(base::DIR_MODULE, &cur)) {
|
|
|
|
@@ -607,7 +606,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
|
|
|
FILE_PATH_LITERAL("/Library/Google/Chrome/NativeMessagingHosts"));
|
|
|
|
#else
|
|
|
|
cur = base::FilePath(FILE_PATH_LITERAL(
|
|
|
|
- "/Library/Application Support/Chromium/NativeMessagingHosts"));
|
|
|
|
+ "/Library/Application Support/Thorium/NativeMessagingHosts"));
|
|
|
|
#endif
|
|
|
|
#else // BUILDFLAG(IS_MAC)
|
|
|
|
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
|
|
@@ -615,7 +614,7 @@ bool PathProvider(int key, base::FilePath* result) {
|
|
|
|
FILE_PATH_LITERAL("/etc/opt/chrome/native-messaging-hosts"));
|
|
|
|
#else
|
|
|
|
cur = base::FilePath(
|
|
|
|
- FILE_PATH_LITERAL("/etc/chromium/native-messaging-hosts"));
|
|
|
|
+ FILE_PATH_LITERAL("/etc/thorium/native-messaging-hosts"));
|
|
|
|
#endif
|
|
|
|
#endif // !BUILDFLAG(IS_MAC)
|
|
|
|
break;
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc
|
|
|
|
index 248b6795e8cbe..488bade160e37 100644
|
|
|
|
--- a/chrome/common/webui_url_constants.cc
|
|
|
|
+++ b/chrome/common/webui_url_constants.cc
|
|
|
|
@@ -75,6 +75,7 @@ bool IsSystemWebUIHost(std::string_view host) {
|
|
|
|
// These hosts will also be suggested by BuiltinProvider.
|
|
|
|
base::span<const base::cstring_view> ChromeURLHosts() {
|
|
|
|
static constexpr auto kChromeURLHosts = std::to_array<base::cstring_view>({
|
|
|
|
+ kChromeUIEggsHost,
|
|
|
|
kChromeUIAboutHost,
|
|
|
|
kChromeUIAccessibilityHost,
|
|
|
|
#if !BUILDFLAG(IS_ANDROID)
|
|
|
|
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index d1a8dc8342177..a407f00138376 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/chrome/common/webui_url_constants.h
|
|
|
|
+++ b/chrome/common/webui_url_constants.h
|
2024-11-18 06:56:49 -03:00
|
|
|
@@ -32,6 +32,8 @@ namespace chrome {
|
2024-10-03 08:24:53 -03:00
|
|
|
// Not all components have corresponding URLs and vice versa. Only add as
|
|
|
|
// needed.
|
|
|
|
// Please keep in alphabetical order, with OS/feature specific sections below.
|
|
|
|
+inline constexpr char kChromeUIEggsHost[] = "eggs";
|
|
|
|
+inline constexpr char kChromeUIEggsURL[] = "chrome://eggs/";
|
|
|
|
inline constexpr char kChromeUIAboutHost[] = "about";
|
|
|
|
inline constexpr char kChromeUIAboutURL[] = "chrome://about/";
|
|
|
|
inline constexpr char kChromeUIAccessCodeCastHost[] = "access-code-cast";
|
2024-10-05 08:35:55 -03:00
|
|
|
diff --git a/components/resources/search_engine_choice_scaled_resources.grdp b/components/resources/search_engine_choice_scaled_resources.grdp
|
|
|
|
index 87d186a04e66c..01beccd365540 100644
|
|
|
|
--- a/components/resources/search_engine_choice_scaled_resources.grdp
|
|
|
|
+++ b/components/resources/search_engine_choice_scaled_resources.grdp
|
|
|
|
@@ -6,6 +6,7 @@
|
|
|
|
<structure type="chrome_scaled_image" name="IDR_GOOGLE_COM_PNG" file="google_chrome/google_search_logo.png" />
|
|
|
|
</if>
|
|
|
|
<structure type="chrome_scaled_image" name="IDR_AR_YAHOO_COM_PNG" file="search_engine_choice/yahoo_com.png" />
|
|
|
|
+ <structure type="chrome_scaled_image" name="IDR_ASK_COM_PNG" file="search_engine_choice/ask_com.png" />
|
|
|
|
<structure type="chrome_scaled_image" name="IDR_AT_YAHOO_COM_PNG" file="search_engine_choice/yahoo_com.png" />
|
|
|
|
<structure type="chrome_scaled_image" name="IDR_AU_YAHOO_COM_PNG" file="search_engine_choice/yahoo_com.png" />
|
|
|
|
<structure type="chrome_scaled_image" name="IDR_BING_COM_PNG" file="search_engine_choice/bing_com.png" />
|
2024-11-24 17:56:35 -03:00
|
|
|
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
|
|
|
index 9e5567aec56dc..0e3978ff8da39 100644
|
|
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
|
|
@@ -3538,7 +3538,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-#if BUILDFLAG(IS_WIN) && !defined(OFFICIAL_BUILD)
|
|
|
|
+#if BUILDFLAG(IS_WIN) && !defined(OFFICIAL_BUILD) || BUILDFLAG(THORIUM_DEBUG)
|
|
|
|
// Needed because we can't show the dialog from the sandbox. Don't pass
|
|
|
|
// --no-sandbox in official builds because that would bypass the bad_flgs
|
|
|
|
// prompt.
|
2024-09-24 23:18:15 -03:00
|
|
|
diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc
|
2024-11-25 13:25:03 -03:00
|
|
|
index 595af68372edc..16dcfea0bc7d3 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/ui/base/ui_base_features.cc
|
|
|
|
+++ b/ui/base/ui_base_features.cc
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -498,6 +498,30 @@ bool IsLacrosColorManagementEnabled() {
|
2024-09-24 23:18:15 -03:00
|
|
|
return base::FeatureList::IsEnabled(kLacrosColorManagement);
|
|
|
|
}
|
|
|
|
|
|
|
|
+BASE_FEATURE(kThorium2024,
|
|
|
|
+ "Thorium2024",
|
|
|
|
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
|
|
|
+
|
|
|
|
+bool IsThorium2024() {
|
2024-11-18 05:04:15 -03:00
|
|
|
+ static const bool Th24flag =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("th24");
|
|
|
|
+ return base::FeatureList::IsEnabled(kThorium2024) || Th24flag;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+BASE_FEATURE(kRestoreTabButton,
|
|
|
|
+ "RestoreTabButton",
|
|
|
|
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
|
|
|
+
|
|
|
|
+bool EnableRestoreTabButton() {
|
|
|
|
+ return base::FeatureList::IsEnabled(kRestoreTabButton);
|
2024-09-24 23:18:15 -03:00
|
|
|
+}
|
2024-11-25 13:25:03 -03:00
|
|
|
+
|
|
|
|
+bool IsVerbose() {
|
|
|
|
+ static const bool is_verbose =
|
|
|
|
+ base::CommandLine::ForCurrentProcess()->HasSwitch("verbose");
|
|
|
|
+ return is_verbose;
|
|
|
|
+}
|
2024-09-24 23:18:15 -03:00
|
|
|
+
|
|
|
|
BASE_FEATURE(kBubbleMetricsApi,
|
|
|
|
"BubbleMetricsApi",
|
|
|
|
base::FEATURE_DISABLED_BY_DEFAULT);
|
|
|
|
diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h
|
2024-11-25 13:25:03 -03:00
|
|
|
index a5c3bb6349099..3944f157575c8 100644
|
2024-09-24 23:18:15 -03:00
|
|
|
--- a/ui/base/ui_base_features.h
|
|
|
|
+++ b/ui/base/ui_base_features.h
|
2024-11-25 13:25:03 -03:00
|
|
|
@@ -224,6 +224,15 @@ COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kLacrosColorManagement);
|
2024-09-24 23:18:15 -03:00
|
|
|
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
|
|
|
bool IsLacrosColorManagementEnabled();
|
|
|
|
|
|
|
|
+// Used to revert some stupid UI decisions for Cr23
|
|
|
|
+COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kThorium2024);
|
|
|
|
+COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsThorium2024();
|
2024-11-18 05:04:15 -03:00
|
|
|
+
|
|
|
|
+COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kRestoreTabButton);
|
|
|
|
+COMPONENT_EXPORT(UI_BASE_FEATURES) bool EnableRestoreTabButton();
|
2024-11-25 13:25:03 -03:00
|
|
|
+
|
|
|
|
+COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsVerbose();
|
2024-09-24 23:18:15 -03:00
|
|
|
+
|
|
|
|
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
|
|
|
BASE_DECLARE_FEATURE(kBubbleMetricsApi);
|
|
|
|
|
2024-09-27 22:24:54 -03:00
|
|
|
diff --git a/ui/linux/linux_ui_factory.cc b/ui/linux/linux_ui_factory.cc
|
|
|
|
index d21456ab73faa..de14c868fcc26 100644
|
|
|
|
--- a/ui/linux/linux_ui_factory.cc
|
|
|
|
+++ b/ui/linux/linux_ui_factory.cc
|
|
|
|
@@ -175,7 +175,7 @@ SystemTheme GetDefaultSystemTheme() {
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_PANTHEON:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_UNITY:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_XFCE:
|
|
|
|
- return SystemTheme::kGtk;
|
|
|
|
+ return SystemTheme::kDefault;
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_KDE3:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_KDE4:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_KDE5:
|
|
|
|
@@ -183,7 +183,7 @@ SystemTheme GetDefaultSystemTheme() {
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_UKUI:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_DEEPIN:
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_LXQT:
|
|
|
|
- return SystemTheme::kQt;
|
|
|
|
+ return SystemTheme::kDefault;
|
|
|
|
case base::nix::DESKTOP_ENVIRONMENT_OTHER:
|
|
|
|
return SystemTheme::kDefault;
|
|
|
|
}
|
2024-11-26 17:24:55 -03:00
|
|
|
diff --git a/ui/views/controls/button/toggle_button.cc b/ui/views/controls/button/toggle_button.cc
|
|
|
|
index 1380921296fcf..9410570b9bb83 100644
|
|
|
|
--- a/ui/views/controls/button/toggle_button.cc
|
|
|
|
+++ b/ui/views/controls/button/toggle_button.cc
|
|
|
|
@@ -11,6 +11,7 @@
|
|
|
|
#include "base/callback_list.h"
|
|
|
|
#include "base/functional/bind.h"
|
|
|
|
#include "cc/paint/paint_flags.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
#include "third_party/skia/include/core/SkRect.h"
|
|
|
|
#include "ui/accessibility/ax_enums.mojom.h"
|
|
|
|
#include "ui/accessibility/ax_node_data.h"
|
|
|
|
@@ -42,6 +43,11 @@ namespace {
|
|
|
|
|
|
|
|
// Constants are measured in dip.
|
|
|
|
constexpr gfx::Size kTrackSize = gfx::Size(26, 16);
|
|
|
|
+constexpr gfx::Size kTh24TrackSize = gfx::Size(30, 12);
|
|
|
|
+constexpr int kTrackVerticalMargin = 5;
|
|
|
|
+constexpr int kTrackHorizontalMargin = 6;
|
|
|
|
+// Inset from the rounded edge of the thumb to the rounded edge of the track.
|
|
|
|
+constexpr int kTh24ThumbInset = 2;
|
|
|
|
constexpr int kThumbInset = -4;
|
|
|
|
constexpr int kThumbInsetSelected = -2;
|
|
|
|
constexpr int kThumbPressedOutset = 1;
|
|
|
|
@@ -49,11 +55,19 @@ constexpr int kHoverDiameter = 20;
|
|
|
|
constexpr float kBorderStrokeWidth = 1.0f;
|
|
|
|
|
|
|
|
const gfx::Size GetTrackSize() {
|
|
|
|
- return kTrackSize;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return kTh24TrackSize;
|
|
|
|
+ } else {
|
|
|
|
+ return kTrackSize;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
int GetThumbInset(bool is_on) {
|
|
|
|
- return is_on ? kThumbInsetSelected : kThumbInset;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return kTh24ThumbInset;
|
|
|
|
+ } else {
|
|
|
|
+ return is_on ? kThumbInsetSelected : kThumbInset;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<SkColor> GetSkColorFromVariant(
|
|
|
|
@@ -148,7 +162,7 @@ class ToggleButton::ThumbView : public View {
|
|
|
|
ConvertVariantToSkColor(thumb_off_color_, color_provider);
|
|
|
|
SkColor thumb_color =
|
|
|
|
color_utils::AlphaBlend(thumb_on_color, thumb_off_color, color_ratio_);
|
|
|
|
- if (is_hovered_ && is_on_) {
|
|
|
|
+ if (!features::IsThorium2024() && is_hovered_ && is_on_) {
|
|
|
|
// This will blend and additional color into the "on" state thumb color
|
|
|
|
// while the view is hovered. This will also take into account both the
|
|
|
|
// off->on color animating along with the hover animation. Those
|
|
|
|
@@ -208,7 +222,7 @@ class ToggleButton::ThumbView : public View {
|
|
|
|
};
|
|
|
|
|
|
|
|
ToggleButton::ToggleButton(PressedCallback callback)
|
|
|
|
- : ToggleButton(std::move(callback), /*has_thumb_shadow=*/false) {}
|
|
|
|
+ : ToggleButton(std::move(callback), /*has_thumb_shadow=*/features::IsThorium2024()) {}
|
|
|
|
|
|
|
|
ToggleButton::ToggleButton(PressedCallback callback, bool has_thumb_shadow)
|
|
|
|
: Button(std::move(callback)) {
|
|
|
|
@@ -225,14 +239,17 @@ ToggleButton::ToggleButton(PressedCallback callback, bool has_thumb_shadow)
|
|
|
|
// InkDrop event triggering is handled in NotifyClick().
|
|
|
|
SetHasInkDropActionOnClick(false);
|
|
|
|
InkDrop::UseInkDropForSquareRipple(InkDrop::Get(this),
|
|
|
|
- /*highlight_on_hover=*/true,
|
|
|
|
+ /*highlight_on_hover=*/!features::IsThorium2024(),
|
|
|
|
/*highlight_on_focus=*/false,
|
|
|
|
- /*show_highlight_on_ripple=*/true);
|
|
|
|
+ /*show_highlight_on_ripple=*/!features::IsThorium2024());
|
|
|
|
InkDrop::Get(this)->SetCreateRippleCallback(base::BindRepeating(
|
|
|
|
[](ToggleButton* host,
|
|
|
|
gfx::Insets insets) -> std::unique_ptr<InkDropRipple> {
|
|
|
|
gfx::Rect rect = host->thumb_view_->GetLocalBounds();
|
|
|
|
rect.Inset(insets);
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ return InkDrop::Get(host)->CreateSquareRipple(rect.CenterPoint());
|
|
|
|
+ }
|
|
|
|
const SkColor pressed_color = host->GetPressedColor();
|
|
|
|
const float pressed_alpha = SkColorGetA(pressed_color);
|
|
|
|
std::unique_ptr<SquareInkDropRipple> ripple =
|
|
|
|
@@ -251,20 +268,22 @@ ToggleButton::ToggleButton(PressedCallback callback, bool has_thumb_shadow)
|
|
|
|
return host->GetTrackColor(host->GetIsOn() || host->HasFocus());
|
|
|
|
},
|
|
|
|
this));
|
|
|
|
- InkDrop::Get(this)->SetCreateHighlightCallback(base::BindRepeating(
|
|
|
|
- [](ToggleButton* host) {
|
|
|
|
- const gfx::Rect thumb_bounds = host->thumb_view_->GetLocalBounds();
|
|
|
|
- const gfx::Size thumb_size(kHoverDiameter, kHoverDiameter);
|
|
|
|
- const SkColor hover_color = host->GetHoverColor();
|
|
|
|
- const float hover_alpha = SkColorGetA(hover_color);
|
|
|
|
- auto ink_drop_highlight = std::make_unique<InkDropHighlight>(
|
|
|
|
- thumb_size, thumb_size.height() / 2,
|
|
|
|
- gfx::PointF(thumb_bounds.CenterPoint()),
|
|
|
|
- SkColorSetA(hover_color, SK_AlphaOPAQUE));
|
|
|
|
- ink_drop_highlight->set_visible_opacity(hover_alpha / SK_AlphaOPAQUE);
|
|
|
|
- return ink_drop_highlight;
|
|
|
|
- },
|
|
|
|
- this));
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ InkDrop::Get(this)->SetCreateHighlightCallback(base::BindRepeating(
|
|
|
|
+ [](ToggleButton* host) {
|
|
|
|
+ const gfx::Rect thumb_bounds = host->thumb_view_->GetLocalBounds();
|
|
|
|
+ const gfx::Size thumb_size(kHoverDiameter, kHoverDiameter);
|
|
|
|
+ const SkColor hover_color = host->GetHoverColor();
|
|
|
|
+ const float hover_alpha = SkColorGetA(hover_color);
|
|
|
|
+ auto ink_drop_highlight = std::make_unique<InkDropHighlight>(
|
|
|
|
+ thumb_size, thumb_size.height() / 2,
|
|
|
|
+ gfx::PointF(thumb_bounds.CenterPoint()),
|
|
|
|
+ SkColorSetA(hover_color, SK_AlphaOPAQUE));
|
|
|
|
+ ink_drop_highlight->set_visible_opacity(hover_alpha / SK_AlphaOPAQUE);
|
|
|
|
+ return ink_drop_highlight;
|
|
|
|
+ },
|
|
|
|
+ this));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// Even though ToggleButton doesn't paint anything, declare us as flipped in
|
|
|
|
// RTL mode so that FocusRing correctly flips as well.
|
|
|
|
@@ -370,6 +389,10 @@ bool ToggleButton::GetAcceptsEvents() const {
|
|
|
|
return accepts_events_;
|
|
|
|
}
|
|
|
|
|
|
|
|
+int ToggleButton::GetVisualHorizontalMargin() const {
|
|
|
|
+ return kTrackHorizontalMargin - kThumbInset;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void ToggleButton::AddLayerToRegion(ui::Layer* layer,
|
|
|
|
views::LayerRegion region) {
|
|
|
|
// Ink-drop layers should go above/below the ThumbView.
|
|
|
|
@@ -383,6 +406,9 @@ void ToggleButton::RemoveLayerFromRegions(ui::Layer* layer) {
|
|
|
|
gfx::Size ToggleButton::CalculatePreferredSize(
|
|
|
|
const SizeBounds& /*available_size*/) const {
|
|
|
|
gfx::Rect rect(GetTrackSize());
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ rect.Inset(gfx::Insets::VH(-kTrackVerticalMargin, -kTrackHorizontalMargin));
|
|
|
|
+ }
|
|
|
|
rect.Inset(-GetInsets());
|
|
|
|
return rect.size();
|
|
|
|
}
|
|
|
|
@@ -402,7 +428,7 @@ gfx::Rect ToggleButton::GetThumbBounds() const {
|
|
|
|
// The thumb is a circle, so the width should match the height.
|
|
|
|
thumb_bounds.set_width(thumb_bounds.height());
|
|
|
|
thumb_bounds.Inset(thumb_view_->GetShadowOutsets());
|
|
|
|
- if (GetState() == STATE_PRESSED) {
|
|
|
|
+ if (GetState() == STATE_PRESSED && !features::IsThorium2024()) {
|
|
|
|
thumb_bounds.Outset(kThumbPressedOutset);
|
|
|
|
}
|
|
|
|
return thumb_bounds;
|
|
|
|
@@ -417,7 +443,7 @@ void ToggleButton::UpdateThumb() {
|
|
|
|
static_cast<float>(slide_animation_.GetCurrentValue()),
|
|
|
|
static_cast<float>(hover_animation_.GetCurrentValue()),
|
|
|
|
GetIsOn(), IsMouseHovered());
|
|
|
|
- if (IsMouseHovered()) {
|
|
|
|
+ if (!features::IsThorium2024() && IsMouseHovered()) {
|
|
|
|
InkDrop::Get(this)->GetInkDrop()->SetHovered(
|
|
|
|
!slide_animation_.is_animating());
|
|
|
|
}
|
|
|
|
@@ -458,8 +484,10 @@ void ToggleButton::OnThemeChanged() {
|
|
|
|
void ToggleButton::NotifyClick(const ui::Event& event) {
|
|
|
|
AnimateIsOn(!GetIsOn());
|
|
|
|
|
|
|
|
- InkDrop::Get(this)->AnimateToState(InkDropState::ACTION_TRIGGERED,
|
|
|
|
- ui::LocatedEvent::FromIfValid(&event));
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ InkDrop::Get(this)->AnimateToState(InkDropState::ACTION_TRIGGERED,
|
|
|
|
+ ui::LocatedEvent::FromIfValid(&event));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
Button::NotifyClick(event);
|
|
|
|
}
|
|
|
|
@@ -482,27 +510,59 @@ void ToggleButton::StateChanged(ButtonState old_state) {
|
|
|
|
thumb_view_->SetEnabled(enabled);
|
|
|
|
|
|
|
|
// Update thumb bounds.
|
|
|
|
- if (GetState() == STATE_PRESSED || old_state == STATE_PRESSED) {
|
|
|
|
- UpdateThumb();
|
|
|
|
- } else if (GetState() == STATE_HOVERED || old_state == STATE_HOVERED) {
|
|
|
|
- if (old_state == STATE_HOVERED) {
|
|
|
|
- hover_animation_.Hide();
|
|
|
|
- } else {
|
|
|
|
- hover_animation_.Show();
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ if (GetState() == STATE_PRESSED || old_state == STATE_PRESSED) {
|
|
|
|
+ UpdateThumb();
|
|
|
|
+ } else if (GetState() == STATE_HOVERED || old_state == STATE_HOVERED) {
|
|
|
|
+ if (old_state == STATE_HOVERED) {
|
|
|
|
+ hover_animation_.Hide();
|
|
|
|
+ } else {
|
|
|
|
+ hover_animation_.Show();
|
|
|
|
+ }
|
|
|
|
+ UpdateThumb();
|
|
|
|
}
|
|
|
|
- UpdateThumb();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SkPath ToggleButton::GetFocusRingPath() const {
|
|
|
|
SkPath path;
|
|
|
|
- gfx::RectF bounds(GetTrackBounds());
|
|
|
|
- const SkRect sk_rect = gfx::RectFToSkRect(bounds);
|
|
|
|
- const float corner_radius = sk_rect.height() / 2;
|
|
|
|
- path.addRoundRect(sk_rect, corner_radius, corner_radius);
|
|
|
|
+ if (!features::IsThorium2024()) {
|
|
|
|
+ gfx::RectF bounds(GetTrackBounds());
|
|
|
|
+ const SkRect sk_rect = gfx::RectFToSkRect(bounds);
|
|
|
|
+ const float corner_radius = sk_rect.height() / 2;
|
|
|
|
+ path.addRoundRect(sk_rect, corner_radius, corner_radius);
|
|
|
|
+ } else {
|
|
|
|
+ const gfx::Point center = GetThumbBounds().CenterPoint();
|
|
|
|
+ constexpr int kFocusRingRadius = 16;
|
|
|
|
+ path.addCircle(center.x(), center.y(), kFocusRingRadius);
|
|
|
|
+ }
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
+void ToggleButton::OnFocus() {
|
|
|
|
+ Button::OnFocus();
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ InkDrop::Get(this)->AnimateToState(views::InkDropState::ACTION_PENDING,
|
|
|
|
+ nullptr);
|
|
|
|
+ SchedulePaint();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void ToggleButton::OnBlur() {
|
|
|
|
+ Button::OnBlur();
|
|
|
|
+
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ // The ink drop may have already gone away if the user clicked after
|
|
|
|
+ // focusing.
|
|
|
|
+ if (InkDrop::Get(this)->GetInkDrop()->GetTargetInkDropState() ==
|
|
|
|
+ views::InkDropState::ACTION_PENDING) {
|
|
|
|
+ InkDrop::Get(this)->AnimateToState(views::InkDropState::ACTION_TRIGGERED,
|
|
|
|
+ nullptr);
|
|
|
|
+ }
|
|
|
|
+ SchedulePaint();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void ToggleButton::PaintButtonContents(gfx::Canvas* canvas) {
|
|
|
|
// Paint the toggle track. To look sharp even at fractional scale factors,
|
|
|
|
// round up to pixel boundaries.
|
|
|
|
@@ -519,7 +579,7 @@ void ToggleButton::PaintButtonContents(gfx::Canvas* canvas) {
|
|
|
|
track_flags.setColor(color_utils::AlphaBlend(
|
|
|
|
GetTrackColor(true), GetTrackColor(false), color_ratio));
|
|
|
|
canvas->DrawRoundRect(track_rect, radius, track_flags);
|
|
|
|
- if (!GetIsOn() && inner_border_enabled_) {
|
|
|
|
+ if (!GetIsOn() && inner_border_enabled_ && !features::IsThorium2024()) {
|
|
|
|
track_rect.Inset(kBorderStrokeWidth * dsf / 2.0f);
|
|
|
|
track_flags.setColor(
|
|
|
|
GetColorProvider()->GetColor(ui::kColorToggleButtonShadow));
|
|
|
|
@@ -531,7 +591,7 @@ void ToggleButton::PaintButtonContents(gfx::Canvas* canvas) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void ToggleButton::AnimationEnded(const gfx::Animation* animation) {
|
|
|
|
- if (animation == &slide_animation_ && IsMouseHovered()) {
|
|
|
|
+ if (!features::IsThorium2024() && animation == &slide_animation_ && IsMouseHovered()) {
|
|
|
|
InkDrop::Get(this)->GetInkDrop()->SetHovered(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/ui/views/controls/button/toggle_button.h b/ui/views/controls/button/toggle_button.h
|
|
|
|
index 5c465d0f8377c..637e853bec669 100644
|
|
|
|
--- a/ui/views/controls/button/toggle_button.h
|
|
|
|
+++ b/ui/views/controls/button/toggle_button.h
|
|
|
|
@@ -58,6 +58,10 @@ class VIEWS_EXPORT ToggleButton : public Button {
|
|
|
|
void SetAcceptsEvents(bool accepts_events);
|
|
|
|
bool GetAcceptsEvents() const;
|
|
|
|
|
|
|
|
+ // Gets the horizontal margin between the rounded edge of the thumb and the
|
|
|
|
+ // edge of the view.
|
|
|
|
+ int GetVisualHorizontalMargin() const;
|
|
|
|
+
|
|
|
|
// views::View:
|
|
|
|
void AddLayerToRegion(ui::Layer* layer, LayerRegion region) override;
|
|
|
|
void RemoveLayerFromRegions(ui::Layer* layer) override;
|
|
|
|
@@ -100,6 +104,8 @@ class VIEWS_EXPORT ToggleButton : public Button {
|
|
|
|
// views::View:
|
|
|
|
bool CanAcceptEvent(const ui::Event& event) override;
|
|
|
|
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
|
|
|
|
+ void OnFocus() override;
|
|
|
|
+ void OnBlur() override;
|
|
|
|
|
|
|
|
// Button:
|
|
|
|
void PaintButtonContents(gfx::Canvas* canvas) override;
|
2024-08-14 23:30:11 -04:00
|
|
|
diff --git a/ui/views/controls/menu/menu_config.cc b/ui/views/controls/menu/menu_config.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
index cc2b21432f010..21cf9ba102902 100644
|
2024-08-14 23:30:11 -04:00
|
|
|
--- a/ui/views/controls/menu/menu_config.cc
|
|
|
|
+++ b/ui/views/controls/menu/menu_config.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -6,6 +6,7 @@
|
2024-08-14 23:30:11 -04:00
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
#include "base/debug/dump_without_crashing.h"
|
2024-08-14 23:30:11 -04:00
|
|
|
#include "base/no_destructor.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
2024-08-14 23:30:11 -04:00
|
|
|
#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/views/controls/menu/menu_controller.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
#include "ui/views/controls/menu/menu_item_view.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -73,12 +74,12 @@ void MenuConfig::InitCommon() {
|
2024-08-14 23:30:11 -04:00
|
|
|
reserve_dedicated_arrow_column = false;
|
|
|
|
menu_horizontal_border_size = 0;
|
|
|
|
submenu_horizontal_overlap = 0;
|
|
|
|
- item_vertical_margin = 6;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ item_vertical_margin = features::IsThorium2024() ? 4 : 6;
|
2024-08-14 23:30:11 -04:00
|
|
|
item_horizontal_border_padding = 12;
|
|
|
|
arrow_size = 16;
|
|
|
|
- separator_height = 17;
|
|
|
|
- separator_spacing_height = 4;
|
|
|
|
- use_outer_border = false;
|
2024-08-22 11:02:48 -04:00
|
|
|
+ separator_height = features::IsThorium2024() ? 11 : 17;
|
|
|
|
+ separator_spacing_height = features::IsThorium2024() ? 3 : 4;
|
|
|
|
+ use_outer_border = features::IsThorium2024() ? true : false;
|
2024-08-14 23:30:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2024-10-27 16:34:01 -03:00
|
|
|
diff --git a/ui/views/controls/menu/menu_config.h b/ui/views/controls/menu/menu_config.h
|
|
|
|
index b087f25b78c94..415c96a2ba60b 100644
|
|
|
|
--- a/ui/views/controls/menu/menu_config.h
|
|
|
|
+++ b/ui/views/controls/menu/menu_config.h
|
|
|
|
@@ -167,7 +167,7 @@ struct VIEWS_EXPORT MenuConfig {
|
|
|
|
|
|
|
|
// Delay, in ms, between when menus are selected or moused over and the menu
|
|
|
|
// appears.
|
|
|
|
- int show_delay = 400;
|
|
|
|
+ int show_delay = 1;
|
|
|
|
|
|
|
|
// Radius of the rounded corners of the menu border. Must be >= 0.
|
|
|
|
int corner_radius = LayoutProvider::Get()->GetCornerRadiusMetric(
|
2024-09-01 14:35:00 -04:00
|
|
|
diff --git a/ui/views/controls/menu/menu_config_linux.cc b/ui/views/controls/menu/menu_config_linux.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
index 09c03d1e87011..31fda3a23bbf5 100644
|
2024-09-01 14:35:00 -04:00
|
|
|
--- a/ui/views/controls/menu/menu_config_linux.cc
|
|
|
|
+++ b/ui/views/controls/menu/menu_config_linux.cc
|
2024-09-24 23:18:15 -03:00
|
|
|
@@ -4,12 +4,16 @@
|
2024-09-01 14:35:00 -04:00
|
|
|
|
|
|
|
#include "ui/views/controls/menu/menu_config.h"
|
|
|
|
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/ozone/public/ozone_platform.h"
|
|
|
|
|
|
|
|
namespace views {
|
2024-09-06 19:37:25 -04:00
|
|
|
|
2024-09-01 14:35:00 -04:00
|
|
|
void MenuConfig::InitPlatform() {
|
2024-09-24 07:56:24 -03:00
|
|
|
- use_bubble_border = true;
|
2024-10-11 21:55:14 -03:00
|
|
|
+ use_bubble_border = features::IsThorium2024() ? false : corner_radius > 0;
|
2024-09-06 19:37:25 -04:00
|
|
|
+ arrow_to_edge_padding = features::IsThorium2024() ? 2 : 8;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ separator_height = features::IsThorium2024() ? 7 : 17;
|
2024-09-01 14:35:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace views
|
|
|
|
diff --git a/ui/views/controls/menu/menu_config_mac.mm b/ui/views/controls/menu/menu_config_mac.mm
|
2024-11-18 06:56:49 -03:00
|
|
|
index eabfb364890d3..c17ad57190ef1 100644
|
2024-09-01 14:35:00 -04:00
|
|
|
--- a/ui/views/controls/menu/menu_config_mac.mm
|
|
|
|
+++ b/ui/views/controls/menu/menu_config_mac.mm
|
|
|
|
@@ -1,17 +1,55 @@
|
|
|
|
-// Copyright 2014 The Chromium Authors
|
2024-11-18 05:04:15 -03:00
|
|
|
+// Copyright 2024 The Chromium Authors
|
2024-09-01 14:35:00 -04:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
+#import <AppKit/AppKit.h>
|
|
|
|
+
|
|
|
|
+#include "base/mac/mac_util.h"
|
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/views/controls/menu/menu_config.h"
|
|
|
|
|
|
|
|
+#include "ui/gfx/platform_font_mac.h"
|
|
|
|
+
|
|
|
|
+namespace {
|
|
|
|
+
|
|
|
|
+void InitMaterialMenuConfig(views::MenuConfig* config) {
|
|
|
|
+ // These config parameters are from https://crbug.com/829347 and the spec
|
|
|
|
+ // images linked from that bug.
|
|
|
|
+ config->submenu_horizontal_overlap = 0;
|
|
|
|
+ config->minimum_text_item_height = 28;
|
|
|
|
+ config->minimum_container_item_height = 40;
|
|
|
|
+ config->arrow_to_edge_padding = 16;
|
|
|
|
+ config->separator_height = 9;
|
|
|
|
+ config->separator_lower_height = 4;
|
|
|
|
+ config->separator_upper_height = 4;
|
|
|
|
+ config->separator_spacing_height = 5;
|
|
|
|
+ config->separator_thickness = 1;
|
|
|
|
+ config->reserve_dedicated_arrow_column = false;
|
|
|
|
+ config->icons_in_label = true;
|
|
|
|
+ config->icon_label_spacing = 8;
|
|
|
|
+ config->corner_radius = 8;
|
|
|
|
+ config->auxiliary_corner_radius = 4;
|
|
|
|
+ config->item_horizontal_border_padding = 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+} // namespace
|
|
|
|
+
|
|
|
|
namespace views {
|
|
|
|
|
|
|
|
void MenuConfig::InitPlatform() {
|
|
|
|
check_selected_combobox_item = true;
|
|
|
|
- arrow_key_selection_wraps = false;
|
|
|
|
+ arrow_key_selection_wraps = true;
|
|
|
|
use_mnemonics = false;
|
|
|
|
- show_context_menu_accelerators = false;
|
|
|
|
+ show_context_menu_accelerators = features::IsThorium2024() ? true : false;
|
|
|
|
all_menus_use_prefix_selection = true;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ menu_horizontal_border_size = 0;
|
|
|
|
+ }
|
|
|
|
+ use_outer_border = features::IsThorium2024() ? true : false;
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ InitMaterialMenuConfig(this);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace views
|
|
|
|
diff --git a/ui/views/controls/menu/menu_config_win.cc b/ui/views/controls/menu/menu_config_win.cc
|
2024-11-18 05:04:15 -03:00
|
|
|
index a2dae078ccbd3..9df79901422ee 100644
|
2024-09-01 14:35:00 -04:00
|
|
|
--- a/ui/views/controls/menu/menu_config_win.cc
|
|
|
|
+++ b/ui/views/controls/menu/menu_config_win.cc
|
|
|
|
@@ -8,6 +8,8 @@
|
|
|
|
|
|
|
|
#include <Vssym32.h>
|
|
|
|
|
|
|
|
+#include "base/win/windows_version.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/gfx/system_fonts_win.h"
|
|
|
|
|
|
|
|
namespace views {
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -21,10 +23,43 @@ void MenuConfig::InitPlatform() {
|
2024-10-27 16:34:01 -03:00
|
|
|
(SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) &&
|
2024-09-01 14:35:00 -04:00
|
|
|
show_cues == TRUE);
|
|
|
|
|
2024-10-27 16:34:01 -03:00
|
|
|
- SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0);
|
2024-09-06 19:37:25 -04:00
|
|
|
- separator_upper_height = 5;
|
|
|
|
- separator_lower_height = 7;
|
2024-10-27 16:34:01 -03:00
|
|
|
+ //SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0);
|
2024-11-18 05:04:15 -03:00
|
|
|
|
2024-11-09 15:09:56 -03:00
|
|
|
+ static const bool is_win11 = base::win::GetVersion() >= base::win::Version::WIN11;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ use_outer_border = features::IsThorium2024() ? true : false;
|
|
|
|
+
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ if (is_win11) {
|
2024-10-27 16:34:01 -03:00
|
|
|
+ corner_radius = 4;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ arrow_to_edge_padding = 4;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ menu_horizontal_border_size = 4;
|
|
|
|
+ submenu_horizontal_overlap = 1;
|
|
|
|
+ rounded_menu_vertical_border_size = 4;
|
2024-10-11 19:33:00 -03:00
|
|
|
+ item_horizontal_padding = 1;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ between_item_vertical_padding = 2;
|
|
|
|
+ separator_height = 1;
|
|
|
|
+ separator_upper_height = 1;
|
|
|
|
+ separator_lower_height = 1;
|
|
|
|
+ item_corner_radius = 4;
|
2024-10-11 19:33:00 -03:00
|
|
|
+ use_outer_border = true;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ } else {
|
2024-09-06 19:37:25 -04:00
|
|
|
+ corner_radius = 0;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ arrow_to_edge_padding = 2;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ menu_horizontal_border_size = 3;
|
|
|
|
+ nonrounded_menu_vertical_border_size = 3;
|
|
|
|
+ item_vertical_margin = 3;
|
|
|
|
+ item_horizontal_border_padding = -2;
|
|
|
|
+ icon_label_spacing = 10;
|
|
|
|
+ always_reserve_check_region = true;
|
|
|
|
+ separator_height = 7;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ separator_upper_height = 4;
|
|
|
|
+ separator_lower_height = 4;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ use_outer_border = true;
|
|
|
|
+ }
|
2024-09-06 19:37:25 -04:00
|
|
|
+ } else {
|
|
|
|
+ separator_upper_height = 5;
|
|
|
|
+ separator_lower_height = 7;
|
2024-09-01 14:35:00 -04:00
|
|
|
+ }
|
|
|
|
use_bubble_border = corner_radius > 0;
|
|
|
|
}
|
2024-09-06 19:37:25 -04:00
|
|
|
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc
|
2024-11-18 06:48:10 -03:00
|
|
|
index b73bd71742381..0fb6d132bd762 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/ui/views/controls/tree/tree_view.cc
|
|
|
|
+++ b/ui/views/controls/tree/tree_view.cc
|
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#include "ui/base/metadata/metadata_impl_macros.h"
|
|
|
|
#include "ui/base/models/image_model.h"
|
|
|
|
#include "ui/base/resource/resource_bundle.h"
|
|
|
|
+#include "ui/base/ui_base_features.h"
|
|
|
|
#include "ui/color/color_id.h"
|
|
|
|
#include "ui/color/color_provider.h"
|
|
|
|
#include "ui/events/event.h"
|
|
|
|
@@ -96,12 +97,33 @@ TreeView::TreeView()
|
|
|
|
drawing_provider_(std::make_unique<TreeViewDrawingProvider>()) {
|
|
|
|
// Always focusable, even on Mac (consistent with NSOutlineView).
|
|
|
|
SetFocusBehavior(FocusBehavior::ALWAYS);
|
|
|
|
+#if BUILDFLAG(IS_MAC)
|
|
|
|
+ constexpr bool kUseMdIcons = true;
|
|
|
|
+#else
|
|
|
|
+ constexpr bool kUseMdIcons = false;
|
|
|
|
+#endif
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ if (kUseMdIcons) {
|
|
|
|
+ closed_icon_ = open_icon_ = ui::ImageModel::FromVectorIcon(
|
|
|
|
+ vector_icons::kFolderIcon, ui::kColorIcon);
|
|
|
|
+ } else {
|
|
|
|
+ // TODO(ellyjones): if the pre-Harmony codepath goes away, merge
|
|
|
|
+ // closed_icon_ and open_icon_.
|
|
|
|
+ closed_icon_ = ui::ImageModel::FromImage(
|
|
|
|
+ ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
|
|
|
+ IDR_FOLDER_CLOSED));
|
|
|
|
+ open_icon_ = ui::ImageModel::FromImage(
|
|
|
|
+ ui::ResourceBundle::GetSharedInstance().GetImageNamed(IDR_FOLDER_OPEN));
|
|
|
|
+ }
|
|
|
|
+ text_offset_ = closed_icon_.Size().width() + kImagePadding + kImagePadding +
|
|
|
|
+ kArrowRegionSize;
|
|
|
|
+ } else {
|
|
|
|
+ folder_icon_ = ui::ImageModel::FromVectorIcon(
|
|
|
|
+ vector_icons::kFolderChromeRefreshIcon, ui::kColorIcon);
|
|
|
|
|
|
|
|
- folder_icon_ = ui::ImageModel::FromVectorIcon(
|
|
|
|
- vector_icons::kFolderChromeRefreshIcon, ui::kColorIcon);
|
|
|
|
-
|
|
|
|
- text_offset_ = folder_icon_.Size().width() + kImagePadding + kImagePadding +
|
|
|
|
- kArrowRegionSize;
|
|
|
|
+ text_offset_ = folder_icon_.Size().width() + kImagePadding + kImagePadding +
|
|
|
|
+ kArrowRegionSize;
|
|
|
|
+ }
|
|
|
|
|
2024-11-18 06:48:10 -03:00
|
|
|
GetViewAccessibility().SetRole(ax::mojom::Role::kTree);
|
|
|
|
GetViewAccessibility().SetIsVertical(true);
|
|
|
|
@@ -1201,21 +1223,43 @@ void TreeView::PaintNodeIcon(gfx::Canvas* canvas,
|
2024-10-03 08:24:53 -03:00
|
|
|
const gfx::Rect& bounds) {
|
|
|
|
std::optional<size_t> icon_index = model_->GetIconIndex(node->model_node());
|
|
|
|
int icon_x = kArrowRegionSize + kImagePadding;
|
|
|
|
- if (!icon_index.has_value()) {
|
|
|
|
- // Flip just the |bounds| region of |canvas|.
|
|
|
|
- gfx::ScopedCanvas scoped_canvas(canvas);
|
|
|
|
- canvas->Translate(gfx::Vector2d(bounds.x(), 0));
|
|
|
|
- scoped_canvas.FlipIfRTL(bounds.width());
|
|
|
|
- // Now paint the icon local to that flipped region.
|
|
|
|
- PaintRowIcon(canvas, folder_icon_.Rasterize(GetColorProvider()), icon_x,
|
|
|
|
- gfx::Rect(0, bounds.y(), bounds.width(), bounds.height()));
|
|
|
|
+ if (features::IsThorium2024()) {
|
|
|
|
+ if (!icon_index.has_value()) {
|
|
|
|
+ // Flip just the |bounds| region of |canvas|.
|
|
|
|
+ gfx::ScopedCanvas scoped_canvas(canvas);
|
|
|
|
+ canvas->Translate(gfx::Vector2d(bounds.x(), 0));
|
|
|
|
+ scoped_canvas.FlipIfRTL(bounds.width());
|
|
|
|
+ // Now paint the icon local to that flipped region.
|
|
|
|
+ PaintRowIcon(canvas,
|
|
|
|
+ (node->is_expanded() ? open_icon_ : closed_icon_)
|
|
|
|
+ .Rasterize(GetColorProvider()),
|
|
|
|
+ icon_x,
|
|
|
|
+ gfx::Rect(0, bounds.y(), bounds.width(), bounds.height()));
|
|
|
|
+ } else {
|
|
|
|
+ const gfx::ImageSkia& icon =
|
|
|
|
+ icons_[icon_index.value()].Rasterize(GetColorProvider());
|
|
|
|
+ icon_x += (open_icon_.Size().width() - icon.width()) / 2;
|
|
|
|
+ if (base::i18n::IsRTL())
|
|
|
|
+ icon_x = bounds.width() - icon_x - icon.width();
|
|
|
|
+ PaintRowIcon(canvas, icon, icon_x, bounds);
|
|
|
|
+ }
|
|
|
|
} else {
|
|
|
|
- const gfx::ImageSkia& icon =
|
|
|
|
- icons_[icon_index.value()].Rasterize(GetColorProvider());
|
|
|
|
- icon_x += (folder_icon_.Size().width() - icon.width()) / 2;
|
|
|
|
- if (base::i18n::IsRTL())
|
|
|
|
- icon_x = bounds.width() - icon_x - icon.width();
|
|
|
|
- PaintRowIcon(canvas, icon, icon_x, bounds);
|
|
|
|
+ if (!icon_index.has_value()) {
|
|
|
|
+ // Flip just the |bounds| region of |canvas|.
|
|
|
|
+ gfx::ScopedCanvas scoped_canvas(canvas);
|
|
|
|
+ canvas->Translate(gfx::Vector2d(bounds.x(), 0));
|
|
|
|
+ scoped_canvas.FlipIfRTL(bounds.width());
|
|
|
|
+ // Now paint the icon local to that flipped region.
|
|
|
|
+ PaintRowIcon(canvas, folder_icon_.Rasterize(GetColorProvider()), icon_x,
|
|
|
|
+ gfx::Rect(0, bounds.y(), bounds.width(), bounds.height()));
|
|
|
|
+ } else {
|
|
|
|
+ const gfx::ImageSkia& icon =
|
|
|
|
+ icons_[icon_index.value()].Rasterize(GetColorProvider());
|
|
|
|
+ icon_x += (folder_icon_.Size().width() - icon.width()) / 2;
|
|
|
|
+ if (base::i18n::IsRTL())
|
|
|
|
+ icon_x = bounds.width() - icon_x - icon.width();
|
|
|
|
+ PaintRowIcon(canvas, icon, icon_x, bounds);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/ui/views/controls/tree/tree_view.h b/ui/views/controls/tree/tree_view.h
|
2024-11-18 06:56:49 -03:00
|
|
|
index cfee7309a95c6..74108649ba65a 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/ui/views/controls/tree/tree_view.h
|
|
|
|
+++ b/ui/views/controls/tree/tree_view.h
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -465,6 +465,10 @@ class VIEWS_EXPORT TreeView : public View,
|
2024-10-03 08:24:53 -03:00
|
|
|
// Default folder icon.
|
|
|
|
ui::ImageModel folder_icon_;
|
|
|
|
|
|
|
|
+ // Default icons for closed/open.
|
|
|
|
+ ui::ImageModel closed_icon_;
|
|
|
|
+ ui::ImageModel open_icon_;
|
|
|
|
+
|
|
|
|
// Icons from the model.
|
|
|
|
std::vector<ui::ImageModel> icons_;
|
|
|
|
|
2024-08-12 10:53:10 -04:00
|
|
|
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc
|
2024-11-18 06:56:49 -03:00
|
|
|
index 2e4623d72bf80..f79efe3597b97 100644
|
2024-08-12 10:53:10 -04:00
|
|
|
--- a/ui/views/layout/layout_provider.cc
|
|
|
|
+++ b/ui/views/layout/layout_provider.cc
|
2024-08-16 23:32:34 -04:00
|
|
|
@@ -8,6 +8,7 @@
|
2024-08-12 10:53:10 -04:00
|
|
|
|
|
|
|
#include "base/containers/fixed_flat_map.h"
|
|
|
|
#include "base/logging.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
+#include "chrome/browser/ui/thorium_2024.h"
|
2024-08-12 10:53:10 -04:00
|
|
|
#include "ui/base/ui_base_features.h"
|
2024-08-16 23:32:34 -04:00
|
|
|
#include "ui/gfx/font_list.h"
|
|
|
|
#include "ui/views/controls/focus_ring.h"
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -214,6 +215,48 @@ ShapeSysTokens GetShapeSysToken(ShapeContextTokens id) {
|
2024-08-16 23:32:34 -04:00
|
|
|
|
2024-08-17 08:28:28 -04:00
|
|
|
int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
|
|
|
|
const gfx::Size& size) const {
|
|
|
|
+
|
2024-10-03 08:24:53 -03:00
|
|
|
+ static const bool classic_omnibox = base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox");
|
2024-08-22 11:02:48 -04:00
|
|
|
+ if (features::IsThorium2024()) {
|
2024-08-12 10:53:10 -04:00
|
|
|
+ switch (id) {
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kBadgeRadius:
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kButtonRadius:
|
2024-09-01 14:35:00 -04:00
|
|
|
+ return 4;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kComboboxRadius:
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kDialogRadius:
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kFindBarViewRadius:
|
2024-10-11 19:33:00 -03:00
|
|
|
+ return 4;
|
2024-08-12 10:53:10 -04:00
|
|
|
+ case ShapeContextTokens::kMenuRadius:
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kMenuAuxRadius:
|
2024-08-17 08:28:28 -04:00
|
|
|
+ return 0;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kMenuTouchRadius:
|
2024-08-17 08:28:28 -04:00
|
|
|
+ return 8;
|
2024-10-03 08:24:53 -03:00
|
|
|
+ case ShapeContextTokens::kOmniboxExpandedRadius: {
|
|
|
|
+ if (classic_omnibox) {
|
|
|
|
+ return 4;
|
|
|
|
+ } else {
|
|
|
|
+ return 16;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case ShapeContextTokens::kTextfieldRadius: {
|
|
|
|
+ if (classic_omnibox) {
|
|
|
|
+ return 4;
|
|
|
|
+ } else {
|
|
|
|
+ return 8;
|
|
|
|
+ }
|
|
|
|
+ }
|
2024-08-16 23:32:34 -04:00
|
|
|
+ case ShapeContextTokens::kSidePanelContentRadius:
|
2024-08-17 08:28:28 -04:00
|
|
|
+ return 16;
|
|
|
|
+ case ShapeContextTokens::kSidePanelPageContentRadius:
|
|
|
|
+ return 8;
|
2024-08-16 23:32:34 -04:00
|
|
|
+ default:
|
|
|
|
+ return 0;
|
2024-08-12 10:53:10 -04:00
|
|
|
+ }
|
|
|
|
+ }
|
2024-08-16 23:32:34 -04:00
|
|
|
+
|
2024-09-24 07:56:24 -03:00
|
|
|
ShapeSysTokens token = GetShapeSysToken(id);
|
|
|
|
DCHECK_NE(token, ShapeSysTokens::kDefault)
|
|
|
|
<< "kDefault token means there is a missing mapping between shape tokens";
|
2024-10-27 16:34:01 -03:00
|
|
|
diff --git a/ui/views/metrics.cc b/ui/views/metrics.cc
|
|
|
|
index 75fc666dfbeb3..ee108f6a31c59 100644
|
|
|
|
--- a/ui/views/metrics.cc
|
|
|
|
+++ b/ui/views/metrics.cc
|
|
|
|
@@ -6,6 +6,6 @@
|
|
|
|
|
|
|
|
namespace views {
|
|
|
|
|
|
|
|
-const int kDefaultMenuShowDelay = 400;
|
|
|
|
+const int kDefaultMenuShowDelay = 1;
|
|
|
|
|
|
|
|
} // namespace views
|
|
|
|
diff --git a/ui/views/metrics_aura.cc b/ui/views/metrics_aura.cc
|
|
|
|
index c8a9260b6c6e6..129b06e148063 100644
|
|
|
|
--- a/ui/views/metrics_aura.cc
|
|
|
|
+++ b/ui/views/metrics_aura.cc
|
|
|
|
@@ -23,12 +23,7 @@ int GetDoubleClickInterval() {
|
|
|
|
|
|
|
|
int GetMenuShowDelay() {
|
|
|
|
#if BUILDFLAG(IS_WIN)
|
|
|
|
- static int delay = []() {
|
|
|
|
- DWORD show_delay;
|
|
|
|
- return SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0)
|
|
|
|
- ? static_cast<int>(show_delay)
|
|
|
|
- : kDefaultMenuShowDelay;
|
|
|
|
- }();
|
|
|
|
+ static int delay = kDefaultMenuShowDelay;
|
|
|
|
return delay;
|
|
|
|
#else
|
|
|
|
return 0;
|
2024-10-03 08:24:53 -03:00
|
|
|
diff --git a/ui/webui/resources/cr_elements/cr_button/cr_button.css b/ui/webui/resources/cr_elements/cr_button/cr_button.css
|
|
|
|
index 69dc68d302b63..c0b974153be08 100644
|
|
|
|
--- a/ui/webui/resources/cr_elements/cr_button/cr_button.css
|
|
|
|
+++ b/ui/webui/resources/cr_elements/cr_button/cr_button.css
|
|
|
|
@@ -74,7 +74,7 @@
|
|
|
|
user-select: none;
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
border: var(--cr-button-border, 1px solid var(--cr-button-border-color));
|
|
|
|
- border-radius: 100px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
background: var(--cr-button-background-color);
|
|
|
|
color: var(--cr-button-text-color);
|
|
|
|
font-weight: 500;
|
|
|
|
@@ -92,7 +92,7 @@
|
|
|
|
}
|
|
|
|
|
|
|
|
:host(.floating-button) {
|
|
|
|
- border-radius: 8px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
height: 40px;
|
|
|
|
transition: box-shadow 80ms linear;
|
|
|
|
}
|
|
|
|
diff --git a/ui/webui/resources/cr_elements/cr_toggle/cr_toggle.css b/ui/webui/resources/cr_elements/cr_toggle/cr_toggle.css
|
2024-11-18 06:56:49 -03:00
|
|
|
index 81d33bf3c3f99..d427358823b24 100644
|
2024-10-03 08:24:53 -03:00
|
|
|
--- a/ui/webui/resources/cr_elements/cr_toggle/cr_toggle.css
|
|
|
|
+++ b/ui/webui/resources/cr_elements/cr_toggle/cr_toggle.css
|
2024-11-18 05:04:15 -03:00
|
|
|
@@ -17,7 +17,6 @@
|
|
|
|
var(--cr-fallback-color-on-primary));
|
|
|
|
--cr-toggle-checked-ripple-color: var(
|
|
|
|
--cr-active-neutral-on-subtle-background-color);
|
|
|
|
- --cr-toggle-ripple-diameter: 20px;
|
|
|
|
--cr-toggle-unchecked-bar-color:
|
|
|
|
var(--color-toggle-button-track-off,
|
|
|
|
var(--cr-fallback-color-surface-variant));
|
|
|
|
@@ -26,19 +25,16 @@
|
|
|
|
var(--cr-fallback-color-outline));
|
|
|
|
--cr-toggle-unchecked-ripple-color: var(
|
2024-10-03 08:24:53 -03:00
|
|
|
--cr-active-neutral-on-subtle-background-color);
|
2024-11-18 05:04:15 -03:00
|
|
|
- --cr-toggle-bar-border-color: var(--cr-toggle-unchecked-button-color);
|
|
|
|
- --cr-toggle-bar-border: 1px solid var(--cr-toggle-bar-border-color);
|
2024-10-03 08:24:53 -03:00
|
|
|
- --cr-toggle-bar-width: 26px;
|
2024-11-18 05:04:15 -03:00
|
|
|
- --cr-toggle-knob-diameter: 8px;
|
|
|
|
+ --cr-toggle-ripple-diameter: 34px;
|
|
|
|
+ --cr-toggle-knob-diameter: 16px;
|
2024-10-03 08:24:53 -03:00
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
cursor: pointer;
|
|
|
|
display: block;
|
2024-11-18 05:04:15 -03:00
|
|
|
- height: fit-content;
|
|
|
|
- isolation: isolate;
|
|
|
|
- min-width: initial;
|
|
|
|
+ min-width: 34px;
|
|
|
|
outline: none;
|
2024-11-26 17:24:55 -03:00
|
|
|
+ height: fit-content;
|
2024-11-18 05:04:15 -03:00
|
|
|
position: relative;
|
|
|
|
- width: fit-content;
|
|
|
|
+ width: 34px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (forced-colors: active) {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -52,112 +48,61 @@
|
2024-11-18 05:04:15 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-:host(:active) {
|
|
|
|
- --cr-toggle-knob-diameter: 10px;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-:host([checked]) {
|
|
|
|
- --cr-toggle-bar-border-color: var(--cr-toggle-checked-bar-color);
|
|
|
|
- --cr-toggle-knob-diameter: 12px;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-:host([checked]:active) {
|
|
|
|
- --cr-toggle-knob-diameter: 14px;
|
|
|
|
+@media (prefers-color-scheme: dark) {
|
|
|
|
+ :host {
|
|
|
|
+ --cr-toggle-checked-bar-color: var(--google-blue-300);
|
|
|
|
+ --cr-toggle-checked-button-color: var(--google-blue-300);
|
|
|
|
+ --cr-toggle-checked-ripple-color:
|
|
|
|
+ rgba(var(--google-blue-300-rgb), .4);
|
|
|
|
+ --cr-toggle-unchecked-bar-color: var(--google-grey-500);
|
|
|
|
+ --cr-toggle-unchecked-button-color: var(--google-grey-300);
|
|
|
|
+ --cr-toggle-unchecked-ripple-color:
|
|
|
|
+ rgba(var(--google-grey-300-rgb), .4);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
:host([disabled]) {
|
|
|
|
- --cr-toggle-checked-bar-color:
|
|
|
|
- var(--color-toggle-button-track-on-disabled,
|
|
|
|
- var(--cr-fallback-color-disabled-background));
|
|
|
|
- --cr-toggle-checked-button-color:
|
|
|
|
- var(--color-toggle-button-thumb-on-disabled, var(--cr-fallback-color-surface));
|
|
|
|
- --cr-toggle-unchecked-bar-color: transparent;
|
|
|
|
- --cr-toggle-unchecked-button-color:
|
|
|
|
- var(--color-toggle-button-thumb-off-disabled,
|
|
|
|
- var(--cr-fallback-color-disabled-foreground));
|
|
|
|
- --cr-toggle-bar-border-color: var(--cr-toggle-unchecked-button-color);
|
|
|
|
cursor: initial;
|
|
|
|
- opacity: 1;
|
|
|
|
+ opacity: var(--cr-disabled-opacity);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
-:host([checked][disabled]) {
|
|
|
|
- --cr-toggle-bar-border: none;
|
|
|
|
+:host(:hover) {
|
|
|
|
+ --cr-toggle-knob-diameter: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#bar {
|
|
|
|
background-color: var(--cr-toggle-unchecked-bar-color);
|
|
|
|
- border: var(--cr-toggle-bar-border);
|
|
|
|
- border-radius: 50px;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- display: block;
|
2024-10-03 08:24:53 -03:00
|
|
|
- height: 16px;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ border-radius: 8px;
|
|
|
|
+ height: 12px;
|
2024-10-03 08:24:53 -03:00
|
|
|
left: 3px;
|
2024-11-18 05:04:15 -03:00
|
|
|
- opacity: 1;
|
|
|
|
- position: initial;
|
|
|
|
+ position: absolute;
|
|
|
|
top: 2px;
|
2024-11-18 05:05:55 -03:00
|
|
|
transition: background-color linear 80ms;
|
2024-11-18 05:04:15 -03:00
|
|
|
- width: var(--cr-toggle-bar-width);
|
|
|
|
+ width: 30px;
|
|
|
|
z-index: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:host([checked]) #bar {
|
|
|
|
background-color: var(--cr-toggle-checked-bar-color);
|
|
|
|
- opacity: 1;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-:host(:focus-visible) #bar {
|
|
|
|
- outline: 2px solid var(--cr-toggle-checked-bar-color);
|
|
|
|
- outline-offset: 2px;
|
|
|
|
+ opacity: 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
#knob {
|
|
|
|
- /* Distance between knob center to the edge of the control is the same
|
|
|
|
- for both checked and unchecked. */
|
|
|
|
- --cr-toggle-knob-center-edge-distance_: 8px;
|
|
|
|
-
|
|
|
|
- /* Direction for on/off states
|
|
|
|
- - +1 means 'off' to the left, 'on' to the right, used in LTR.
|
|
|
|
- - -1 means 'off' to the right, 'on' to the left, used in RTL. */
|
|
|
|
- --cr-toggle-knob-direction_: 1;
|
|
|
|
-
|
|
|
|
- /* Absolute distance from the center position to either left or
|
|
|
|
- right. */
|
|
|
|
- --cr-toggle-knob-travel-distance_: calc(
|
|
|
|
- 0.5 * var(--cr-toggle-bar-width) -
|
|
|
|
- var(--cr-toggle-knob-center-edge-distance_));
|
|
|
|
-
|
|
|
|
- /* Positions in the horizontal (x-axis) dimension that the knob can be
|
|
|
|
- in. The center position is only used for calculations, and is never
|
|
|
|
- presented to the user. */
|
|
|
|
- --cr-toggle-knob-position-center_: calc(
|
|
|
|
- 0.5 * var(--cr-toggle-bar-width) + -50%);
|
|
|
|
- --cr-toggle-knob-position-start_: calc(
|
|
|
|
- var(--cr-toggle-knob-position-center_) -
|
|
|
|
- var(--cr-toggle-knob-direction_) *
|
|
|
|
- var(--cr-toggle-knob-travel-distance_));
|
|
|
|
- --cr-toggle-knob-position-end_: calc(
|
|
|
|
- var(--cr-toggle-knob-position-center_) +
|
|
|
|
- var(--cr-toggle-knob-direction_) *
|
|
|
|
- var(--cr-toggle-knob-travel-distance_));
|
|
|
|
-
|
|
|
|
background-color: var(--cr-toggle-unchecked-button-color);
|
|
|
|
border-radius: 50%;
|
|
|
|
- box-shadow: none;
|
|
|
|
+ box-shadow: var(--cr-toggle-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, .6));
|
|
|
|
display: block;
|
|
|
|
- height: var(--cr-toggle-knob-diameter);
|
|
|
|
- position: absolute;
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translate(var(--cr-toggle-knob-position-start_), -50%);
|
|
|
|
- transition: transform linear 80ms, background-color linear 80ms,
|
|
|
|
- width linear 80ms, height linear 80ms;
|
|
|
|
- width: var(--cr-toggle-knob-diameter);
|
|
|
|
+ height: 16px;
|
|
|
|
+ position: relative;
|
2024-11-18 05:05:55 -03:00
|
|
|
+ transition: transform linear 80ms, background-color linear 80ms;
|
2024-11-18 05:04:15 -03:00
|
|
|
+ width: 16px;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
:host([checked]) #knob {
|
|
|
|
background-color: var(--cr-toggle-checked-button-color);
|
|
|
|
- transform: translate(var(--cr-toggle-knob-position-end_), -50%);
|
|
|
|
+ transform: translate3d(20px, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
:host-context([dir=rtl]) #knob {
|
2024-11-18 06:48:10 -03:00
|
|
|
@@ -166,25 +111,6 @@
|
2024-11-18 05:04:15 -03:00
|
|
|
--cr-toggle-knob-direction_: -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
-:host([checked]:active) #knob,
|
|
|
|
-:host([checked]:hover) #knob {
|
|
|
|
- --cr-toggle-checked-button-color:
|
|
|
|
- var(--color-toggle-button-thumb-on-hover,
|
|
|
|
- var(--cr-fallback-color-primary-container));
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-:host(:hover) #knob::before {
|
|
|
|
- background-color: var(--cr-hover-on-subtle-background-color);
|
|
|
|
- border-radius: 50%;
|
|
|
|
- content: '';
|
|
|
|
- height: var(--cr-toggle-ripple-diameter);
|
|
|
|
- left: 50%;
|
|
|
|
- position: absolute;
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
- width: var(--cr-toggle-ripple-diameter);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#ink {
|
|
|
|
--paper-ripple-opacity: 1;
|
|
|
|
color: var(--cr-toggle-unchecked-ripple-color);
|
2024-11-18 06:56:49 -03:00
|
|
|
diff --git a/ui/webui/resources/cr_elements/md_select.css b/ui/webui/resources/cr_elements/md_select.css
|
|
|
|
index c6f72014e5f24..9032a51118467 100644
|
|
|
|
--- a/ui/webui/resources/cr_elements/md_select.css
|
|
|
|
+++ b/ui/webui/resources/cr_elements/md_select.css
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
background-size: var(--md-arrow-width);
|
|
|
|
border: solid 1px var(--color-combobox-container-outline,
|
|
|
|
var(--cr-fallback-color-neutral-outline));
|
|
|
|
- border-radius: 8px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
color: var(--md-select-text-color);
|
|
|
|
cursor: pointer;
|