Update to Chromium version 135.0.7049.0 (#1427262)

This commit is contained in:
Marshall Greenblatt
2025-03-10 15:57:41 -04:00
parent cda47aaff4
commit ff5210f825
86 changed files with 732 additions and 713 deletions

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index 47e19e2f12139..be792c0b0a12a 100644
index 61bb1335729f4..bd8c6967a682a 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -421,6 +421,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -427,6 +427,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
@ -10,7 +10,7 @@ index 47e19e2f12139..be792c0b0a12a 100644
return false;
}
@@ -438,6 +439,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -444,6 +445,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@ -24,7 +24,7 @@ index 47e19e2f12139..be792c0b0a12a 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1211,11 +1219,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1231,11 +1239,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@ -41,10 +41,10 @@ index 47e19e2f12139..be792c0b0a12a 100644
void BrowserCommandController::InitCommandState() {
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index 6130205985f73..5505b44742fde 100644
index 2eb112147b64b..497e2be438367 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -733,10 +733,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
@@ -730,10 +730,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
ui::SimpleMenuModel::Delegate* delegate)
: SimpleMenuModel(delegate) {
AddItemWithStringIdAndVectorIcon(this, IDC_FIND, IDS_FIND, kSearchMenuIcon);
@ -57,7 +57,7 @@ index 6130205985f73..5505b44742fde 100644
}
class SaveAndShareSubMenuModel : public ui::SimpleMenuModel {
@@ -801,6 +803,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
@@ -798,6 +800,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
}
}
@ -115,7 +115,7 @@ index 6130205985f73..5505b44742fde 100644
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -1730,7 +1783,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
@@ -1726,7 +1779,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
return false;
}
@ -124,7 +124,7 @@ index 6130205985f73..5505b44742fde 100644
GlobalError* error =
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
->GetGlobalErrorByMenuItemCommandID(command_id);
@@ -1746,6 +1799,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
@@ -1742,6 +1795,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
}
}
@ -155,7 +155,7 @@ index 6130205985f73..5505b44742fde 100644
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
if (command_id == IDC_VIEW_PASSWORDS ||
command_id == IDC_SHOW_PASSWORD_MANAGER) {
@@ -1901,8 +1978,10 @@ void AppMenuModel::Build() {
@@ -1897,8 +1974,10 @@ void AppMenuModel::Build() {
IDS_CLEAR_BROWSING_DATA,
kTrashCanRefreshIcon);
@ -200,10 +200,10 @@ index f5f5d8c1a8918..bebb784115c87 100644
// Adds actionable global error menu items to the menu.
// Examples: Extension permissions and sign in errors.
diff --git chrome/browser/ui/views/find_bar_host.cc chrome/browser/ui/views/find_bar_host.cc
index 38fe5a02de21d..2bd4508d5c024 100644
index f348f09b374e3..08c704336746e 100644
--- chrome/browser/ui/views/find_bar_host.cc
+++ chrome/browser/ui/views/find_bar_host.cc
@@ -604,6 +604,14 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
@@ -608,6 +608,14 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
// The BrowserView does Layout for the components that we care about
// positioning relative to, so we ask it to tell us where we should go.
gfx::Rect find_bar_bounds = browser_view_->GetFindBarBoundingBox();
@ -219,7 +219,7 @@ index 38fe5a02de21d..2bd4508d5c024 100644
return gfx::Rect();
}
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
index 806679c846f15..5c685e93631c8 100644
index 2e9c753a7da81..c628e1c945f30 100644
--- chrome/browser/ui/views/frame/browser_frame.cc
+++ chrome/browser/ui/views/frame/browser_frame.cc
@@ -112,15 +112,25 @@ ui::ColorProviderKey::SchemeVariant GetSchemeVariant(
@ -311,7 +311,7 @@ index 806679c846f15..5c685e93631c8 100644
browser_frame_view_->OnBrowserViewInitViewsComplete();
}
@@ -366,6 +398,8 @@ ui::ColorProviderKey::ThemeInitializerSupplier* BrowserFrame::GetCustomTheme()
@@ -365,6 +397,8 @@ ui::ColorProviderKey::ThemeInitializerSupplier* BrowserFrame::GetCustomTheme()
}
void BrowserFrame::OnNativeWidgetWorkspaceChanged() {
@ -320,7 +320,7 @@ index 806679c846f15..5c685e93631c8 100644
chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
IsVisibleOnAllWorkspaces());
@@ -576,6 +610,13 @@ void BrowserFrame::SelectNativeTheme() {
@@ -575,6 +609,13 @@ void BrowserFrame::SelectNativeTheme() {
return;
}
@ -334,7 +334,7 @@ index 806679c846f15..5c685e93631c8 100644
// Ignore the system theme for web apps with window-controls-overlay as the
// display_override so the web contents can blend with the overlay by using
// the developer-provided theme color for a better experience. Context:
@@ -641,5 +682,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
@@ -640,5 +681,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange(
}
bool BrowserFrame::IsIncognitoBrowser() const {
@ -397,10 +397,10 @@ index 3d8a15049d4d2..66c4789581fe1 100644
// regenerated.
bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type);
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index 127aa3ef3ba70..506cb33978bed 100644
index 1b68a93c6d849..4aefc07ba8b02 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -363,10 +363,6 @@ using web_modal::WebContentsModalDialogHost;
@@ -356,10 +356,6 @@ using web_modal::WebContentsModalDialogHost;
namespace {
@ -411,7 +411,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
#if BUILDFLAG(IS_CHROMEOS)
// UMA histograms that record animation smoothness for tab loading animation.
constexpr char kTabLoadingSmoothnessHistogramName[] =
@@ -776,6 +772,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
@@ -770,6 +766,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
return browser_view_->frame()->GetTopInset() - browser_view_->y();
}
@ -426,7 +426,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
bool IsToolbarVisible() const override {
return browser_view_->IsToolbarVisible();
}
@@ -927,11 +931,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
@@ -921,11 +925,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
@ -449,7 +449,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
SetShowIcon(::ShouldShowWindowIcon(
browser_.get(), AppUsesWindowControlsOverlay(), AppUsesTabbed()));
@@ -1071,8 +1085,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -1067,8 +1081,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
watermark_view_));
#endif
@ -467,7 +467,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1144,7 +1165,9 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -1146,7 +1167,9 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
}
BrowserView::~BrowserView() {
@ -477,7 +477,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// Remove the layout manager to avoid dangling. This needs to be earlier than
// other cleanups that destroy views referenced in the layout manager.
@@ -1156,7 +1179,9 @@ BrowserView::~BrowserView() {
@@ -1158,7 +1181,9 @@ BrowserView::~BrowserView() {
// All the tabs should have been destroyed already. If we were closed by the
// OS with some tabs than the NativeBrowserFrame should have destroyed them.
@ -487,7 +487,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// Stop the animation timer explicitly here to avoid running it in a nested
// message loop, which may run by Browser destructor.
@@ -1165,17 +1190,18 @@ BrowserView::~BrowserView() {
@@ -1167,17 +1192,18 @@ BrowserView::~BrowserView() {
// Immersive mode may need to reparent views before they are removed/deleted.
immersive_mode_controller_.reset();
@ -510,7 +510,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// These are raw pointers to child views, so they need to be set to null
// before `RemoveAllChildViews()` is called to avoid dangling.
@@ -1800,6 +1826,28 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
@@ -1816,6 +1842,28 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
ThemeProperties::kFrameHeightAboveTabs - browser_view_origin.y());
}
@ -539,7 +539,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// static:
BrowserView::DevToolsDockedPlacement BrowserView::GetDevToolsDockedPlacement(
const gfx::Rect& contents_webview_bounds,
@@ -2220,7 +2268,13 @@ void BrowserView::OnExclusiveAccessUserInput() {
@@ -2242,7 +2290,13 @@ void BrowserView::OnExclusiveAccessUserInput() {
bool BrowserView::ShouldHideUIForFullscreen() const {
// Immersive mode needs UI for the slide-down top panel.
@ -554,7 +554,16 @@ index 127aa3ef3ba70..506cb33978bed 100644
return false;
}
@@ -3459,7 +3513,9 @@ DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
@@ -3448,13 +3502,18 @@ views::View* BrowserView::GetTopContainer() {
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
if (base::FeatureList::IsEnabled(features::kPinnableDownloadsButton)) {
+ if (!browser_) {
+ return nullptr;
+ }
if (auto* download_controller =
browser_->GetFeatures().download_toolbar_ui_controller()) {
return download_controller->bubble_controller();
}
return nullptr;
}
@ -563,9 +572,9 @@ index 127aa3ef3ba70..506cb33978bed 100644
+ return nullptr;
+ }
if (auto* download_button = toolbar_button_provider_->GetDownloadButton()) {
return download_button->bubble_controller();
}
@@ -4089,7 +4145,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
return static_cast<DownloadToolbarButtonView*>(download_button)
->bubble_controller();
@@ -4103,7 +4162,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
return;
}
@ -575,7 +584,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -4607,11 +4664,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
@@ -4633,11 +4693,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
bool BrowserView::ShouldDescendIntoChildForEventHandling(
gfx::NativeView child,
const gfx::Point& location) {
@ -616,7 +625,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// Draggable regions are defined relative to the web contents.
gfx::Point point_in_contents_web_view_coords(location);
views::View::ConvertPointToTarget(GetWidget()->GetRootView(),
@@ -4620,7 +4704,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
@@ -4646,7 +4733,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
// Draggable regions should be ignored for clicks into any browser view's
// owned widgets, for example alerts, permission prompts or find bar.
@ -625,7 +634,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
point_in_contents_web_view_coords.x(),
point_in_contents_web_view_coords.y()) ||
WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords);
@@ -4734,8 +4818,10 @@ void BrowserView::Layout(PassKey) {
@@ -4760,8 +4847,10 @@ void BrowserView::Layout(PassKey) {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@ -638,7 +647,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -4802,6 +4888,11 @@ void BrowserView::AddedToWidget() {
@@ -4828,6 +4917,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@ -648,9 +657,9 @@ index 127aa3ef3ba70..506cb33978bed 100644
+ SetToolbarButtonProvider(toolbar_);
+
toolbar_->Init();
if (download::IsDownloadBubbleEnabled() &&
features::IsToolbarPinningEnabled() &&
@@ -4849,14 +4940,10 @@ void BrowserView::AddedToWidget() {
// TODO(pbos): Investigate whether the side panels should be creatable when
@@ -4870,12 +4964,6 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@ -660,6 +669,12 @@ index 127aa3ef3ba70..506cb33978bed 100644
- SetToolbarButtonProvider(toolbar_);
- }
-
if (download::IsDownloadBubbleEnabled() &&
base::FeatureList::IsEnabled(features::kPinnableDownloadsButton)) {
browser_->GetFeatures().download_toolbar_ui_controller()->Init();
@@ -4887,7 +4975,9 @@ void BrowserView::AddedToWidget() {
}
frame_->OnBrowserViewInitViewsComplete();
- frame_->GetFrameView()->UpdateMinimumSize();
+ if (frame_->GetFrameView()) {
@ -668,7 +683,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -5252,7 +5339,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
@@ -5298,7 +5388,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@ -678,7 +693,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
}
void BrowserView::RequestFullscreen(bool fullscreen, int64_t display_id) {
@@ -5748,6 +5836,8 @@ Profile* BrowserView::GetProfile() {
@@ -5802,6 +5893,8 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@ -687,7 +702,7 @@ index 127aa3ef3ba70..506cb33978bed 100644
frame()->GetFrameView()->UpdateFullscreenTopUI();
}
@@ -5777,6 +5867,8 @@ bool BrowserView::CanUserEnterFullscreen() const {
@@ -5831,6 +5924,8 @@ bool BrowserView::CanUserEnterFullscreen() const {
}
bool BrowserView::CanUserExitFullscreen() const {
@ -697,10 +712,10 @@ index 127aa3ef3ba70..506cb33978bed 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index b9986c6e9097d..fc8f781e6ac66 100644
index 621d3abcfbd83..13bc942b778ce 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -151,11 +151,16 @@ class BrowserView : public BrowserWindow,
@@ -147,11 +147,16 @@ class BrowserView : public BrowserWindow,
METADATA_HEADER(BrowserView, views::ClientView)
public:
@ -717,7 +732,7 @@ index b9986c6e9097d..fc8f781e6ac66 100644
void set_frame(BrowserFrame* frame) {
frame_ = frame;
paint_as_active_subscription_ =
@@ -900,6 +905,10 @@ class BrowserView : public BrowserWindow,
@@ -905,6 +910,10 @@ class BrowserView : public BrowserWindow,
void Copy();
void Paste();
@ -728,7 +743,7 @@ index b9986c6e9097d..fc8f781e6ac66 100644
protected:
// Enumerates where the devtools are docked relative to the browser's main
// web contents.
@@ -923,6 +932,8 @@ class BrowserView : public BrowserWindow,
@@ -928,6 +937,8 @@ class BrowserView : public BrowserWindow,
const gfx::Rect& contents_webview_bounds,
const gfx::Rect& local_webview_container_bounds);
@ -738,7 +753,7 @@ index b9986c6e9097d..fc8f781e6ac66 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// interface to keep these two classes decoupled and testable.
diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc
index 1376fdf933420..336391e29944c 100644
index 39f9345a8bf6a..ecbd2553d7c5b 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -52,6 +52,10 @@
@ -878,10 +893,10 @@ index 6bdd187588951..8ac385bcd0cb5 100644
ContentsWebView::~ContentsWebView() = default;
diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
index d69e8e49bf650..61386736a8d57 100644
index 8b0103c5920ef..adbb8eaa74885 100644
--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
+++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
@@ -668,6 +668,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView(
@@ -638,6 +638,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView(
frame_background_ = std::make_unique<views::FrameBackground>();
}
#endif
@ -893,7 +908,7 @@ index d69e8e49bf650..61386736a8d57 100644
}
PictureInPictureBrowserFrameView::~PictureInPictureBrowserFrameView() {
@@ -801,18 +806,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds(
@@ -771,18 +776,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds(
int PictureInPictureBrowserFrameView::NonClientHitTest(
const gfx::Point& point) {
@ -944,7 +959,7 @@ index d69e8e49bf650..61386736a8d57 100644
// Allow dragging and resizing the window.
int window_component = GetHTComponentForFrame(
@@ -886,7 +915,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) {
@@ -856,7 +885,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) {
gfx::Rect content_area = GetLocalBounds();
content_area.Inset(FrameBorderInsets());
gfx::Rect top_bar = content_area;
@ -954,7 +969,7 @@ index d69e8e49bf650..61386736a8d57 100644
top_bar_container_view_->SetBoundsRect(top_bar);
#if !BUILDFLAG(IS_ANDROID)
if (auto_pip_setting_overlay_) {
@@ -1436,7 +1466,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
@@ -1406,7 +1436,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
}
int PictureInPictureBrowserFrameView::GetTopAreaHeight() const {
@ -979,10 +994,10 @@ index 33c6444869375..d74818698d81a 100644
LocationBarView* location_bar_view = browser_view_->GetLocationBarView();
CHECK(location_bar_view);
diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc
index b41c7ca3a6a01..24d3c68c34a26 100644
index a8c61cefa56be..7f40012829c5e 100644
--- chrome/browser/ui/views/page_action/page_action_icon_controller.cc
+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc
@@ -117,6 +117,14 @@ void PageActionIconController::Init(const PageActionIconParams& params,
@@ -120,6 +120,14 @@ void PageActionIconController::Init(const PageActionIconParams& params,
continue;
}
}
@ -998,10 +1013,10 @@ index b41c7ca3a6a01..24d3c68c34a26 100644
case PageActionIconType::kPaymentsOfferNotification:
add_page_action_icon(
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 99da126067283..1519dd277c73b 100644
index 98d97b84906bd..d63bab08e8098 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -669,29 +669,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -698,29 +698,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {
@ -1044,10 +1059,10 @@ index 99da126067283..1519dd277c73b 100644
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index 27efd0c4238f4..50037f13b926a 100644
index 0d912a7cbf371..4b0f539bc9916 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -188,7 +188,7 @@ class TabstripLikeBackground : public views::Background {
@@ -185,7 +185,7 @@ class TabstripLikeBackground : public views::Background {
void Paint(gfx::Canvas* canvas, views::View* view) const override {
bool painted = TopContainerBackground::PaintThemeCustomImage(canvas, view,
browser_view_);
@ -1056,7 +1071,7 @@ index 27efd0c4238f4..50037f13b926a 100644
SkColor frame_color =
browser_view_->frame()->GetFrameView()->GetFrameColor(
BrowserFrameActiveState::kUseCurrent);
@@ -222,12 +222,13 @@ END_METADATA
@@ -219,12 +219,13 @@ END_METADATA
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ToolbarView, kToolbarElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ToolbarView, kToolbarContainerElementId);
@ -1072,7 +1087,7 @@ index 27efd0c4238f4..50037f13b926a 100644
SetID(VIEW_ID_TOOLBAR);
SetProperty(views::kElementIdentifierKey, kToolbarElementId);
@@ -259,9 +260,24 @@ ToolbarView::~ToolbarView() {
@@ -256,9 +257,24 @@ ToolbarView::~ToolbarView() {
for (const auto& view_and_command : GetViewCommandMap()) {
chrome::RemoveCommandObserver(browser_, view_and_command.second, this);
}
@ -1097,7 +1112,7 @@ index 27efd0c4238f4..50037f13b926a 100644
#if defined(USE_AURA)
// Avoid generating too many occlusion tracking calculation events before this
// function returns. The occlusion status will be computed only once once this
@@ -284,12 +300,12 @@ void ToolbarView::Init() {
@@ -281,12 +297,12 @@ void ToolbarView::Init() {
auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this,
@ -1109,20 +1124,20 @@ index 27efd0c4238f4..50037f13b926a 100644
std::unique_ptr<DownloadToolbarButtonView> download_button;
- if (download::IsDownloadBubbleEnabled() &&
+ if (download::IsDownloadBubbleEnabled() && BUTTON_VISIBLE(kDownload) &&
(!features::IsToolbarPinningEnabled() ||
!base::FeatureList::IsEnabled(features::kPinnableDownloadsButton))) {
!base::FeatureList::IsEnabled(features::kPinnableDownloadsButton)) {
download_button =
@@ -373,7 +389,8 @@ void ToolbarView::Init() {
std::make_unique<DownloadToolbarButtonView>(browser_view_);
@@ -368,7 +384,8 @@ void ToolbarView::Init() {
}
std::unique_ptr<media_router::CastToolbarButton> cast;
if (!(features::IsToolbarPinningEnabled() &&
base::FeatureList::IsEnabled(features::kPinnedCastButton))) {
if (!base::FeatureList::IsEnabled(features::kPinnedCastButton)) {
- if (media_router::MediaRouterEnabled(browser_->profile())) {
+ if (media_router::MediaRouterEnabled(browser_->profile()) &&
+ BUTTON_VISIBLE(kCast)) {
cast = media_router::CastToolbarButton::Create(browser_);
}
}
@@ -387,7 +404,8 @@ void ToolbarView::Init() {
@@ -382,7 +399,8 @@ void ToolbarView::Init() {
std::unique_ptr<send_tab_to_self::SendTabToSelfToolbarIconView>
send_tab_to_self_button;
@ -1132,7 +1147,7 @@ index 27efd0c4238f4..50037f13b926a 100644
send_tab_to_self_button =
std::make_unique<send_tab_to_self::SendTabToSelfToolbarIconView>(
browser_view_);
@@ -860,7 +878,8 @@ void ToolbarView::Layout(PassKey) {
@@ -840,7 +858,8 @@ void ToolbarView::Layout(PassKey) {
if (display_mode_ == DisplayMode::NORMAL) {
LayoutCommon();
@ -1143,7 +1158,7 @@ index 27efd0c4238f4..50037f13b926a 100644
if (toolbar_controller_) {
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index 8562522807529..a88825e8242e3 100644
index f1a6841c1ef40..fe88512c90c8e 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h
+++ chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -100,7 +100,8 @@ class ToolbarView : public views::AccessiblePaneView,