Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / ui / views / apps / chrome_native_app_window_views.h
blobec2b160c4059cbb4bccf4d45a085ec93b832fb10
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
8 #include "apps/ui/views/native_app_window_views.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/context_menu_controller.h"
12 #if defined(USE_ASH)
13 namespace ash {
14 class ImmersiveFullscreenController;
16 #endif
18 class ExtensionKeybindingRegistryViews;
20 namespace views {
21 class MenuRunner;
24 class ChromeNativeAppWindowViews : public apps::NativeAppWindowViews,
25 public views::ContextMenuController {
26 public:
27 ChromeNativeAppWindowViews();
28 virtual ~ChromeNativeAppWindowViews();
30 SkRegion* shape() { return shape_.get(); }
32 protected:
33 // Called before views::Widget::Init() to allow subclasses to customize
34 // the InitParams that would be passed.
35 virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params,
36 views::Widget* widget);
38 virtual void InitializeDefaultWindow(
39 const apps::AppWindow::CreateParams& create_params);
40 virtual void InitializePanelWindow(
41 const apps::AppWindow::CreateParams& create_params);
42 virtual views::NonClientFrameView* CreateStandardDesktopAppFrame();
44 private:
45 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest,
46 ResizeInsetsWithinBounds);
48 apps::AppWindowFrameView* CreateNonStandardAppFrame();
50 // ui::BaseWindow implementation.
51 virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
52 virtual bool IsAlwaysOnTop() const OVERRIDE;
54 // Overridden from views::ContextMenuController:
55 virtual void ShowContextMenuForView(views::View* source,
56 const gfx::Point& p,
57 ui::MenuSourceType source_type) OVERRIDE;
59 // WidgetDelegate implementation.
60 virtual gfx::ImageSkia GetWindowAppIcon() OVERRIDE;
61 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
62 virtual views::NonClientFrameView* CreateNonClientFrameView(
63 views::Widget* widget) OVERRIDE;
64 virtual bool WidgetHasHitTestMask() const OVERRIDE;
65 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE;
67 // views::View implementation.
68 virtual gfx::Size GetPreferredSize() OVERRIDE;
69 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
71 // NativeAppWindow implementation.
72 virtual void SetFullscreen(int fullscreen_types) OVERRIDE;
73 virtual bool IsFullscreenOrPending() const OVERRIDE;
74 virtual bool IsDetached() const OVERRIDE;
75 virtual void UpdateBadgeIcon() OVERRIDE;
76 virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE;
77 virtual bool HasFrameColor() const OVERRIDE;
78 virtual SkColor ActiveFrameColor() const OVERRIDE;
79 virtual SkColor InactiveFrameColor() const OVERRIDE;
81 // NativeAppWindowViews implementation.
82 virtual void InitializeWindow(
83 apps::AppWindow* app_window,
84 const apps::AppWindow::CreateParams& create_params) OVERRIDE;
86 // True if the window is fullscreen or fullscreen is pending.
87 bool is_fullscreen_;
89 // Custom shape of the window. If this is not set then the window has a
90 // default shape, usually rectangular.
91 scoped_ptr<SkRegion> shape_;
93 bool has_frame_color_;
94 SkColor active_frame_color_;
95 SkColor inactive_frame_color_;
96 gfx::Size preferred_size_;
98 // The class that registers for keyboard shortcuts for extension commands.
99 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_;
101 #if defined(USE_ASH)
102 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In
103 // immersive fullscreen, the window header (title bar and window controls)
104 // slides onscreen as an overlay when the mouse is hovered at the top of the
105 // screen.
106 scoped_ptr<ash::ImmersiveFullscreenController>
107 immersive_fullscreen_controller_;
108 #endif // defined(USE_ASH)
110 // Used to show the system menu.
111 scoped_ptr<views::MenuRunner> menu_runner_;
113 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViews);
116 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_