1 // Copyright (c) 2011 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_VIEWS_FRAME_BROWSER_FRAME_GTK_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_GTK_H_ 7 #pragma once 8 9 #include "base/basictypes.h" 10 #include "chrome/browser/ui/views/frame/browser_frame.h" 11 #include "chrome/browser/ui/views/frame/native_browser_frame.h" 12 #include "views/window/window_gtk.h" 13 14 class BrowserNonClientFrameView; 15 class BrowserRootView; 16 17 class BrowserFrameGtk : public BrowserFrame, 18 public views::WindowGtk, 19 public NativeBrowserFrame { 20 public: 21 // Normally you will create this class by calling BrowserFrame::Create. 22 // Init must be called before using this class, which Create will do for you. 23 BrowserFrameGtk(BrowserView* browser_view, Profile* profile); 24 virtual ~BrowserFrameGtk(); 25 26 // Creates a frame view and initializes the window. This 27 // initialization function must be called after construction, it is 28 // separate to avoid recursive calling of the frame from its 29 // constructor. 30 virtual void InitBrowserFrame(); 31 32 protected: 33 // Overridden from NativeBrowserFrame: 34 virtual views::NativeWindow* AsNativeWindow() OVERRIDE; 35 virtual const views::NativeWindow* AsNativeWindow() const OVERRIDE; 36 virtual BrowserNonClientFrameView* CreateBrowserNonClientFrameView() OVERRIDE; 37 virtual int GetMinimizeButtonOffset() const OVERRIDE; 38 virtual ui::ThemeProvider* GetThemeProviderForFrame() const OVERRIDE; 39 virtual bool AlwaysUseNativeFrame() const OVERRIDE; 40 virtual void TabStripDisplayModeChanged() OVERRIDE; 41 42 // Overridden from views::WindowGtk: 43 virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE; 44 virtual void SetInitialFocus() OVERRIDE; 45 virtual views::RootView* CreateRootView(); 46 virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); 47 virtual views::NonClientFrameView* CreateFrameViewForWindow() OVERRIDE; 48 virtual gboolean OnWindowStateEvent(GtkWidget* widget, 49 GdkEventWindowState* event); 50 virtual gboolean OnConfigureEvent(GtkWidget* widget, 51 GdkEventConfigure* event); 52 53 BrowserView* browser_view() const { 54 return browser_view_; 55 } 56 57 private: 58 NativeBrowserFrameDelegate* delegate_; 59 60 // The BrowserView is our ClientView. This is a pointer to it. 61 BrowserView* browser_view_; 62 63 DISALLOW_COPY_AND_ASSIGN(BrowserFrameGtk); 64 }; 65 66 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_GTK_H_ 67