Home | History | Annotate | Download | only in frame
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_
      6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "chrome/browser/ui/views/frame/native_browser_frame.h"
     11 #include "ui/views/widget/native_widget_aura.h"
     12 
     13 class BrowserFrame;
     14 class BrowserView;
     15 
     16 ////////////////////////////////////////////////////////////////////////////////
     17 // BrowserFrameAura
     18 //
     19 //  BrowserFrameAura is a NativeWidgetAura subclass that provides the window
     20 //  frame for the Chrome browser window.
     21 //
     22 class BrowserFrameAura : public views::NativeWidgetAura,
     23                          public NativeBrowserFrame {
     24  public:
     25   static const char kWindowName[];
     26 
     27   BrowserFrameAura(BrowserFrame* browser_frame, BrowserView* browser_view);
     28 
     29   BrowserView* browser_view() const { return browser_view_; }
     30 
     31  protected:
     32   // Overridden from views::NativeWidgetAura:
     33   virtual void OnWindowDestroying() OVERRIDE;
     34   virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE;
     35 
     36   // Overridden from NativeBrowserFrame:
     37   virtual views::NativeWidget* AsNativeWidget() OVERRIDE;
     38   virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE;
     39   virtual bool UsesNativeSystemMenu() const OVERRIDE;
     40   virtual int GetMinimizeButtonOffset() const OVERRIDE;
     41   virtual void TabStripDisplayModeChanged() OVERRIDE;
     42 
     43  private:
     44   class WindowPropertyWatcher;
     45 
     46   virtual ~BrowserFrameAura();
     47 
     48   // Set the window into the auto managed mode.
     49   void SetWindowAutoManaged();
     50 
     51   // The BrowserView is our ClientView. This is a pointer to it.
     52   BrowserView* browser_view_;
     53 
     54   scoped_ptr<WindowPropertyWatcher> window_property_watcher_;
     55 
     56   DISALLOW_COPY_AND_ASSIGN(BrowserFrameAura);
     57 };
     58 
     59 #endif  // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_
     60