Commit f115941a authored by Taylor Bergquist's avatar Taylor Bergquist Committed by Commit Bot

Move frame grab handle reserved space out of the tab strip.

Change-Id: I7e1527c0dbd0fea1e7aadbea2b664d991e53dae3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2486387Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Taylor Bergquist <tbergquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819484}
parent 315d5cdf
...@@ -44,6 +44,17 @@ std::unique_ptr<views::ImageButton> CreateScrollButton( ...@@ -44,6 +44,17 @@ std::unique_ptr<views::ImageButton> CreateScrollButton(
scroll_button->SetInkDropMode(views::Button::InkDropMode::ON); scroll_button->SetInkDropMode(views::Button::InkDropMode::ON);
return scroll_button; return scroll_button;
} }
class FrameGrabHandle : public views::View {
public:
gfx::Size GetMinimumSize() const override {
// Reserve some space for the frame to be grabbed by, even if the tabstrip
// is full.
// TODO(tbergquist): Define this relative to the NTB insets again.
return gfx::Size(42, 0);
}
};
} // namespace } // namespace
TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip) { TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip) {
...@@ -96,11 +107,8 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip) { ...@@ -96,11 +107,8 @@ TabStripRegionView::TabStripRegionView(std::unique_ptr<TabStrip> tab_strip) {
tab_strip_container_flex_spec); tab_strip_container_flex_spec);
} }
reserved_grab_handle_space_ = AddChildView(std::make_unique<views::View>()); reserved_grab_handle_space_ =
// TODO(tbergquist): Give |reserved_grab_handle_space_| a minimum size. For AddChildView(std::make_unique<FrameGrabHandle>());
// now, this space is reserved by the tabstrip itself, and we're just using
// this view to eat up flex space so that |tab_search_button| can be end-
// aligned.
reserved_grab_handle_space_->SetProperty( reserved_grab_handle_space_->SetProperty(
views::kFlexBehaviorKey, views::kFlexBehaviorKey,
views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum, views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum,
......
...@@ -2719,13 +2719,6 @@ int TabStrip::TabToNewTabButtonSpacing() const { ...@@ -2719,13 +2719,6 @@ int TabStrip::TabToNewTabButtonSpacing() const {
return -TabStyle::GetTabInternalPadding().right(); return -TabStyle::GetTabInternalPadding().right();
} }
int TabStrip::FrameGrabWidth() const {
// The grab area is adjacent to the new tab button. Treat the padding in the
// new tab button as part of the grab area.
constexpr int kApparentWidth = 50;
return kApparentWidth - new_tab_button_->GetInsets().right();
}
bool TabStrip::TitlebarBackgroundIsTransparent() const { bool TabStrip::TitlebarBackgroundIsTransparent() const {
#if defined(OS_WIN) #if defined(OS_WIN)
// Windows 8+ uses transparent window contents (because the titlebar area is // Windows 8+ uses transparent window contents (because the titlebar area is
...@@ -2796,8 +2789,7 @@ int TabStrip::GetTabAreaWidth() const { ...@@ -2796,8 +2789,7 @@ int TabStrip::GetTabAreaWidth() const {
} }
int TabStrip::GetRightSideReservedWidth() const { int TabStrip::GetRightSideReservedWidth() const {
return new_tab_button_ideal_bounds_.width() + TabToNewTabButtonSpacing() + return new_tab_button_ideal_bounds_.width() + TabToNewTabButtonSpacing();
FrameGrabWidth();
} }
const Tab* TabStrip::GetLastVisibleTab() const { const Tab* TabStrip::GetLastVisibleTab() const {
......
...@@ -461,10 +461,6 @@ class TabStrip : public views::View, ...@@ -461,10 +461,6 @@ class TabStrip : public views::View,
// edge of the new tab button. // edge of the new tab button.
int TabToNewTabButtonSpacing() const; int TabToNewTabButtonSpacing() const;
// Returns the space to reserve after the tabs to guarantee the user can grab
// part of the window frame (to move the window with).
int FrameGrabWidth() const;
// Returns whether the window background behind the tabstrip is transparent. // Returns whether the window background behind the tabstrip is transparent.
bool TitlebarBackgroundIsTransparent() const; bool TitlebarBackgroundIsTransparent() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment