#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
#include "base/compiler_specific.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/non_client_view.h"
class BrowserView;
class GlassBrowserFrameView : public BrowserNonClientFrameView,
public views::ButtonListener,
public content::NotificationObserver {
public:
GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
virtual ~GlassBrowserFrameView();
virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE;
virtual int GetTopInset() const OVERRIDE;
virtual int GetThemeBackgroundXInset() const OVERRIDE;
virtual void UpdateThrobber(bool running) OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
virtual gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const OVERRIDE;
virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask)
OVERRIDE {}
virtual void ResetWindowControls() OVERRIDE {}
virtual void UpdateWindowIcon() OVERRIDE {}
virtual void UpdateWindowTitle() OVERRIDE {}
protected:
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void Layout() OVERRIDE;
virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
private:
int FrameBorderThickness() const;
int NonClientBorderThickness() const;
int NonClientTopBorderHeight() const;
void PaintToolbarBackground(gfx::Canvas* canvas);
void PaintRestoredClientEdge(gfx::Canvas* canvas);
void LayoutAvatar();
void LayoutNewStyleAvatar();
void LayoutClientView();
gfx::Insets GetClientAreaInsets() const;
gfx::Rect CalculateClientAreaBounds(int width, int height) const;
void StartThrobber();
void StopThrobber();
void DisplayNextThrobberFrame();
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
gfx::Rect avatar_bounds_;
gfx::Rect client_view_bounds_;
bool throbber_running_;
int throbber_frame_;
content::NotificationRegistrar registrar_;
static const int kThrobberIconCount = 24;
static HICON throbber_icons_[kThrobberIconCount];
static void InitThrobberIcons();
DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView);
};
#endif