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 dd5df4d128204b73af94cf9761f3d4005437e1d6..ac275dc1f2d26a7ae741d03824abfd762e22d953 100644 |
--- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
+++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
@@ -27,10 +27,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'>"; |
@@ -242,14 +238,11 @@ void PanelBrowserWindowGtk::DrawAttentionFrame(cairo_t* cr, |
void PanelBrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { |
bool was_active = IsActive(); |
BrowserWindowGtk::ActiveWindowChanged(active_window); |
- if (!window() || was_active == IsActive()) // State didn't change. |
+ bool is_active = IsActive(); |
+ if (!window() || was_active == is_active) // State didn't change. |
return; |
- content::NotificationService::current()->Notify( |
- chrome::NOTIFICATION_PANEL_CHANGED_ACTIVE_STATUS, |
- content::Source<Panel>(panel_.get()), |
- content::NotificationService::NoDetails()); |
- panel_->OnActiveStateChanged(); |
+ panel_->OnActiveStateChanged(is_active); |
} |
BrowserWindowGtk::TitleDecoration PanelBrowserWindowGtk::GetWindowTitle( |
@@ -570,44 +563,11 @@ gboolean PanelBrowserWindowGtk::OnTitlebarButtonReleaseEvent( |
if (event->button != 1) |
return TRUE; |
- 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); |
- |
- // Do not clear draw attention if user cannot see contents of panel. |
- if (!is_drawing_attention_ || panel_->IsMinimized()) |
- return; |
- |
- panel_->FlashFrame(false); |
- |
- disableMinimizeUntilTime_ = base::Time::Now() + |
- base::TimeDelta::FromMilliseconds(kSuspendMinimizeOnClickIntervalMs); |
-} |
- |
// NativePanelTesting implementation. |
class NativePanelTestingGtk : public NativePanelTesting { |
public: |