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 c9342e02c86ccdf031a714d97855f9a16d7598d2..857b50be4dad669e98a67a7ed186f033f2dce7f4 100644 |
--- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
+++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
@@ -70,6 +70,7 @@ PanelBrowserWindowGtk::~PanelBrowserWindowGtk() { |
DestroyDragWidget(); |
} |
panel_->OnNativePanelClosed(); |
+ ui::WorkAreaWatcherX::RemoveObserver(this); |
} |
void PanelBrowserWindowGtk::Init() { |
@@ -92,6 +93,15 @@ void PanelBrowserWindowGtk::Init() { |
G_CALLBACK(OnTitlebarButtonPressEventThunk), this); |
g_signal_connect(titlebar_widget(), "button-release-event", |
G_CALLBACK(OnTitlebarButtonReleaseEventThunk), this); |
+ |
+ // Strictly speaking we should have a single observer for work area changed |
Dmitry Titov
2011/11/18 04:56:37
Not sure that long comment has to be here. If it's
prasadt
2011/11/18 22:31:42
Just a clarification in case someone wonders why i
|
+ // notification. There are a few reasons for doing it this way: |
+ // 1) Keep it consistent with the way we do it on other platforms. |
+ // 2) This is a rare enough event to create a separate class with |
+ // implementations for all platforms. |
+ // 3) It may not be possible to listen to this event without assoicating it |
+ // with a window on all platforms. |
+ ui::WorkAreaWatcherX::AddObserver(this); |
} |
bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { |
@@ -225,6 +235,10 @@ BrowserWindowGtk::TitleDecoration PanelBrowserWindowGtk::GetWindowTitle( |
} |
} |
+void PanelBrowserWindowGtk::WorkAreaChanged() { |
+ panel_->manager()->OnDisplayChanged(); |
+} |
+ |
void PanelBrowserWindowGtk::ShowPanel() { |
Show(); |
} |