Update to Chromium version 107.0.5304.0 (#1047731)

This commit is contained in:
Marshall Greenblatt
2022-09-26 15:30:45 -04:00
parent 0089378a0a
commit 4d1fd05740
132 changed files with 1014 additions and 899 deletions

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index dffc146633fd5..38547c5aff831 100644
index 6eece67e8548a..eb78e5157eec8 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -380,8 +380,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -382,8 +382,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// CommandUpdaterDelegate and CommandUpdater declare this function so we
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
@@ -14,7 +14,7 @@ index dffc146633fd5..38547c5aff831 100644
// No commands are enabled if there is not yet any selected tab.
// TODO(pkasting): It seems like we should not need this, because either
@@ -396,6 +398,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -398,6 +400,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@@ -28,7 +28,7 @@ index dffc146633fd5..38547c5aff831 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1038,11 +1047,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1043,11 +1052,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@@ -45,10 +45,10 @@ index dffc146633fd5..38547c5aff831 100644
bool BrowserCommandController::IsWebAppOrCustomTab() const {
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
index f3cc4af3bdae4..38c088087eb1f 100644
index c6e125b6c80aa..ae1991c25a98b 100644
--- chrome/browser/ui/views/frame/browser_frame.cc
+++ chrome/browser/ui/views/frame/browser_frame.cc
@@ -74,15 +74,23 @@ bool IsUsingGtkTheme(Profile* profile) {
@@ -66,15 +66,23 @@ bool IsUsingLinuxSystemTheme(Profile* profile) {
////////////////////////////////////////////////////////////////////////////////
// BrowserFrame, public:
@@ -74,7 +74,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
}
BrowserFrame::~BrowserFrame() {}
@@ -154,6 +162,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion(
@@ -146,6 +154,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion(
}
int BrowserFrame::GetTopInset() const {
@@ -87,7 +87,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
return browser_frame_view_->GetTopInset(false);
}
@@ -170,6 +184,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
@@ -162,6 +176,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const {
}
bool BrowserFrame::UseCustomFrame() const {
@@ -96,7 +96,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
return native_browser_frame_->UseCustomFrame();
}
@@ -183,20 +199,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
@@ -175,20 +191,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const {
void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
@@ -127,7 +127,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
browser_frame_view_->OnBrowserViewInitViewsComplete();
}
@@ -257,6 +283,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
@@ -249,6 +275,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
ui::ColorProviderManager::ThemeInitializerSupplier*
BrowserFrame::GetCustomTheme() const {
@@ -136,7 +136,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
Browser* browser = browser_view_->browser();
// If this is an incognito profile, there should never be a custom theme.
if (browser->profile()->IsIncognitoProfile())
@@ -274,6 +302,8 @@ BrowserFrame::GetCustomTheme() const {
@@ -266,6 +294,8 @@ BrowserFrame::GetCustomTheme() const {
}
void BrowserFrame::OnNativeWidgetWorkspaceChanged() {
@@ -145,7 +145,7 @@ index f3cc4af3bdae4..38c088087eb1f 100644
chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace());
chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(),
IsVisibleOnAllWorkspaces());
@@ -363,6 +393,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
@@ -353,6 +383,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) {
ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const {
auto key = Widget::GetColorProviderKey();
@@ -154,8 +154,8 @@ index f3cc4af3bdae4..38c088087eb1f 100644
key.frame_type = UseCustomFrame()
? ui::ColorProviderManager::FrameType::kChromium
: ui::ColorProviderManager::FrameType::kNative;
@@ -395,7 +427,8 @@ void BrowserFrame::SelectNativeTheme() {
// Select between regular, dark and GTK theme.
@@ -385,7 +417,8 @@ void BrowserFrame::SelectNativeTheme() {
// Select between regular, dark and Linux toolkit themes.
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
- if (browser_view_->browser()->profile()->IsIncognitoProfile()) {
@@ -164,21 +164,11 @@ index f3cc4af3bdae4..38c088087eb1f 100644
// No matter if we are using the default theme or not we always use the dark
// ui instance.
SetNativeTheme(ui::NativeTheme::GetInstanceForDarkUI());
@@ -408,7 +441,8 @@ void BrowserFrame::SelectNativeTheme() {
// display_override so the web contents can blend with the overlay by using
// the developer-provided theme color for a better experience. Context:
// https://crbug.com/1219073.
- if (linux_ui && !browser_view_->AppUsesWindowControlsOverlay()) {
+ if (linux_ui &&
+ (!browser_view_ || !browser_view_->AppUsesWindowControlsOverlay())) {
native_theme = linux_ui->GetNativeTheme(GetNativeWindow());
}
#endif
diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h
index 9bd586697dece..80ef1f08cb463 100644
index 195674a56169c..bee591ec8f2f3 100644
--- chrome/browser/ui/views/frame/browser_frame.h
+++ chrome/browser/ui/views/frame/browser_frame.h
@@ -53,7 +53,9 @@ enum class TabDragKind {
@@ -56,7 +56,9 @@ enum class TabDragKind {
// This is a virtual interface that allows system specific browser frames.
class BrowserFrame : public views::Widget, public views::ContextMenuController {
public:
@@ -189,10 +179,10 @@ index 9bd586697dece..80ef1f08cb463 100644
BrowserFrame(const BrowserFrame&) = delete;
BrowserFrame& operator=(const BrowserFrame&) = delete;
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index f19af5dd5c46e..37827cab73cf8 100644
index a8e5cd8826ca4..0b958e49730d4 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -307,11 +307,10 @@ using content::NativeWebKeyboardEvent;
@@ -305,11 +305,10 @@ using content::NativeWebKeyboardEvent;
using content::WebContents;
using web_modal::WebContentsModalDialogHost;
@@ -207,7 +197,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
#if BUILDFLAG(IS_CHROMEOS_ASH)
// UMA histograms that record animation smoothness for tab loading animation.
@@ -804,11 +803,22 @@ class BrowserView::SidePanelVisibilityController : public views::ViewObserver {
@@ -802,11 +801,22 @@ class BrowserView::SidePanelVisibilityController : public views::ViewObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
@@ -226,20 +216,20 @@ index f19af5dd5c46e..37827cab73cf8 100644
+ DCHECK(!browser_);
+ browser_ = std::move(browser);
+
+ immersive_mode_controller_ = chrome::CreateImmersiveModeController();
+ immersive_mode_controller_ = chrome::CreateImmersiveModeController(this);
+
SetShowIcon(
::ShouldShowWindowIcon(browser_.get(), AppUsesWindowControlsOverlay()));
@@ -850,7 +860,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -848,7 +858,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
}
browser_->tab_strip_model()->AddObserver(this);
- immersive_mode_controller_ = chrome::CreateImmersiveModeController();
- immersive_mode_controller_ = chrome::CreateImmersiveModeController(this);
// Top container holds tab strip region and toolbar and lives at the front of
// the view hierarchy.
@@ -896,8 +905,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -894,8 +903,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>(
devtools_web_view_, contents_web_view_));
@@ -257,7 +247,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1813,6 +1829,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
@@ -1841,6 +1857,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
if (immersive_mode_controller_->IsEnabled())
return false;
@@ -266,7 +256,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
}
@@ -3129,7 +3147,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
@@ -3202,7 +3220,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
if (top_container()->parent() == this)
return;
@@ -276,7 +266,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -3670,8 +3689,10 @@ void BrowserView::Layout() {
@@ -3747,8 +3766,10 @@ void BrowserView::Layout() {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@@ -289,7 +279,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -3737,6 +3758,11 @@ void BrowserView::AddedToWidget() {
@@ -3814,6 +3835,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@@ -301,7 +291,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
toolbar_->Init();
// TODO(pbos): Manage this either inside SidePanel or the corresponding button
@@ -3798,13 +3824,9 @@ void BrowserView::AddedToWidget() {
@@ -3874,13 +3900,9 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@@ -317,7 +307,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -4221,7 +4243,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
@@ -4296,7 +4318,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@@ -327,7 +317,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
}
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
@@ -4549,6 +4572,8 @@ Profile* BrowserView::GetProfile() {
@@ -4638,6 +4661,8 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@@ -336,7 +326,7 @@ index f19af5dd5c46e..37827cab73cf8 100644
frame()->GetFrameView()->UpdateFullscreenTopUI();
}
@@ -4571,6 +4596,8 @@ void BrowserView::HideDownloadShelf() {
@@ -4660,6 +4685,8 @@ void BrowserView::HideDownloadShelf() {
}
bool BrowserView::CanUserExitFullscreen() const {
@@ -346,10 +336,10 @@ index f19af5dd5c46e..37827cab73cf8 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index 2e054124298d4..8df50230cfaba 100644
index 0dfde39f4bd1f..dc9ba028c22bb 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -126,11 +126,16 @@ class BrowserView : public BrowserWindow,
@@ -130,11 +130,16 @@ class BrowserView : public BrowserWindow,
public webapps::AppBannerManager::Observer {
public:
METADATA_HEADER(BrowserView);
@@ -366,9 +356,9 @@ index 2e054124298d4..8df50230cfaba 100644
void set_frame(BrowserFrame* frame) { frame_ = frame; }
BrowserFrame* frame() const { return frame_; }
@@ -762,6 +767,12 @@ class BrowserView : public BrowserWindow,
// aligned side panels.
void RightAlignedSidePanelWasClosed();
@@ -791,6 +796,12 @@ class BrowserView : public BrowserWindow,
return should_show_window_controls_overlay_toggle_;
}
+ protected:
+ virtual ToolbarView* OverrideCreateToolbar(Browser* browser,
@@ -380,7 +370,7 @@ index 2e054124298d4..8df50230cfaba 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 5f1e08e77de3e..c6746aacf49f3 100644
index c923ca16d06a5..eb75ad1111ae3 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -45,6 +45,10 @@
@@ -407,7 +397,7 @@ index 5f1e08e77de3e..c6746aacf49f3 100644
bool toolbar_visible = delegate_->IsToolbarVisible();
int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;
diff --git chrome/browser/ui/views/frame/contents_web_view.cc chrome/browser/ui/views/frame/contents_web_view.cc
index bc047256f110a..b6bc9dfc0eee5 100644
index 5e059b9878fc2..c1f6fbcd40ec4 100644
--- chrome/browser/ui/views/frame/contents_web_view.cc
+++ chrome/browser/ui/views/frame/contents_web_view.cc
@@ -26,6 +26,11 @@
@@ -423,10 +413,10 @@ index bc047256f110a..b6bc9dfc0eee5 100644
ContentsWebView::~ContentsWebView() {
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index fcda275238c11..d349f515af8fa 100644
index 57d5e9f7b4e3c..da7b2d14bae49 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -557,33 +557,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -556,33 +556,47 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {
@@ -475,10 +465,10 @@ index fcda275238c11..d349f515af8fa 100644
}
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
index 370b4898ca6ca..559d9994ac866 100644
index 73869775288dc..524f32d3ae877 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -168,12 +168,13 @@ auto& GetViewCommandMap() {
@@ -170,12 +170,13 @@ auto& GetViewCommandMap() {
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, public:
@@ -494,7 +484,7 @@ index 370b4898ca6ca..559d9994ac866 100644
SetID(VIEW_ID_TOOLBAR);
UpgradeDetector::GetInstance()->AddObserver(this);
@@ -208,7 +209,7 @@ void ToolbarView::Init() {
@@ -210,7 +211,7 @@ void ToolbarView::Init() {
#endif
auto location_bar = std::make_unique<LocationBarView>(
browser_, browser_->profile(), browser_->command_controller(), this,
@@ -504,10 +494,10 @@ index 370b4898ca6ca..559d9994ac866 100644
size_animation_.Reset(1);
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
index 9eb9688bb442b..9d20d3d262588 100644
index e597548896482..b9985ed50a2e3 100644
--- chrome/browser/ui/views/toolbar/toolbar_view.h
+++ chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -94,7 +94,8 @@ class ToolbarView : public views::AccessiblePaneView,
@@ -95,7 +95,8 @@ class ToolbarView : public views::AccessiblePaneView,
// needs to be displayed.
};