| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 GdkEventButton* event) OVERRIDE; | 49 GdkEventButton* event) OVERRIDE; |
| 50 virtual void SaveWindowPosition() OVERRIDE; | 50 virtual void SaveWindowPosition() OVERRIDE; |
| 51 virtual void SetGeometryHints() OVERRIDE; | 51 virtual void SetGeometryHints() OVERRIDE; |
| 52 virtual bool UseCustomFrame() OVERRIDE; | 52 virtual bool UseCustomFrame() OVERRIDE; |
| 53 virtual void OnSizeChanged(int width, int height) OVERRIDE; | 53 virtual void OnSizeChanged(int width, int height) OVERRIDE; |
| 54 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, | 54 virtual void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, |
| 55 GdkEventExpose* event) OVERRIDE; | 55 GdkEventExpose* event) OVERRIDE; |
| 56 virtual void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, | 56 virtual void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, |
| 57 GdkEventExpose* event) OVERRIDE; | 57 GdkEventExpose* event) OVERRIDE; |
| 58 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; | 58 virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE; |
| 59 // 'focus-in-event' handler. | |
| 60 virtual void HandleFocusIn(GtkWidget* widget, | |
| 61 GdkEventFocus* event) OVERRIDE; | |
| 62 | 59 |
| 63 // Overridden from NativePanel: | 60 // Overridden from NativePanel: |
| 64 virtual void ShowPanel() OVERRIDE; | 61 virtual void ShowPanel() OVERRIDE; |
| 65 virtual void ShowPanelInactive() OVERRIDE; | 62 virtual void ShowPanelInactive() OVERRIDE; |
| 66 virtual gfx::Rect GetPanelBounds() const OVERRIDE; | 63 virtual gfx::Rect GetPanelBounds() const OVERRIDE; |
| 67 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; | 64 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; |
| 68 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) OVERRIDE; | 65 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) OVERRIDE; |
| 69 virtual void ClosePanel() OVERRIDE; | 66 virtual void ClosePanel() OVERRIDE; |
| 70 virtual void ActivatePanel() OVERRIDE; | 67 virtual void ActivatePanel() OVERRIDE; |
| 71 virtual void DeactivatePanel() OVERRIDE; | 68 virtual void DeactivatePanel() OVERRIDE; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 gfx::Rect bounds_; | 127 gfx::Rect bounds_; |
| 131 | 128 |
| 132 scoped_ptr<PanelDragGtk> drag_helper_; | 129 scoped_ptr<PanelDragGtk> drag_helper_; |
| 133 | 130 |
| 134 // Size of window frame. Empty until the window has been allocated and sized. | 131 // Size of window frame. Empty until the window has been allocated and sized. |
| 135 gfx::Size frame_size_; | 132 gfx::Size frame_size_; |
| 136 | 133 |
| 137 // Indicates that the panel is currently drawing attention. | 134 // Indicates that the panel is currently drawing attention. |
| 138 bool is_drawing_attention_; | 135 bool is_drawing_attention_; |
| 139 | 136 |
| 140 // Disable ExpansionState changes on mouse click for a short duration. | |
| 141 // This is needed in case the window gains focus as result of mouseDown while | |
| 142 // being already expanded and drawing attention - in this case, we don't | |
| 143 // want to minimize it on subsequent mouseUp. | |
| 144 // We use time interval because the window may gain focus in various ways | |
| 145 // (via keyboard for example) which are not distinguishable at this point. | |
| 146 // Apparently this disable interval is not affecting the user in other cases. | |
| 147 base::Time disableMinimizeUntilTime_; | |
| 148 | |
| 149 // Used to animate the bounds change. | 137 // Used to animate the bounds change. |
| 150 scoped_ptr<PanelBoundsAnimation> bounds_animator_; | 138 scoped_ptr<PanelBoundsAnimation> bounds_animator_; |
| 151 gfx::Rect animation_start_bounds_; | 139 gfx::Rect animation_start_bounds_; |
| 152 | 140 |
| 153 // This records the bounds set on the last animation progress notification. | 141 // This records the bounds set on the last animation progress notification. |
| 154 // We need this for the case where a new bounds animation starts before the | 142 // We need this for the case where a new bounds animation starts before the |
| 155 // current one completes. In this case, we want to start the new animation | 143 // current one completes. In this case, we want to start the new animation |
| 156 // from where the last one left. | 144 // from where the last one left. |
| 157 gfx::Rect last_animation_progressed_bounds_; | 145 gfx::Rect last_animation_progressed_bounds_; |
| 158 | 146 |
| 159 content::NotificationRegistrar registrar_; | 147 content::NotificationRegistrar registrar_; |
| 160 | 148 |
| 161 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); | 149 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); |
| 162 }; | 150 }; |
| 163 | 151 |
| 164 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 152 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| OLD | NEW |