Index: chrome/browser/ui/panels/panel_browser_window_gtk.cc |
diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.cc b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
index 5f5f0401bab2c01276f3a3152da06834b7af39b5..47b2c44421743848f86b17e08854320fa6c87b66 100644 |
--- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
+++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
@@ -28,10 +28,6 @@ const float kDrawAttentionRFraction = kDrawAttentionR / 255.0; |
const float kDrawAttentionGFraction = kDrawAttentionG / 255.0; |
const float kDrawAttentionBFraction = kDrawAttentionB / 255.0; |
-// Delay before click on a titlebar is allowed to minimize the panel after |
-// the 'draw attention' mode has been cleared. |
-const int kSuspendMinimizeOnClickIntervalMs = 500; |
- |
// Markup for title text in draw attention state. Set to color white. |
const char* const kDrawAttentionTitleMarkupPrefix = |
"<span fgcolor='#ffffff'>"; |
@@ -252,6 +248,11 @@ void PanelBrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { |
if (!window() || was_active == IsActive()) // State didn't change. |
return; |
+ if (IsActive() && is_drawing_attention_) { |
+ DCHECK(!panel_->IsMinimized()); |
+ panel_->FlashFrame(false); |
+ } |
+ |
content::NotificationService::current()->Notify( |
chrome::NOTIFICATION_PANEL_CHANGED_ACTIVE_STATUS, |
content::Source<Panel>(panel_.get()), |
@@ -708,44 +709,11 @@ gboolean PanelBrowserWindowGtk::OnTitlebarButtonReleaseEvent( |
CleanupDragDrop(); |
- if (event->state & GDK_CONTROL_MASK) { |
- panel_->OnTitlebarClicked(panel::APPLY_TO_ALL); |
- return TRUE; |
- } |
- |
- // TODO(jennb): Move remaining titlebar click handling out of here. |
- // (http://crbug.com/118431) |
- PanelStrip* panel_strip = panel_->panel_strip(); |
- if (!panel_strip) |
- return TRUE; |
- |
- if (panel_strip->type() == PanelStrip::DOCKED && |
- panel_->expansion_state() == Panel::EXPANDED) { |
- if (base::Time::Now() < disableMinimizeUntilTime_) |
- return TRUE; |
- |
- panel_->SetExpansionState(Panel::MINIMIZED); |
- } else { |
- panel_->Activate(); |
- } |
- |
+ panel_->OnTitlebarClicked((event->state & GDK_CONTROL_MASK) ? |
+ panel::APPLY_TO_ALL : panel::NO_MODIFIER); |
return TRUE; |
} |
-void PanelBrowserWindowGtk::HandleFocusIn(GtkWidget* widget, |
- GdkEventFocus* event) { |
- BrowserWindowGtk::HandleFocusIn(widget, event); |
- |
- if (!is_drawing_attention_) |
- return; |
- |
- panel_->FlashFrame(false); |
- DCHECK(panel_->expansion_state() == Panel::EXPANDED); |
- |
- disableMinimizeUntilTime_ = base::Time::Now() + |
- base::TimeDelta::FromMilliseconds(kSuspendMinimizeOnClickIntervalMs); |
-} |
- |
void PanelBrowserWindowGtk::OnDragBegin(GtkWidget* widget, |
GdkDragContext* context) { |
// Set drag icon to be a transparent pixbuf. |