Commit 68aff700 authored by Caroline Rising's avatar Caroline Rising Committed by Chromium LUCI CQ

Read later: fix bug where reading list doesn't close when bookmark bar is hidden.

Bug: 1109316
Change-Id: I67d5b3d69dedab79580370d7d5df9b6173a5a7d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627693
Commit-Queue: Caroline Rising <corising@chromium.org>
Reviewed-by: default avatarConnie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843226}
parent 351645fd
...@@ -560,10 +560,13 @@ void BookmarkBarView::SetBookmarkBarState( ...@@ -560,10 +560,13 @@ void BookmarkBarView::SetBookmarkBarState(
BookmarkBar::State state, BookmarkBar::State state,
BookmarkBar::AnimateChangeType animate_type) { BookmarkBar::AnimateChangeType animate_type) {
if (animate_type == BookmarkBar::ANIMATE_STATE_CHANGE && animations_enabled) { if (animate_type == BookmarkBar::ANIMATE_STATE_CHANGE && animations_enabled) {
if (state == BookmarkBar::SHOW) if (state == BookmarkBar::SHOW) {
size_animation_.Show(); size_animation_.Show();
else } else {
if (read_later_button_)
read_later_button_->CloseBubble();
size_animation_.Hide(); size_animation_.Hide();
}
} else { } else {
size_animation_.Reset(state == BookmarkBar::SHOW ? 1 : 0); size_animation_.Reset(state == BookmarkBar::SHOW ? 1 : 0);
if (!animations_enabled) if (!animations_enabled)
......
...@@ -106,6 +106,11 @@ const char* ReadLaterButton::GetClassName() const { ...@@ -106,6 +106,11 @@ const char* ReadLaterButton::GetClassName() const {
return "ReadLaterButton"; return "ReadLaterButton";
} }
void ReadLaterButton::CloseBubble() {
if (webui_bubble_manager_->GetBubbleWidget())
webui_bubble_manager_->CloseBubble();
}
std::unique_ptr<views::InkDrop> ReadLaterButton::CreateInkDrop() { std::unique_ptr<views::InkDrop> ReadLaterButton::CreateInkDrop() {
std::unique_ptr<views::InkDropImpl> ink_drop = std::unique_ptr<views::InkDropImpl> ink_drop =
CreateDefaultFloodFillInkDropImpl(); CreateDefaultFloodFillInkDropImpl();
......
...@@ -24,6 +24,8 @@ class ReadLaterButton : public views::LabelButton { ...@@ -24,6 +24,8 @@ class ReadLaterButton : public views::LabelButton {
const char* GetClassName() const override; const char* GetClassName() const override;
void CloseBubble();
private: private:
// LabelButton: // LabelButton:
std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDrop> CreateInkDrop() override;
......
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