Commit 45c7e3ea authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Prevent tooltips from showing after a context menu shows

Just check before showing the tooltip.

Bug: 857258
Change-Id: Ie9b6768d89ac65ff21bbf729c7fc84a467a98790
Reviewed-on: https://chromium-review.googlesource.com/1240209Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593683}
parent c4e97143
......@@ -442,7 +442,7 @@ bool ShelfView::IsShowingMenu() const {
shelf_menu_model_adapter_->IsShowingMenu();
}
bool ShelfView::IsShowingMenuForView(views::View* view) const {
bool ShelfView::IsShowingMenuForView(const views::View* view) const {
return IsShowingMenu() &&
shelf_menu_model_adapter_->IsShowingMenuForView(*view);
}
......@@ -502,8 +502,8 @@ bool ShelfView::ShouldShowTooltipForView(const views::View* view) const {
// Don't show a tooltip for a view that's currently being dragged.
if (view == drag_view_)
return false;
const ShelfItem* item = ShelfItemForView(view);
return item != nullptr;
return ShelfItemForView(view) && !IsShowingMenuForView(view);
}
base::string16 ShelfView::GetTitleForView(const views::View* view) const {
......
......@@ -134,7 +134,7 @@ class ASH_EXPORT ShelfView : public views::View,
// Returns true if we're showing a menu for |view|. |view| could be a
// ShelfButton or the ShelfView.
bool IsShowingMenuForView(views::View* view) const;
bool IsShowingMenuForView(const views::View* view) const;
// Returns true if overflow bubble is shown.
bool IsShowingOverflowBubble() 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