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