| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 10 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 GdkEventButton* event) OVERRIDE; | 52 GdkEventButton* event) OVERRIDE; |
| 53 virtual void SaveWindowPosition() OVERRIDE; | 53 virtual void SaveWindowPosition() OVERRIDE; |
| 54 virtual void SetGeometryHints() OVERRIDE; | 54 virtual void SetGeometryHints() OVERRIDE; |
| 55 virtual bool UseCustomFrame() OVERRIDE; | 55 virtual bool UseCustomFrame() OVERRIDE; |
| 56 virtual void OnSizeChanged(int width, int height) OVERRIDE; | 56 virtual void OnSizeChanged(int width, int height) OVERRIDE; |
| 57 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, | 57 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, |
| 58 GdkEventExpose* event) OVERRIDE; | 58 GdkEventExpose* event) OVERRIDE; |
| 59 virtual void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, | 59 virtual void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, |
| 60 GdkEventExpose* event) OVERRIDE; | 60 GdkEventExpose* event) OVERRIDE; |
| 61 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; | 61 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; |
| 62 // 'focus-in-event' handler. | |
| 63 virtual void HandleFocusIn(GtkWidget* widget, | |
| 64 GdkEventFocus* event) OVERRIDE; | |
| 65 | 62 |
| 66 // Overridden from NativePanel: | 63 // Overridden from NativePanel: |
| 67 virtual void ShowPanel() OVERRIDE; | 64 virtual void ShowPanel() OVERRIDE; |
| 68 virtual void ShowPanelInactive() OVERRIDE; | 65 virtual void ShowPanelInactive() OVERRIDE; |
| 69 virtual gfx::Rect GetPanelBounds() const OVERRIDE; | 66 virtual gfx::Rect GetPanelBounds() const OVERRIDE; |
| 70 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; | 67 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; |
| 71 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) OVERRIDE; | 68 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) OVERRIDE; |
| 72 virtual void ClosePanel() OVERRIDE; | 69 virtual void ClosePanel() OVERRIDE; |
| 73 virtual void ActivatePanel() OVERRIDE; | 70 virtual void ActivatePanel() OVERRIDE; |
| 74 virtual void DeactivatePanel() OVERRIDE; | 71 virtual void DeactivatePanel() OVERRIDE; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 gfx::Rect bounds_; | 178 gfx::Rect bounds_; |
| 182 | 179 |
| 183 scoped_ptr<PanelDragGtk> drag_helper_; | 180 scoped_ptr<PanelDragGtk> drag_helper_; |
| 184 | 181 |
| 185 // Size of window frame. Empty until the window has been allocated and sized. | 182 // Size of window frame. Empty until the window has been allocated and sized. |
| 186 gfx::Size frame_size_; | 183 gfx::Size frame_size_; |
| 187 | 184 |
| 188 // Indicates that the panel is currently drawing attention. | 185 // Indicates that the panel is currently drawing attention. |
| 189 bool is_drawing_attention_; | 186 bool is_drawing_attention_; |
| 190 | 187 |
| 191 // Disable ExpansionState changes on mouse click for a short duration. | |
| 192 // This is needed in case the window gains focus as result of mouseDown while | |
| 193 // being already expanded and drawing attention - in this case, we don't | |
| 194 // want to minimize it on subsequent mouseUp. | |
| 195 // We use time interval because the window may gain focus in various ways | |
| 196 // (via keyboard for example) which are not distinguishable at this point. | |
| 197 // Apparently this disable interval is not affecting the user in other cases. | |
| 198 base::Time disableMinimizeUntilTime_; | |
| 199 | |
| 200 // Used to animate the bounds change. | 188 // Used to animate the bounds change. |
| 201 scoped_ptr<PanelBoundsAnimation> bounds_animator_; | 189 scoped_ptr<PanelBoundsAnimation> bounds_animator_; |
| 202 gfx::Rect animation_start_bounds_; | 190 gfx::Rect animation_start_bounds_; |
| 203 | 191 |
| 204 // This records the bounds set on the last animation progress notification. | 192 // This records the bounds set on the last animation progress notification. |
| 205 // We need this for the case where a new bounds animation starts before the | 193 // We need this for the case where a new bounds animation starts before the |
| 206 // current one completes. In this case, we want to start the new animation | 194 // current one completes. In this case, we want to start the new animation |
| 207 // from where the last one left. | 195 // from where the last one left. |
| 208 gfx::Rect last_animation_progressed_bounds_; | 196 gfx::Rect last_animation_progressed_bounds_; |
| 209 | 197 |
| 210 // The close button is not shown when panel is in icon only mode in overflow. | 198 // The close button is not shown when panel is in icon only mode in overflow. |
| 211 bool show_close_button_; | 199 bool show_close_button_; |
| 212 | 200 |
| 213 content::NotificationRegistrar registrar_; | 201 content::NotificationRegistrar registrar_; |
| 214 | 202 |
| 215 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); | 203 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); |
| 216 }; | 204 }; |
| 217 | 205 |
| 218 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 206 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| OLD | NEW |