#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/prefs/pref_member.h"
#include "build/build_config.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "ui/views/context_menu_controller.h"
#include "ui/views/widget/widget.h"
class AvatarMenuButton;
class BrowserRootView;
class BrowserView;
class NativeBrowserFrame;
class NewAvatarButton;
class NonClientFrameView;
class SystemMenuModelBuilder;
namespace gfx {
class FontList;
class Rect;
}
namespace ui {
class EventHandler;
class MenuModel;
class ThemeProvider;
}
namespace views {
class MenuRunner;
class View;
}
class BrowserFrame
: public views::Widget,
public views::ContextMenuController {
public:
explicit BrowserFrame(BrowserView* browser_view);
virtual ~BrowserFrame();
static const gfx::FontList& GetTitleFontList();
void InitBrowserFrame();
void SetThemeProvider(scoped_ptr<ui::ThemeProvider> provider);
int GetMinimizeButtonOffset() const;
gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const;
int GetTopInset() const;
int GetThemeBackgroundXInset() const;
void UpdateThrobber(bool running);
views::View* GetFrameView() const;
bool UseCustomFrame() const;
virtual views::internal::RootView* CreateRootView() OVERRIDE;
virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
virtual bool GetAccelerator(int command_id,
ui::Accelerator* accelerator) OVERRIDE;
virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE;
virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE;
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& p,
ui::MenuSourceType source_type) OVERRIDE;
bool ShouldLeaveOffsetNearTopBorder();
AvatarMenuButton* GetAvatarMenuButton();
NewAvatarButton* GetNewAvatarMenuButton();
ui::MenuModel* GetSystemMenuModel();
private:
void OnUseCustomChromeFrameChanged();
NativeBrowserFrame* native_browser_frame_;
BrowserRootView* root_view_;
BrowserNonClientFrameView* browser_frame_view_;
BrowserView* browser_view_;
scoped_ptr<SystemMenuModelBuilder> menu_model_builder_;
scoped_ptr<views::MenuRunner> menu_runner_;
scoped_ptr<ui::ThemeProvider> owned_theme_provider_;
ui::ThemeProvider* theme_provider_;
BooleanPrefMember use_custom_frame_pref_;
scoped_ptr<ui::EventHandler> browser_command_handler_;
DISALLOW_COPY_AND_ASSIGN(BrowserFrame);
};
#endif