Chromium Code Reviews| 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 3f83e355a0f0a8f3df52ef1b9562ae0eb9b7e70d..3adcdd55e3bf285a51053355c4c19a280c56e2b6 100644 |
| --- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| +++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| @@ -95,6 +95,10 @@ void PanelBrowserWindowGtk::Init() { |
| G_CALLBACK(OnTitlebarButtonReleaseEventThunk), this); |
| ui::WorkAreaWatcherX::AddObserver(this); |
| + registrar_.Add( |
| + this, |
| + chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
| + content::Source<Panel>(panel_.get())); |
| } |
| bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { |
| @@ -231,6 +235,19 @@ void PanelBrowserWindowGtk::WorkAreaChanged() { |
| panel_->manager()->OnDisplayChanged(); |
| } |
| +void PanelBrowserWindowGtk::Observe( |
| + int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) { |
| + if (type == chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE) { |
| + bool accept_focus = (panel_->expansion_state() == Panel::EXPANDED); |
| + gdk_window_set_accept_focus( |
| + gtk_widget_get_window(GTK_WIDGET(window())), accept_focus); |
|
jennb
2012/02/01 00:31:47
This also disables focus for OVERFLOW and TITLE_ON
prasadt
2012/02/01 00:37:47
Yes, its intentional.
|
| + } else { |
| + BrowserWindowGtk::Observe(type, source, details); |
|
Dmitry Titov
2012/02/01 01:30:57
Having this method overridden looks dangerous. Wha
prasadt
2012/02/01 01:52:28
Done. Makes sense now that the method is overridde
|
| + } |
| +} |
| + |
| void PanelBrowserWindowGtk::ShowPanel() { |
| Show(); |
| } |
| @@ -279,8 +296,6 @@ void PanelBrowserWindowGtk::ClosePanel() { |
| } |
| void PanelBrowserWindowGtk::ActivatePanel() { |
| - gdk_window_set_accept_focus( |
| - gtk_widget_get_window(GTK_WIDGET(window())), TRUE); |
| Activate(); |
| } |
| @@ -292,11 +307,6 @@ void PanelBrowserWindowGtk::DeactivatePanel() { |
| } else { |
| Deactivate(); |
| } |
| - |
| - if (panel_->expansion_state() == Panel::MINIMIZED) { |
| - gdk_window_set_accept_focus( |
| - gtk_widget_get_window(GTK_WIDGET(window())), FALSE); |
| - } |
| } |
| bool PanelBrowserWindowGtk::IsPanelActive() const { |