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