[cr144] Video PIP no longer has a Back to Tab button
Chromium changes: https://chromium.googlesource.com/chromium/src/+/272e69430c552717d7d0a6c9fd10f7a8ff1666ab commit 272e69430c552717d7d0a6c9fd10f7a8ff1666ab Author: Tommy Steimel <steimel@chromium.org> Date: Mon Nov 10 15:35:32 2025 -0800 [video pip] Remove old controls We recently launched updated controls for video picture-in-picture. This CL removes the old controls completely, which greatly simplifies the code structure. Change-Id: Ifaa79a7067b5b50c4d481fd2f3a0f9194bfdae36 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7078879 Commit-Queue: Tommy Steimel <steimel@chromium.org> Reviewed-by: Frank Liberato <liberato@chromium.org> Reviewed-by: Fr <beaufort.francois@gmail.com> Reviewed-by: Tom Lukaszewicz <tluk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1542822}
This commit is contained in:
@@ -575,8 +575,6 @@ source_set("ui") {
|
||||
"views/omnibox/brave_rounded_omnibox_results_frame.h",
|
||||
"views/omnibox/brave_search_conversion_promotion_view.cc",
|
||||
"views/omnibox/brave_search_conversion_promotion_view.h",
|
||||
"views/overlay/brave_back_to_tab_label_button.cc",
|
||||
"views/overlay/brave_back_to_tab_label_button.h",
|
||||
"views/overlay/brave_video_overlay_window_views.cc",
|
||||
"views/overlay/brave_video_overlay_window_views.h",
|
||||
"views/page_action/brave_page_action_icon_container_view.cc",
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "brave/browser/ui/views/overlay/brave_back_to_tab_label_button.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/views/animation/ink_drop.h"
|
||||
#include "ui/views/background.h"
|
||||
#include "ui/views/controls/highlight_path_generator.h"
|
||||
#include "ui/views/layout/layout_provider.h"
|
||||
|
||||
BraveBackToTabLabelButton::BraveBackToTabLabelButton(PressedCallback callback)
|
||||
: BackToTabLabelButton(std::move(callback)) {
|
||||
// Align this button's style with OverlayWindowImageButton.
|
||||
views::InkDrop::Get(this)->SetMode(views::InkDropHost::InkDropMode::ON);
|
||||
SetHasInkDropActionOnClick(true);
|
||||
|
||||
views::InstallCircleHighlightPathGenerator(this);
|
||||
SetInstallFocusRingOnFocus(true);
|
||||
|
||||
SetImageLabelSpacing(0);
|
||||
SetImageCentered(true);
|
||||
|
||||
const auto insets = views::LayoutProvider::Get()->GetInsetsMetric(
|
||||
views::INSETS_VECTOR_IMAGE_BUTTON);
|
||||
SetBorder(views::CreateEmptyBorder(insets));
|
||||
}
|
||||
|
||||
BraveBackToTabLabelButton::~BraveBackToTabLabelButton() = default;
|
||||
|
||||
void BraveBackToTabLabelButton::OnThemeChanged() {
|
||||
BackToTabLabelButton::OnThemeChanged();
|
||||
|
||||
views::InkDrop::Get(this)->SetBaseColor(
|
||||
GetColorProvider()->GetColor(kColorPipWindowForeground));
|
||||
SetBackground(nullptr);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(BraveBackToTabLabelButton)
|
||||
END_METADATA
|
||||
@@ -1,23 +0,0 @@
|
||||
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef BRAVE_BROWSER_UI_VIEWS_OVERLAY_BRAVE_BACK_TO_TAB_LABEL_BUTTON_H_
|
||||
#define BRAVE_BROWSER_UI_VIEWS_OVERLAY_BRAVE_BACK_TO_TAB_LABEL_BUTTON_H_
|
||||
|
||||
#include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h"
|
||||
#include "ui/base/metadata/metadata_header_macros.h"
|
||||
|
||||
class BraveBackToTabLabelButton : public BackToTabLabelButton {
|
||||
METADATA_HEADER(BraveBackToTabLabelButton, BackToTabLabelButton)
|
||||
|
||||
public:
|
||||
explicit BraveBackToTabLabelButton(PressedCallback callback);
|
||||
~BraveBackToTabLabelButton() override;
|
||||
|
||||
// BackToTabLabelButton:
|
||||
void OnThemeChanged() override;
|
||||
};
|
||||
|
||||
#endif // BRAVE_BROWSER_UI_VIEWS_OVERLAY_BRAVE_BACK_TO_TAB_LABEL_BUTTON_H_
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "brave/browser/ui/views/overlay/brave_back_to_tab_label_button.h"
|
||||
#include "brave/components/vector_icons/vector_icons.h"
|
||||
#include "brave/ui/color/nala/nala_color_id.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
@@ -268,18 +267,6 @@ void BraveVideoOverlayWindowViews::OnUpdateControlsBounds() {
|
||||
fullscreen_button_->size().width(),
|
||||
close_controls_view_->origin().y()});
|
||||
|
||||
if (back_to_tab_label_button_) {
|
||||
back_to_tab_label_button_->SetMinSize(close_button_size);
|
||||
back_to_tab_label_button_->SetMaxSize(close_button_size);
|
||||
back_to_tab_label_button_->SetSize(close_button_size);
|
||||
back_to_tab_label_button_->SetPosition(
|
||||
{fullscreen_button_->origin().x() -
|
||||
(kTopControlSpacing - close_button_insets.left() -
|
||||
back_to_tab_label_button_->GetInsets().right()) -
|
||||
back_to_tab_label_button_->size().width(),
|
||||
close_controls_view_->origin().y()});
|
||||
}
|
||||
|
||||
// Lay out controls in the middle of window
|
||||
std::vector<views::View*> visible_controls;
|
||||
if (previous_track_controls_view_->GetVisible()) {
|
||||
@@ -342,22 +329,6 @@ void BraveVideoOverlayWindowViews::UpdateControlIcons() {
|
||||
kColorPipWindowForeground,
|
||||
kTopControlIconSize));
|
||||
|
||||
if (back_to_tab_label_button_) {
|
||||
back_to_tab_label_button_->SetImageModel(
|
||||
views::Button::STATE_NORMAL,
|
||||
ui::ImageModel::FromVectorIcon(kLeoPictureInPictureReturnIcon,
|
||||
kColorPipWindowForeground,
|
||||
kTopControlIconSize));
|
||||
// Calling this will clear accessible name as well. We should reset it and
|
||||
// tooltip text.
|
||||
back_to_tab_label_button_->SetText({});
|
||||
|
||||
back_to_tab_label_button_->SetAccessibleName(
|
||||
std::u16string(back_to_tab_label_button_->GetText()));
|
||||
back_to_tab_label_button_->SetTooltipText(
|
||||
back_to_tab_label_button_->GetAccessibleName());
|
||||
}
|
||||
|
||||
previous_track_controls_view_->override_icon(kLeoPreviousOutlineIcon);
|
||||
next_track_controls_view_->override_icon(kLeoNextOutlineIcon);
|
||||
}
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "brave/browser/ui/views/overlay/brave_back_to_tab_label_button.h"
|
||||
#include "brave/browser/ui/views/overlay/brave_video_overlay_window_views.h"
|
||||
|
||||
#define BRAVE_UPDATE_MAX_SIZE max_size_ = work_area.size();
|
||||
#define BackToTabLabelButton BraveBackToTabLabelButton
|
||||
|
||||
#include <chrome/browser/ui/views/overlay/video_overlay_window_views.cc>
|
||||
|
||||
#undef BackToTabLabelButton
|
||||
#undef BRAVE_UPDATE_MAX_SIZE
|
||||
|
||||
Reference in New Issue
Block a user