Chromium Code Reviews| Index: chrome/browser/ui/panels/panel.cc |
| diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc |
| index 7d894a5b223a15de0ffa34c365df19e651b0fa97..668b9073298f5b7641058ab2227410bb8f4cf623 100644 |
| --- a/chrome/browser/ui/panels/panel.cc |
| +++ b/chrome/browser/ui/panels/panel.cc |
| @@ -686,9 +686,23 @@ void Panel::Observe(int type, |
| ConfigureAutoResize(content::Source<WebContents>(source).ptr()); |
| } |
| -void Panel::OnActiveStateChanged() { |
| +void Panel::OnActiveStateChanged(bool active) { |
| + // Clear draw attention state when an expanded panel becomes active. |
|
jianli
2012/04/25 18:19:31
remove "draw" in the comment?
jennb
2012/04/25 20:34:05
Done.
|
| + // On some systems (e.g. Win), mouse-down activates a panel regardless of |
| + // its expansion state. However, we don't want to clear draw attention if |
| + // contents are not visible. In that scenario, if the mouse-down results |
| + // in a mouse-click, draw attention will be cleared then. |
| + // See Panel::OnTitlebarClicked(). |
| + if (active && IsDrawingAttention() && !IsMinimized()) |
| + FlashFrame(false); |
| + |
| if (panel_strip_) |
| panel_strip_->OnPanelActiveStateChanged(this); |
| + |
| + content::NotificationService::current()->Notify( |
| + chrome::NOTIFICATION_PANEL_CHANGED_ACTIVE_STATUS, |
| + content::Source<Panel>(this), |
| + content::NotificationService::NoDetails()); |
| } |
| void Panel::ConfigureAutoResize(WebContents* web_contents) { |
| @@ -712,6 +726,17 @@ void Panel::OnWindowSizeAvailable() { |
| void Panel::OnTitlebarClicked(panel::ClickModifier modifier) { |
| if (panel_strip_) |
| panel_strip_->OnPanelTitlebarClicked(this, modifier); |
| + |
| + // Normally the system activates a window when the titlebar is clicked. |
| + // However, we prevent system activation of minimized panels, thus the |
| + // activation may not have occurred. Also, some OSes (Windows) will |
| + // activate a minimized panel on mouse-down regardless of our attempts to |
| + // prevent system activation. Attention state is not cleared in that case. |
| + // See Panel::OnActiveStateChanged(). |
| + // Therefore, we ensure activation and clearing of attention state here. |
| + // These are no-ops if no changes are needed. |
| + Activate(); |
| + FlashFrame(false); |
| } |
| void Panel::DestroyBrowser() { |