#ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
#include "apps/ui/views/native_app_window_views.h"
#include "base/memory/scoped_ptr.h"
#include "ui/views/context_menu_controller.h"
#if defined(USE_ASH)
namespace ash {
class ImmersiveFullscreenController;
}
#endif
class ExtensionKeybindingRegistryViews;
namespace views {
class MenuRunner;
}
class ChromeNativeAppWindowViews : public apps::NativeAppWindowViews,
public views::ContextMenuController {
public:
ChromeNativeAppWindowViews();
virtual ~ChromeNativeAppWindowViews();
SkRegion* shape() { return shape_.get(); }
protected:
virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params,
views::Widget* widget);
virtual void InitializeDefaultWindow(
const apps::AppWindow::CreateParams& create_params);
virtual void InitializePanelWindow(
const apps::AppWindow::CreateParams& create_params);
private:
FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest,
ResizeInsetsWithinBounds);
void InstallEasyResizeTargeterOnContainer() const;
apps::AppWindowFrameView* CreateAppWindowFrameView();
virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
virtual bool IsAlwaysOnTop() const OVERRIDE;
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& p,
ui::MenuSourceType source_type) OVERRIDE;
virtual gfx::ImageSkia GetWindowAppIcon() OVERRIDE;
virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
virtual views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) OVERRIDE;
virtual bool WidgetHasHitTestMask() const OVERRIDE;
virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE;
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
virtual void SetFullscreen(int fullscreen_types) OVERRIDE;
virtual bool IsFullscreenOrPending() const OVERRIDE;
virtual bool IsDetached() const OVERRIDE;
virtual void UpdateBadgeIcon() OVERRIDE;
virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE;
virtual bool HasFrameColor() const OVERRIDE;
virtual SkColor FrameColor() const OVERRIDE;
virtual void InitializeWindow(
apps::AppWindow* app_window,
const apps::AppWindow::CreateParams& create_params) OVERRIDE;
bool is_fullscreen_;
scoped_ptr<SkRegion> shape_;
bool has_frame_color_;
SkColor frame_color_;
gfx::Size preferred_size_;
scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_;
#if defined(USE_ASH)
scoped_ptr<ash::ImmersiveFullscreenController>
immersive_fullscreen_controller_;
#endif
scoped_ptr<views::MenuRunner> menu_runner_;
DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews);
};
#endif