Skip to content

Commit

Permalink
The palette should block shelf autohide when it is open.
Browse files Browse the repository at this point in the history
BUG=616112

Review-Url: https://codereview.chromium.org/2257363003
Cr-Commit-Position: refs/heads/master@{#413928}
  • Loading branch information
jdufault authored and Commit bot committed Aug 24, 2016
1 parent ea253f5 commit d98076e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ash/common/system/chromeos/palette/palette_tray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ void PaletteTray::HidePalette() {
bubble_.reset();
}

bool PaletteTray::ShouldBlockShelfAutoHide() const {
return !!bubble_;
}

void PaletteTray::OnActiveToolChanged() {
UpdateTrayIcon();
}
Expand Down
3 changes: 3 additions & 0 deletions ash/common/system/chromeos/palette/palette_tray.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class ASH_EXPORT PaletteTray : public TrayBackgroundView,
// PaletteToolManager::Delegate:
void HidePalette() override;

// Returns true if the shelf should not autohide.
bool ShouldBlockShelfAutoHide() const;

private:
// views::TrayBubbleView::Delegate:
void BubbleViewDestroyed() override;
Expand Down
5 changes: 5 additions & 0 deletions ash/common/system/status_area_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ bool StatusAreaWidget::ShouldShowShelf() const {
web_notification_tray_->ShouldBlockShelfAutoHide()))
return true;

#if defined(OS_CHROMEOS)
if (palette_tray_ && palette_tray_->ShouldBlockShelfAutoHide())
return true;
#endif

if (!wm_shelf_->IsVisible())
return false;

Expand Down

0 comments on commit d98076e

Please sign in to comment.