6185654430675e738e0ce56edfb89965f4e835e3
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / gtk / browser_window_gtk.h
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_
7
8 #include <gtk/gtk.h>
9
10 #include <string>
11
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/prefs/pref_member.h"
16 #include "base/timer/timer.h"
17 #include "build/build_config.h"
18 #include "chrome/browser/devtools/devtools_window.h"
19 #include "chrome/browser/extensions/extension_keybinding_registry.h"
20 #include "chrome/browser/infobars/infobar_container.h"
21 #include "chrome/browser/ui/browser_window.h"
22 #include "chrome/browser/ui/host_desktop.h"
23 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
24 #include "ui/base/gtk/gtk_floating_container.h"
25 #include "ui/base/gtk/gtk_signal.h"
26 #include "ui/base/ui_base_types.h"
27 #include "ui/base/x/active_window_watcher_x_observer.h"
28 #include "ui/base/x/x11_util.h"
29 #include "ui/gfx/rect.h"
30
31 class BookmarkBarGtk;
32 class Browser;
33 class BrowserTitlebar;
34 class BrowserToolbarGtk;
35 class DevToolsWindow;
36 class DownloadShelfGtk;
37 class ExtensionKeybindingRegistryGtk;
38 class FindBarGtk;
39 class FullscreenExitBubbleGtk;
40 class GlobalMenuBar;
41 class InfoBarContainerGtk;
42 class InstantOverlayControllerGtk;
43 class LocationBar;
44 class StatusBubbleGtk;
45 class TabContentsContainerGtk;
46 class TabStripGtk;
47
48 namespace autofill {
49 class PasswordGenerator;
50 }
51
52 namespace extensions {
53 class ActiveTabPermissionGranter;
54 class Extension;
55 }
56
57 namespace user_prefs {
58 class PrefRegistrySyncable;
59 }
60
61 // An implementation of BrowserWindow for GTK. Cross-platform code will interact
62 // with this object when it needs to manipulate the window.
63 class BrowserWindowGtk
64     : public BrowserWindow,
65       public content::NotificationObserver,
66       public TabStripModelObserver,
67       public ui::ActiveWindowWatcherXObserver,
68       public InfoBarContainer::Delegate,
69       public extensions::ExtensionKeybindingRegistry::Delegate {
70  public:
71   explicit BrowserWindowGtk(Browser* browser);
72   virtual ~BrowserWindowGtk();
73
74   // Separating initialization from constructor.
75   void Init();
76
77   // Overridden from BrowserWindow:
78   virtual void Show() OVERRIDE;
79   virtual void ShowInactive() OVERRIDE;
80   virtual void Hide() OVERRIDE;
81   virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
82   virtual void Close() OVERRIDE;
83   virtual void Activate() OVERRIDE;
84   virtual void Deactivate() OVERRIDE;
85   virtual bool IsActive() const OVERRIDE;
86   virtual void FlashFrame(bool flash) OVERRIDE;
87   virtual bool IsAlwaysOnTop() const OVERRIDE;
88   virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
89   virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
90   virtual BrowserWindowTesting* GetBrowserWindowTesting() OVERRIDE;
91   virtual StatusBubble* GetStatusBubble() OVERRIDE;
92   virtual void UpdateTitleBar() OVERRIDE;
93   virtual void BookmarkBarStateChanged(
94       BookmarkBar::AnimateChangeType change_type) OVERRIDE;
95   virtual void UpdateDevTools() OVERRIDE;
96   virtual void UpdateLoadingAnimations(bool should_animate) OVERRIDE;
97   virtual void SetStarredState(bool is_starred) OVERRIDE;
98   virtual void SetTranslateIconToggled(bool is_lit) OVERRIDE;
99   virtual void OnActiveTabChanged(content::WebContents* old_contents,
100                                   content::WebContents* new_contents,
101                                   int index,
102                                   int reason) OVERRIDE;
103   virtual void ZoomChangedForActiveTab(bool can_show_bubble) OVERRIDE;
104   virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
105   virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
106   virtual gfx::Rect GetBounds() const OVERRIDE;
107   virtual bool IsMaximized() const OVERRIDE;
108   virtual bool IsMinimized() const OVERRIDE;
109   virtual void Maximize() OVERRIDE;
110   virtual void Minimize() OVERRIDE;
111   virtual void Restore() OVERRIDE;
112   virtual void EnterFullscreen(
113       const GURL& url, FullscreenExitBubbleType type) OVERRIDE;
114   virtual void ExitFullscreen() OVERRIDE;
115   virtual void UpdateFullscreenExitBubbleContent(
116       const GURL& url,
117       FullscreenExitBubbleType bubble_type) OVERRIDE;
118   virtual bool ShouldHideUIForFullscreen() const OVERRIDE;
119   virtual bool IsFullscreen() const OVERRIDE;
120   virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
121   virtual LocationBar* GetLocationBar() const OVERRIDE;
122   virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
123   virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE;
124   virtual void UpdateToolbar(content::WebContents* contents) OVERRIDE;
125   virtual void FocusToolbar() OVERRIDE;
126   virtual void FocusAppMenu() OVERRIDE;
127   virtual void FocusBookmarksToolbar() OVERRIDE;
128   virtual void FocusInfobars() OVERRIDE;
129   virtual void RotatePaneFocus(bool forwards) OVERRIDE;
130   virtual bool IsBookmarkBarVisible() const OVERRIDE;
131   virtual bool IsBookmarkBarAnimating() const OVERRIDE;
132   virtual bool IsTabStripEditable() const OVERRIDE;
133   virtual bool IsToolbarVisible() const OVERRIDE;
134   virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
135   virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
136                                         Profile* profile) OVERRIDE;
137   virtual void ShowUpdateChromeDialog() OVERRIDE;
138   virtual void ShowBookmarkBubble(const GURL& url,
139                                   bool already_bookmarked) OVERRIDE;
140   virtual void ShowTranslateBubble(
141       content::WebContents* contents,
142       TranslateBubbleModel::ViewState view_state,
143       TranslateErrors::Type error_type) OVERRIDE;
144 #if defined(ENABLE_ONE_CLICK_SIGNIN)
145   virtual void ShowOneClickSigninBubble(
146       OneClickSigninBubbleType type,
147       const base::string16& email,
148       const base::string16& error_message,
149       const StartSyncCallback& start_sync_callback) OVERRIDE;
150 #endif
151   virtual bool IsDownloadShelfVisible() const OVERRIDE;
152   virtual DownloadShelf* GetDownloadShelf() OVERRIDE;
153   virtual void ConfirmBrowserCloseWithPendingDownloads(
154       int download_count,
155       Browser::DownloadClosePreventionType dialog_type,
156       bool app_modal,
157       const base::Callback<void(bool)>& callback) OVERRIDE;
158   virtual void UserChangedTheme() OVERRIDE;
159   virtual int GetExtraRenderViewHeight() const OVERRIDE;
160   virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
161   virtual void ShowWebsiteSettings(Profile* profile,
162                                    content::WebContents* web_contents,
163                                    const GURL& url,
164                                    const content::SSLStatus& ssl) OVERRIDE;
165   virtual void ShowAppMenu() OVERRIDE;
166   virtual bool PreHandleKeyboardEvent(
167       const content::NativeWebKeyboardEvent& event,
168       bool* is_keyboard_shortcut) OVERRIDE;
169   virtual void HandleKeyboardEvent(
170       const content::NativeWebKeyboardEvent& event) OVERRIDE;
171   virtual void Cut() OVERRIDE;
172   virtual void Copy() OVERRIDE;
173   virtual void Paste() OVERRIDE;
174   virtual WindowOpenDisposition GetDispositionForPopupBounds(
175       const gfx::Rect& bounds) OVERRIDE;
176   virtual FindBar* CreateFindBar() OVERRIDE;
177   virtual web_modal::WebContentsModalDialogHost*
178       GetWebContentsModalDialogHost() OVERRIDE;
179   virtual void ShowAvatarBubble(content::WebContents* web_contents,
180                                 const gfx::Rect& rect) OVERRIDE;
181   virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
182   virtual void ShowPasswordGenerationBubble(
183       const gfx::Rect& rect,
184       const autofill::PasswordForm& form,
185       autofill::PasswordGenerator* password_generator) OVERRIDE;
186   virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() OVERRIDE;
187
188   // Overridden from NotificationObserver:
189   virtual void Observe(int type,
190                        const content::NotificationSource& source,
191                        const content::NotificationDetails& details) OVERRIDE;
192
193   // Overridden from TabStripModelObserver:
194   virtual void TabDetachedAt(content::WebContents* contents,
195                              int index) OVERRIDE;
196
197   // Overridden from ActiveWindowWatcherXObserver.
198   virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
199
200   // Overridden from InfoBarContainer::Delegate:
201   virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE;
202   virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE;
203   virtual bool DrawInfoBarArrows(int* x) const OVERRIDE;
204
205   // Overridden from ExtensionKeybindingRegistry::Delegate:
206   virtual extensions::ActiveTabPermissionGranter*
207       GetActiveTabPermissionGranter() OVERRIDE;
208
209   // Accessor for the tab strip.
210   TabStripGtk* tabstrip() const { return tabstrip_.get(); }
211
212   void OnDebouncedBoundsChanged();
213
214   // Request the underlying window to unmaximize.
215   void UnMaximize();
216
217   // Returns false if we're not ready to close yet.  E.g., a tab may have an
218   // onbeforeunload handler that prevents us from closing.
219   bool CanClose() const;
220
221   // Returns whether to draw the content drop shadow on the sides and bottom
222   // of the browser window. When false, we still draw a shadow on the top of
223   // the toolbar (under the tab strip), but do not round the top corners.
224   bool ShouldDrawContentDropShadow() const;
225
226   bool ShouldShowWindowIcon() const;
227
228   // Add the find bar widget to the window hierarchy.
229   void AddFindBar(FindBarGtk* findbar);
230
231   // Reset the mouse cursor to the default cursor if it was set to something
232   // else for the custom frame.
233   void ResetCustomFrameCursor();
234
235   // Returns the BrowserWindowGtk registered with |window|.
236   static BrowserWindowGtk* GetBrowserWindowForNativeWindow(
237       gfx::NativeWindow window);
238
239   // Retrieves the GtkWindow associated with |xid|, which is the X Window
240   // ID of the top-level X window of this object.
241   static GtkWindow* GetBrowserWindowForXID(XID xid);
242
243   Browser* browser() const { return browser_.get(); }
244
245   GtkWindow* window() const { return window_; }
246
247   BrowserTitlebar* titlebar() const { return titlebar_.get(); }
248
249   GtkWidget* titlebar_widget() const;
250
251   BrowserToolbarGtk* GetToolbar() { return toolbar_.get(); }
252
253   gfx::Rect bounds() const { return bounds_; }
254
255   // Returns the tab we're currently displaying in the tab contents container.
256   content::WebContents* GetDisplayedTab();
257
258   static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
259
260   // Tells GTK that the toolbar area is invalidated and needs redrawing. We
261   // have this method as a hack because GTK doesn't queue the toolbar area for
262   // redraw when it should.
263   void QueueToolbarRedraw();
264
265   // Get the position where the infobar arrow should be anchored in
266   // |relative_to| coordinates. This is the middle of the omnibox location icon.
267   int GetXPositionOfLocationIcon(GtkWidget* relative_to);
268
269   // Show or hide the bookmark bar.
270   void MaybeShowBookmarkBar(bool animate);
271
272  protected:
273   virtual void DestroyBrowser() OVERRIDE;
274
275   // Checks to see if the mouse pointer at |x|, |y| is over the border of the
276   // custom frame (a spot that should trigger a window resize). Returns true if
277   // it should and sets |edge|.
278   bool GetWindowEdge(int x, int y, GdkWindowEdge* edge);
279
280   // Returns the window shape for the window with |width| and |height|.
281   // The caller is responsible for destroying the region if non-null region is
282   // returned.
283   GdkRegion* GetWindowShape(int width, int height) const;
284
285   // Save the window position in the prefs.
286   void SaveWindowPosition();
287
288   // Sets the default size for the window and the way the user is allowed to
289   // resize it.
290   void SetGeometryHints();
291
292   // Returns |true| if we should use the custom frame.
293   bool UseCustomFrame() const;
294
295   // Invalidate window to force repaint.
296   void InvalidateWindow();
297
298   // Top level window. NULL after the window starts closing.
299   GtkWindow* window_;
300   // Determines whether window was shown.
301   bool window_has_shown_;
302   // GtkAlignment that holds the interior components of the chromium window.
303   // This is used to draw the custom frame border and content shadow. Owned by
304   // window_.
305   GtkWidget* window_container_;
306   // VBox that holds everything (tabs, toolbar, bookmarks bar, tab contents).
307   // Owned by window_container_.
308   GtkWidget* window_vbox_;
309   // VBox that holds everything below the toolbar. Owned by
310   // render_area_floating_container_.
311   GtkWidget* render_area_vbox_;
312   // Floating container that holds the render area. It is needed to position
313   // the findbar. Owned by render_area_event_box_.
314   GtkWidget* render_area_floating_container_;
315   // EventBox that holds render_area_floating_container_. Owned by window_vbox_.
316   GtkWidget* render_area_event_box_;
317   // Border between toolbar and render area. Owned by render_area_vbox_.
318   GtkWidget* toolbar_border_;
319
320   scoped_ptr<Browser> browser_;
321
322  private:
323   // Connect to signals on |window_|.
324   void ConnectHandlersToSignals();
325
326   // Create the various UI components.
327   void InitWidgets();
328
329   // Set up background color of the window (depends on if we're incognito or
330   // not).
331   void SetBackgroundColor();
332
333   // Applies the window shape to if we're in custom drawing mode.
334   void UpdateWindowShape(int width, int height);
335
336   // Connect accelerators that aren't connected to menu items (like ctrl-o,
337   // ctrl-l, etc.).
338   void ConnectAccelerators();
339
340   // Whether we should draw the tab background instead of the theme_frame
341   // background because this window is a popup.
342   bool UsingCustomPopupFrame() const;
343
344   // Draws the normal custom frame using theme_frame.
345   void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, GdkEventExpose* event);
346
347   // Draws the tab image as the frame so we can write legible text.
348   void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, GdkEventExpose* event);
349
350   // Draws the border, including resizable corners, for the custom frame.
351   void DrawCustomFrameBorder(GtkWidget* widget);
352
353   // Change whether we're showing the custom blue frame.
354   // Must be called once at startup.
355   // Triggers relayout of the content.
356   void UpdateCustomFrame();
357
358   // Set the bounds of the current window. If |exterior| is true, set the size
359   // of the window itself, otherwise set the bounds of the web contents.
360   // If |move| is true, set the position of the window, otherwise leave the
361   // position to the WM.
362   void SetBoundsImpl(const gfx::Rect& bounds, bool exterior, bool move);
363
364   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnConfigure,
365                        GdkEventConfigure*);
366   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnWindowState,
367                        GdkEventWindowState*);
368   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnMainWindowDeleteEvent,
369                        GdkEvent*);
370   CHROMEGTK_CALLBACK_0(BrowserWindowGtk, void, OnMainWindowDestroy);
371   // Callback for when the custom frame alignment needs to be redrawn.
372   // The content area includes the toolbar and web page but not the tab strip.
373   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnCustomFrameExpose,
374                        GdkEventExpose*);
375
376   // A helper method that draws the shadow above the toolbar and in the frame
377   // border during an expose.
378   void DrawContentShadow(cairo_t* cr);
379
380   // The background frame image needs to be offset by the size of the top of
381   // the window to the top of the tabs when the full skyline isn't displayed
382   // for some reason.
383   int GetVerticalOffset();
384
385   // Returns which frame image we should use based on the window's current
386   // activation state / incognito state.
387   int GetThemeFrameResource();
388
389   // Invalidate all the widgets that need to redraw when the infobar draw state
390   // has changed.
391   void InvalidateInfoBarBits();
392
393   // When the location icon moves, we have to redraw the arrow.
394   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, void, OnLocationIconSizeAllocate,
395                        GtkAllocation*);
396
397   // Used to draw the infobar arrow and drop shadow. This is connected to
398   // multiple widgets' expose events because it overlaps several widgets.
399   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnExposeDrawInfobarBits,
400                        GdkEventExpose*);
401
402   // Used to draw the infobar bits for the bookmark bar. When the bookmark
403   // bar is in floating mode, it has to draw a drop shadow only; otherwise
404   // it is responsible for its portion of the arrow as well as some shadowing.
405   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnBookmarkBarExpose,
406                        GdkEventExpose*);
407
408   // Callback for "size-allocate" signal on bookmark bar; this is relevant
409   // because when the bookmark bar changes dimensions, the infobar arrow has to
410   // change its shape, and we need to queue appropriate redraws.
411   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, void, OnBookmarkBarSizeAllocate,
412                        GtkAllocation*);
413
414   // Callback for accelerator activation. |user_data| stores the command id
415   // of the matched accelerator.
416   static gboolean OnGtkAccelerator(GtkAccelGroup* accel_group,
417                                    GObject* acceleratable,
418                                    guint keyval,
419                                    GdkModifierType modifier,
420                                    void* user_data);
421
422   // Key press event callback.
423   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnKeyPress, GdkEventKey*);
424
425   // Mouse move and mouse button press callbacks.
426   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnMouseMoveEvent,
427                        GdkEventMotion*);
428   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnButtonPressEvent,
429                        GdkEventButton*);
430
431   // Tracks focus state of browser.
432   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnFocusIn,
433                        GdkEventFocus*);
434   CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnFocusOut,
435                        GdkEventFocus*);
436
437   // Callback for the loading animation(s) associated with this window.
438   void LoadingAnimationCallback();
439
440   // Shows UI elements for supported window features.
441   void ShowSupportedWindowFeatures();
442
443   // Hides UI elements for unsupported window features.
444   void HideUnsupportedWindowFeatures();
445
446   // Helper functions that query |browser_| concerning support for UI features
447   // in this window. (For example, a popup window might not support a tabstrip).
448   bool IsTabStripSupported() const;
449   bool IsToolbarSupported() const;
450   bool IsBookmarkBarSupported() const;
451
452   // Put the bookmark bar where it belongs.
453   void PlaceBookmarkBar(bool is_floating);
454
455   // Decides if we should draw the frame as if the window is active.
456   bool DrawFrameAsActive() const;
457
458   // Updates devtools window for given contents. This method will show docked
459   // devtools window for inspected |contents| that has docked devtools
460   // and hide it for NULL or not inspected |contents|. It will also make
461   // sure devtools window size and position are restored for given tab.
462   void UpdateDevToolsForContents(content::WebContents* contents);
463
464   // Shows docked devtools.
465   void ShowDevToolsContainer();
466
467   // Hides docked devtools.
468   void HideDevToolsContainer();
469
470   // Called when the preference changes.
471   void OnUseCustomChromeFrameChanged();
472
473   // Determine whether we use should default to native decorations or the custom
474   // frame based on the currently-running window manager.
475   static bool GetCustomFramePrefDefault();
476
477   // Handler for |devtools_floating_container_|'s "set-floating-position"
478   // signal.
479   static void OnDevToolsContainerSetFloatingPosition(
480       GtkFloatingContainer* container, GtkAllocation* allocation,
481       BrowserWindowGtk* browser_window);
482
483   // The position and size of the current window.
484   gfx::Rect bounds_;
485
486   // The configure bounds of the current window, used to figure out whether to
487   // ignore later configure events. See OnConfigure() for more information.
488   gfx::Rect configure_bounds_;
489
490   // The position and size of the non-maximized, non-fullscreen window.
491   gfx::Rect restored_bounds_;
492
493   GdkWindowState state_;
494
495   // Controls a hidden GtkMenuBar that we keep updated so GNOME can take a look
496   // inside "our menu bar" and present it in the top panel, akin to Mac OS.
497   scoped_ptr<GlobalMenuBar> global_menu_bar_;
498
499   // The container for the titlebar + tab strip.
500   scoped_ptr<BrowserTitlebar> titlebar_;
501
502   // The object that manages all of the widgets in the toolbar.
503   scoped_ptr<BrowserToolbarGtk> toolbar_;
504
505   // The object that manages the bookmark bar. This will be NULL if the
506   // bookmark bar is not supported.
507   scoped_ptr<BookmarkBarGtk> bookmark_bar_;
508
509   // The download shelf view (view at the bottom of the page).
510   scoped_ptr<DownloadShelfGtk> download_shelf_;
511
512   // The status bubble manager.  Always non-NULL.
513   scoped_ptr<StatusBubbleGtk> status_bubble_;
514
515   // A container that manages the GtkWidget*s that are the webpage display
516   // (along with associated infobars, shelves, and other things that are part
517   // of the content area).
518   scoped_ptr<TabContentsContainerGtk> contents_container_;
519
520   // A container that manages the GtkWidget*s of developer tools for the
521   // selected tab contents.
522   scoped_ptr<TabContentsContainerGtk> devtools_container_;
523
524   // The Extension Keybinding Registry responsible for registering listeners for
525   // accelerators that are sent to the window, that are destined to be turned
526   // into events and sent to the extension.
527   scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_;
528
529   // Docked devtools window instance. NULL when current tab is not inspected
530   // or is inspected with undocked version of DevToolsWindow.
531   DevToolsWindow* devtools_window_;
532
533   // Insets from the sides of devtools_floating_container_ to the sides of
534   // contents_container_. Non-zero only if docked devtools is visible.
535   gfx::Insets contents_insets_;
536
537   // Floating container for devtools_container_ and contents_container_.
538   // Owned by render_area_vbox_.
539   GtkWidget* devtools_floating_container_;
540
541   // The tab strip.  Always non-NULL.
542   scoped_ptr<TabStripGtk> tabstrip_;
543
544   // The container for info bars. Always non-NULL.
545   scoped_ptr<InfoBarContainerGtk> infobar_container_;
546
547   // The timer used to update frames for the Loading Animation.
548   base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_;
549
550   // The timer used to save the window position for session restore.
551   base::OneShotTimer<BrowserWindowGtk> window_configure_debounce_timer_;
552
553   // Whether the custom chrome frame pref is set.  Normally you want to use
554   // UseCustomFrame() above to determine whether to use the custom frame or
555   // not.
556   BooleanPrefMember use_custom_frame_pref_;
557
558   // The current window cursor.  We set it to a resize cursor when over the
559   // custom frame border.  We set it to NULL if we want the default cursor.
560   GdkCursor* frame_cursor_;
561
562   // True if the window manager thinks the window is active.  Not all window
563   // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case
564   // this will always be true.
565   bool is_active_;
566
567   // Optionally maximize or minimize the window after we call
568   // BrowserWindow::Show for the first time.  This is to work around a compiz
569   // bug.
570   ui::WindowShowState show_state_after_show_;
571
572   // If true, don't call gdk_window_raise() when we get a click in the title
573   // bar or window border.  This is to work around a compiz bug.
574   bool suppress_window_raise_;
575
576   // The accelerator group used to handle accelerators, owned by this object.
577   GtkAccelGroup* accel_group_;
578
579   // Set to true while this BrowserWindowGtk is fullscreened.  This is needed
580   // because GTK cannot ensure requests to fullscreen the window will be honored
581   // by all window managers; and therefore bit-testing |state_| is not a
582   // reliable "is fullscreened" test.  http://crbug.com/286545
583   bool is_fullscreen_;
584
585   scoped_ptr<FullscreenExitBubbleGtk> fullscreen_exit_bubble_;
586
587   content::NotificationRegistrar registrar_;
588
589   DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk);
590 };
591
592 #endif  // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_