[cr149] Several fixes around NativeFrameViewLinux

With this CL moving things around, this has caused a lot small issues
in several places where unwanted replecaments started to occur, or other
types of failures, like name collision.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/e0f759f728337f7df2f808ebc2c1eefffab5c5e3

commit e0f759f728337f7df2f808ebc2c1eefffab5c5e3
Author: Athul Iddya <athul@iddya.com>
Date:   Thu Apr 16 17:08:08 2026 -0700

    Add a native frame view for non-browser widgets on Linux

    Introduces NativeFrameViewLinux, a FrameViewLinux subclass that provides
    native client-side decorations for non-browser widgets on Linux. This
    class is preferred over FrameViewLinux for the GTK UI theme. Its
    implementation mirrors BrowserFrameViewLinuxNative, using
    WindowFrameProvider for frame decoration and NavButtonProvider for
    window control buttons.

    NativeFrameViewLayoutLinux similarly extends FrameViewLayoutLinux to
    override frame and button layout decisions using WindowFrameProvider and
    NavButtonProvider. Shared utilities between NativeFrameViewLinux and
    BrowserFrameViewLinuxNative are extracted into frame_view_utils_linux.

    WindowFrameProvider and NativeTheme gain options for non-browser frame
    rendering: top area height, padding and border APIs, and bottom border
    drawing in the top area, to match the appearance of native GTK dialogs.

    Bug: 396190939
    Cq-Include-Trybots: luci.chromium.try:linux-wayland-mutter-rel,linux-wayland-weston-rel
    Change-Id: Iee94d493a1751176c38d793e7efcfe47271bc909
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7615475
    Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
    Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
    Auto-Submit: Athul Iddya <athul@iddya.com>
    Reviewed-by: David Yeung <dayeung@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1616203}
This commit is contained in:
Claudio DeSouza
2026-05-22 16:25:03 -04:00
committed by Max Karolinskiy
parent b4591a82e3
commit 00d7fccd8a
2 changed files with 5 additions and 3 deletions
@@ -20,7 +20,7 @@
namespace {
ui::NavButtonProvider::ButtonState ButtonStateToNavButtonProviderState(
ui::NavButtonProvider::ButtonState CustomButtonStateToNavButtonProviderState(
views::Button::ButtonState state) {
switch (state) {
case views::Button::STATE_NORMAL:
@@ -91,7 +91,7 @@ void BraveBrowserFrameViewLinuxNative::MaybeUpdateCachedFrameButtonImages() {
// In order to lay out window caption buttons over toolbar, we should set
// height as tall as button's on toolbar
DrawFrameButtonParams params{
views::DrawFrameButtonParams params{
.top_area_height =
GetLayoutConstant(LayoutConstant::kToolbarButtonHeight) +
GetLayoutInsets(TOOLBAR_BUTTON).height() + GetTopAreaHeight() -
@@ -123,7 +123,7 @@ void BraveBrowserFrameViewLinuxNative::MaybeUpdateCachedFrameButtonImages() {
static_cast<views::ImageButton*>(button)->SetImageModel(
button_state,
ui::ImageModel::FromImageSkia(nav_button_provider_->GetImage(
type, ButtonStateToNavButtonProviderState(button_state))));
type, CustomButtonStateToNavButtonProviderState(button_state))));
}
}
}
@@ -6,6 +6,8 @@
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_
#include "ui/views/window/frame_view_utils_linux.h"
#define MaybeUpdateCachedFrameButtonImages \
MaybeUpdateCachedFrameButtonImages_Unused() {} \
friend class BraveBrowserFrameViewLinuxNative; \