12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <gtk/gtk.h>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/prefs/pref_member.h"
16eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/timer/timer.h"
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "build/build_config.h"
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/devtools/devtools_window.h"
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/extensions/extension_keybinding_registry.h"
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/infobars/infobar_container.h"
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/ui/browser_window.h"
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/host_desktop.h"
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/gtk/gtk_signal.h"
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/ui_base_types.h"
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/x/active_window_watcher_x_observer.h"
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/x/x11_util.h"
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/rect.h"
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BookmarkBarGtk;
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Browser;
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BrowserTitlebar;
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BrowserToolbarGtk;
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DevToolsWindow;
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DownloadShelfGtk;
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ExtensionKeybindingRegistryGtk;
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FindBarGtk;
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FullscreenExitBubbleGtk;
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class GlobalMenuBar;
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class InfoBarContainerGtk;
412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class InstantOverlayControllerGtk;
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class LocationBar;
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class StatusBubbleGtk;
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TabContentsContainerGtk;
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TabStripGtk;
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace autofill {
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class PasswordGenerator;
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace extensions {
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ActiveTabPermissionGranter;
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Extension;
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
56c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)namespace user_prefs {
57c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class PrefRegistrySyncable;
58c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)}
59c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
60c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// An implementation of BrowserWindow for GTK. Cross-platform code will interact
61c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// with this object when it needs to manipulate the window.
62b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)class BrowserWindowGtk
63b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)    : public BrowserWindow,
64b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      public content::NotificationObserver,
65b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      public TabStripModelObserver,
66b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      public ui::ActiveWindowWatcherXObserver,
67b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      public InfoBarContainer::Delegate,
68b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      public extensions::ExtensionKeybindingRegistry::Delegate {
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  explicit BrowserWindowGtk(Browser* browser);
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~BrowserWindowGtk();
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Separating initialization from constructor.
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void Init();
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from BrowserWindow:
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Show() OVERRIDE;
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowInactive() OVERRIDE;
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Hide() OVERRIDE;
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Close() OVERRIDE;
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Activate() OVERRIDE;
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Deactivate() OVERRIDE;
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsActive() const OVERRIDE;
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void FlashFrame(bool flash) OVERRIDE;
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsAlwaysOnTop() const OVERRIDE;
874e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE;
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual BrowserWindowTesting* GetBrowserWindowTesting() OVERRIDE;
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual StatusBubble* GetStatusBubble() OVERRIDE;
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdateTitleBar() OVERRIDE;
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void BookmarkBarStateChanged(
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      BookmarkBar::AnimateChangeType change_type) OVERRIDE;
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdateDevTools() OVERRIDE;
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdateLoadingAnimations(bool should_animate) OVERRIDE;
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetStarredState(bool is_starred) OVERRIDE;
97f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual void SetTranslateIconToggled(bool is_lit) OVERRIDE;
9868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  virtual void OnActiveTabChanged(content::WebContents* old_contents,
9968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                                  content::WebContents* new_contents,
10068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                                  int index,
10168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                                  int reason) OVERRIDE;
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ZoomChangedForActiveTab(bool can_show_bubble) OVERRIDE;
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
104b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Rect GetBounds() const OVERRIDE;
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsMaximized() const OVERRIDE;
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsMinimized() const OVERRIDE;
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Maximize() OVERRIDE;
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Minimize() OVERRIDE;
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Restore() OVERRIDE;
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void EnterFullscreen(
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const GURL& url, FullscreenExitBubbleType type) OVERRIDE;
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ExitFullscreen() OVERRIDE;
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdateFullscreenExitBubbleContent(
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const GURL& url,
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      FullscreenExitBubbleType bubble_type) OVERRIDE;
1172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual bool ShouldHideUIForFullscreen() const OVERRIDE;
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsFullscreen() const OVERRIDE;
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual LocationBar* GetLocationBar() const OVERRIDE;
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE;
1233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)  virtual void UpdateToolbar(content::WebContents* contents) OVERRIDE;
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void FocusToolbar() OVERRIDE;
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void FocusAppMenu() OVERRIDE;
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void FocusBookmarksToolbar() OVERRIDE;
127c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  virtual void FocusInfobars() OVERRIDE;
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void RotatePaneFocus(bool forwards) OVERRIDE;
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsBookmarkBarVisible() const OVERRIDE;
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsBookmarkBarAnimating() const OVERRIDE;
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsTabStripEditable() const OVERRIDE;
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsToolbarVisible() const OVERRIDE;
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE;
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                        Profile* profile) OVERRIDE;
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowUpdateChromeDialog() OVERRIDE;
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowBookmarkBubble(const GURL& url,
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  bool already_bookmarked) OVERRIDE;
1391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual void ShowTranslateBubble(
1401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)      content::WebContents* contents,
141a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      TranslateBubbleModel::ViewState view_state,
142a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      TranslateErrors::Type error_type) OVERRIDE;
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(ENABLE_ONE_CLICK_SIGNIN)
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowOneClickSigninBubble(
1452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      OneClickSigninBubbleType type,
146a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      const base::string16& email,
147a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)      const base::string16& error_message,
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const StartSyncCallback& start_sync_callback) OVERRIDE;
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool IsDownloadShelfVisible() const OVERRIDE;
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual DownloadShelf* GetDownloadShelf() OVERRIDE;
1523551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)  virtual void ConfirmBrowserCloseWithPendingDownloads(
1533551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)      int download_count,
1543551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)      Browser::DownloadClosePreventionType dialog_type,
1553551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)      bool app_modal,
1563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)      const base::Callback<void(bool)>& callback) OVERRIDE;
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UserChangedTheme() OVERRIDE;
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual int GetExtraRenderViewHeight() const OVERRIDE;
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowWebsiteSettings(Profile* profile,
1612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                   content::WebContents* web_contents,
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   const GURL& url,
1637dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch                                   const content::SSLStatus& ssl) OVERRIDE;
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowAppMenu() OVERRIDE;
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool PreHandleKeyboardEvent(
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const content::NativeWebKeyboardEvent& event,
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      bool* is_keyboard_shortcut) OVERRIDE;
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void HandleKeyboardEvent(
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const content::NativeWebKeyboardEvent& event) OVERRIDE;
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Cut() OVERRIDE;
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Copy() OVERRIDE;
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Paste() OVERRIDE;
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual WindowOpenDisposition GetDispositionForPopupBounds(
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const gfx::Rect& bounds) OVERRIDE;
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual FindBar* CreateFindBar() OVERRIDE;
17690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  virtual web_modal::WebContentsModalDialogHost*
17790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)      GetWebContentsModalDialogHost() OVERRIDE;
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowAvatarBubble(content::WebContents* web_contents,
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                const gfx::Rect& rect) OVERRIDE;
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ShowPasswordGenerationBubble(
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      const gfx::Rect& rect,
18358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)      const autofill::PasswordForm& form,
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      autofill::PasswordGenerator* password_generator) OVERRIDE;
185424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)  virtual int GetRenderViewHeightInsetWithDetachedBookmarkBar() OVERRIDE;
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from NotificationObserver:
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Observe(int type,
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       const content::NotificationSource& source,
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       const content::NotificationDetails& details) OVERRIDE;
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from TabStripModelObserver:
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void TabDetachedAt(content::WebContents* contents,
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                             int index) OVERRIDE;
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from ActiveWindowWatcherXObserver.
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from InfoBarContainer::Delegate:
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE;
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE;
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool DrawInfoBarArrows(int* x) const OVERRIDE;
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Overridden from ExtensionKeybindingRegistry::Delegate:
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual extensions::ActiveTabPermissionGranter*
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      GetActiveTabPermissionGranter() OVERRIDE;
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Accessor for the tab strip.
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  TabStripGtk* tabstrip() const { return tabstrip_.get(); }
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void OnDebouncedBoundsChanged();
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Request the underlying window to unmaximize.
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UnMaximize();
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns false if we're not ready to close yet.  E.g., a tab may have an
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // onbeforeunload handler that prevents us from closing.
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool CanClose() const;
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns whether to draw the content drop shadow on the sides and bottom
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // of the browser window. When false, we still draw a shadow on the top of
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the toolbar (under the tab strip), but do not round the top corners.
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool ShouldDrawContentDropShadow() const;
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool ShouldShowWindowIcon() const;
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Add the find bar widget to the window hierarchy.
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void AddFindBar(FindBarGtk* findbar);
2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Reset the mouse cursor to the default cursor if it was set to something
2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // else for the custom frame.
2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ResetCustomFrameCursor();
2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the BrowserWindowGtk registered with |window|.
2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static BrowserWindowGtk* GetBrowserWindowForNativeWindow(
2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      gfx::NativeWindow window);
2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Retrieves the GtkWindow associated with |xid|, which is the X Window
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ID of the top-level X window of this object.
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static GtkWindow* GetBrowserWindowForXID(XID xid);
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  Browser* browser() const { return browser_.get(); }
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWindow* window() const { return window_; }
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BrowserTitlebar* titlebar() const { return titlebar_.get(); }
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* titlebar_widget() const;
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BrowserToolbarGtk* GetToolbar() { return toolbar_.get(); }
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::Rect bounds() const { return bounds_; }
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the tab we're currently displaying in the tab contents container.
2552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  content::WebContents* GetDisplayedTab();
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2577dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tells GTK that the toolbar area is invalidated and needs redrawing. We
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // have this method as a hack because GTK doesn't queue the toolbar area for
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // redraw when it should.
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void QueueToolbarRedraw();
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Get the position where the infobar arrow should be anchored in
2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // |relative_to| coordinates. This is the middle of the omnibox location icon.
2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int GetXPositionOfLocationIcon(GtkWidget* relative_to);
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Show or hide the bookmark bar.
2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void MaybeShowBookmarkBar(bool animate);
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) protected:
2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void DestroyBrowser() OVERRIDE;
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Checks to see if the mouse pointer at |x|, |y| is over the border of the
2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // custom frame (a spot that should trigger a window resize). Returns true if
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // it should and sets |edge|.
2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool GetWindowEdge(int x, int y, GdkWindowEdge* edge);
2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the window shape for the window with |width| and |height|.
2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The caller is responsible for destroying the region if non-null region is
2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // returned.
2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GdkRegion* GetWindowShape(int width, int height) const;
2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Save the window position in the prefs.
2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SaveWindowPosition();
2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Sets the default size for the window and the way the user is allowed to
2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // resize it.
2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetGeometryHints();
2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns |true| if we should use the custom frame.
2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool UseCustomFrame() const;
2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Invalidate window to force repaint.
2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void InvalidateWindow();
2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Top level window. NULL after the window starts closing.
2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWindow* window_;
2995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Determines whether window was shown.
3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool window_has_shown_;
3015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // GtkAlignment that holds the interior components of the chromium window.
3022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // This is used to draw the custom frame border and content shadow. Owned by
3032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // window_.
3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* window_container_;
3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // VBox that holds everything (tabs, toolbar, bookmarks bar, tab contents).
3062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Owned by window_container_.
3075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* window_vbox_;
3082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // VBox that holds everything below the toolbar. Owned by
3092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // render_area_floating_container_.
3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* render_area_vbox_;
3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Floating container that holds the render area. It is needed to position
3122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // the findbar. Owned by render_area_event_box_.
3135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* render_area_floating_container_;
3142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // EventBox that holds render_area_floating_container_. Owned by window_vbox_.
3155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* render_area_event_box_;
3162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Border between toolbar and render area. Owned by render_area_vbox_.
3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* toolbar_border_;
3185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<Browser> browser_;
3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
3225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Connect to signals on |window_|.
3235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ConnectHandlersToSignals();
3245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Create the various UI components.
3265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void InitWidgets();
3275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Set up background color of the window (depends on if we're incognito or
3295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // not).
3305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetBackgroundColor();
3315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Applies the window shape to if we're in custom drawing mode.
3335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UpdateWindowShape(int width, int height);
3345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Connect accelerators that aren't connected to menu items (like ctrl-o,
3365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ctrl-l, etc.).
3375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ConnectAccelerators();
3385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Whether we should draw the tab background instead of the theme_frame
3405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // background because this window is a popup.
3415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool UsingCustomPopupFrame() const;
3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Draws the normal custom frame using theme_frame.
3445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void DrawCustomFrame(cairo_t* cr, GtkWidget* widget, GdkEventExpose* event);
3455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Draws the tab image as the frame so we can write legible text.
3475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void DrawPopupFrame(cairo_t* cr, GtkWidget* widget, GdkEventExpose* event);
3485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Draws the border, including resizable corners, for the custom frame.
3505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void DrawCustomFrameBorder(GtkWidget* widget);
3515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Change whether we're showing the custom blue frame.
3535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Must be called once at startup.
3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Triggers relayout of the content.
3555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UpdateCustomFrame();
3565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Set the bounds of the current window. If |exterior| is true, set the size
3585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // of the window itself, otherwise set the bounds of the web contents.
3595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If |move| is true, set the position of the window, otherwise leave the
3605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // position to the WM.
3615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetBoundsImpl(const gfx::Rect& bounds, bool exterior, bool move);
3625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnConfigure,
3645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventConfigure*);
3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnWindowState,
3665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventWindowState*);
3675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnMainWindowDeleteEvent,
3685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEvent*);
3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_0(BrowserWindowGtk, void, OnMainWindowDestroy);
3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Callback for when the custom frame alignment needs to be redrawn.
3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The content area includes the toolbar and web page but not the tab strip.
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnCustomFrameExpose,
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventExpose*);
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // A helper method that draws the shadow above the toolbar and in the frame
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // border during an expose.
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void DrawContentShadow(cairo_t* cr);
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The background frame image needs to be offset by the size of the top of
3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the window to the top of the tabs when the full skyline isn't displayed
3815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // for some reason.
3825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int GetVerticalOffset();
3835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns which frame image we should use based on the window's current
3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // activation state / incognito state.
3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  int GetThemeFrameResource();
3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Invalidate all the widgets that need to redraw when the infobar draw state
3895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // has changed.
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void InvalidateInfoBarBits();
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // When the location icon moves, we have to redraw the arrow.
3935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, void, OnLocationIconSizeAllocate,
3945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GtkAllocation*);
3955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Used to draw the infobar arrow and drop shadow. This is connected to
3975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // multiple widgets' expose events because it overlaps several widgets.
3985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnExposeDrawInfobarBits,
3995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventExpose*);
4005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Used to draw the infobar bits for the bookmark bar. When the bookmark
4025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // bar is in floating mode, it has to draw a drop shadow only; otherwise
4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // it is responsible for its portion of the arrow as well as some shadowing.
4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnBookmarkBarExpose,
4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventExpose*);
4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Callback for "size-allocate" signal on bookmark bar; this is relevant
4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // because when the bookmark bar changes dimensions, the infobar arrow has to
4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // change its shape, and we need to queue appropriate redraws.
4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, void, OnBookmarkBarSizeAllocate,
4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GtkAllocation*);
4125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Callback for accelerator activation. |user_data| stores the command id
4145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // of the matched accelerator.
4155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static gboolean OnGtkAccelerator(GtkAccelGroup* accel_group,
4165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   GObject* acceleratable,
4175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   guint keyval,
4185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   GdkModifierType modifier,
4195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                   void* user_data);
4205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Key press event callback.
4225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnKeyPress, GdkEventKey*);
4235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Mouse move and mouse button press callbacks.
4255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnMouseMoveEvent,
4265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventMotion*);
4275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnButtonPressEvent,
4285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventButton*);
4295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Tracks focus state of browser.
4315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnFocusIn,
4325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventFocus*);
4335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnFocusOut,
4345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                       GdkEventFocus*);
4355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Callback for the loading animation(s) associated with this window.
4375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void LoadingAnimationCallback();
4385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Shows UI elements for supported window features.
4405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ShowSupportedWindowFeatures();
4415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Hides UI elements for unsupported window features.
4435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void HideUnsupportedWindowFeatures();
4445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Helper functions that query |browser_| concerning support for UI features
4465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // in this window. (For example, a popup window might not support a tabstrip).
4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool IsTabStripSupported() const;
4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool IsToolbarSupported() const;
4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool IsBookmarkBarSupported() const;
4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Put the bookmark bar where it belongs.
4525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void PlaceBookmarkBar(bool is_floating);
4535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Decides if we should draw the frame as if the window is active.
4555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool DrawFrameAsActive() const;
4565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Updates devtools window for given contents. This method will show docked
4585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // devtools window for inspected |contents| that has docked devtools
4595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // and hide it for NULL or not inspected |contents|. It will also make
4605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // sure devtools window size and position are restored for given tab.
4615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UpdateDevToolsForContents(content::WebContents* contents);
4625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Shows docked devtools.
4645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ShowDevToolsContainer();
4655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Hides docked devtools.
4675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void HideDevToolsContainer();
4685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Reads split position from the current tab's devtools window and applies
4705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // it to the devtools split.
4715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void UpdateDevToolsSplitPosition();
4725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Called when the preference changes.
4742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void OnUseCustomChromeFrameChanged();
4752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Determine whether we use should default to native decorations or the custom
4775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // frame based on the currently-running window manager.
4785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static bool GetCustomFramePrefDefault();
4795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The position and size of the current window.
4815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::Rect bounds_;
4825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The configure bounds of the current window, used to figure out whether to
4845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ignore later configure events. See OnConfigure() for more information.
4855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::Rect configure_bounds_;
4865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The position and size of the non-maximized, non-fullscreen window.
4885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::Rect restored_bounds_;
4895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GdkWindowState state_;
4915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Controls a hidden GtkMenuBar that we keep updated so GNOME can take a look
4935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // inside "our menu bar" and present it in the top panel, akin to Mac OS.
4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<GlobalMenuBar> global_menu_bar_;
4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The container for the titlebar + tab strip.
4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<BrowserTitlebar> titlebar_;
4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The object that manages all of the widgets in the toolbar.
5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<BrowserToolbarGtk> toolbar_;
5015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The object that manages the bookmark bar. This will be NULL if the
5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // bookmark bar is not supported.
5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<BookmarkBarGtk> bookmark_bar_;
5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The download shelf view (view at the bottom of the page).
5075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<DownloadShelfGtk> download_shelf_;
5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The status bubble manager.  Always non-NULL.
5105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<StatusBubbleGtk> status_bubble_;
5115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // A container that manages the GtkWidget*s that are the webpage display
5135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // (along with associated infobars, shelves, and other things that are part
5145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // of the content area).
5155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<TabContentsContainerGtk> contents_container_;
5165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // A container that manages the GtkWidget*s of developer tools for the
5185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // selected tab contents.
5195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<TabContentsContainerGtk> devtools_container_;
5205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The Extension Keybinding Registry responsible for registering listeners for
5225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // accelerators that are sent to the window, that are destined to be turned
5235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // into events and sent to the extension.
5245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_;
5255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DevToolsDockSide devtools_dock_side_;
5275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Docked devtools window instance. NULL when current tab is not inspected
5295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // or is inspected with undocked version of DevToolsWindow.
5305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DevToolsWindow* devtools_window_;
5315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Split pane containing the contents_container_ and the devtools_container_.
5332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Owned by contents_vsplit_.
5345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* contents_hsplit_;
5355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Split pane containing the contents_hsplit_ and the devtools_container_.
5372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Owned by render_area_vbox_.
5385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkWidget* contents_vsplit_;
5395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The tab strip.  Always non-NULL.
5415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<TabStripGtk> tabstrip_;
5425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The container for info bars. Always non-NULL.
5445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  scoped_ptr<InfoBarContainerGtk> infobar_container_;
5455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The timer used to update frames for the Loading Animation.
5475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_;
5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The timer used to save the window position for session restore.
5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  base::OneShotTimer<BrowserWindowGtk> window_configure_debounce_timer_;
5515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Whether the custom chrome frame pref is set.  Normally you want to use
5535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // UseCustomFrame() above to determine whether to use the custom frame or
5545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // not.
5555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  BooleanPrefMember use_custom_frame_pref_;
5565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The current window cursor.  We set it to a resize cursor when over the
5585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // custom frame border.  We set it to NULL if we want the default cursor.
5595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GdkCursor* frame_cursor_;
5605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // True if the window manager thinks the window is active.  Not all window
5625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // managers keep track of this state (_NET_ACTIVE_WINDOW), in which case
5635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // this will always be true.
5645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool is_active_;
5655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Optionally maximize or minimize the window after we call
5675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // BrowserWindow::Show for the first time.  This is to work around a compiz
5685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // bug.
5695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  ui::WindowShowState show_state_after_show_;
5705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // If true, don't call gdk_window_raise() when we get a click in the title
5725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // bar or window border.  This is to work around a compiz bug.
5735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  bool suppress_window_raise_;
5745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The accelerator group used to handle accelerators, owned by this object.
5765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  GtkAccelGroup* accel_group_;
5775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5784e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // Set to true while this BrowserWindowGtk is fullscreened.  This is needed
5794e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // because GTK cannot ensure requests to fullscreen the window will be honored
5804e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // by all window managers; and therefore bit-testing |state_| is not a
5814e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // reliable "is fullscreened" test.  http://crbug.com/286545
5824e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  bool is_fullscreen_;
5835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5844e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  scoped_ptr<FullscreenExitBubbleGtk> fullscreen_exit_bubble_;
5855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  content::NotificationRegistrar registrar_;
5875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk);
5895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
5905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_
592