Move render_view_context_menu.* and related files out of tab_contents.
[chromium-blink-merge.git] / ash / wm / custom_frame_view_ash.h
blob2a932bc1138564d25afe2391aeee4fc133b70f14
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.
5 #ifndef ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_
6 #define ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_
8 #include "ash/ash_export.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/window/non_client_view.h"
12 namespace ash {
13 class FrameBorderHitTestController;
14 class HeaderPainter;
15 class ImmersiveFullscreenController;
17 namespace views {
18 class Widget;
21 namespace ash {
23 // A NonClientFrameView used for packaged apps, dialogs and other non-browser
24 // windows. It supports immersive fullscreen. When in immersive fullscreen, the
25 // client view takes up the entire widget and the window header is an overlay.
26 // The window header overlay slides onscreen when the user hovers the mouse at
27 // the top of the screen. See also views::CustomFrameView and
28 // BrowserNonClientFrameViewAsh.
29 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
30 public:
31 // Internal class name.
32 static const char kViewClassName[];
34 explicit CustomFrameViewAsh(views::Widget* frame);
35 virtual ~CustomFrameViewAsh();
37 // Inits |immersive_fullscreen_controller| so that the controller reveals
38 // and hides |header_view_| in immersive fullscreen.
39 // CustomFrameViewAsh does not take ownership of
40 // |immersive_fullscreen_controller|.
41 void InitImmersiveFullscreenControllerForView(
42 ImmersiveFullscreenController* immersive_fullscreen_controller);
44 // views::NonClientFrameView overrides:
45 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
46 virtual gfx::Rect GetWindowBoundsForClientBounds(
47 const gfx::Rect& client_bounds) const OVERRIDE;
48 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
49 virtual void GetWindowMask(const gfx::Size& size,
50 gfx::Path* window_mask) OVERRIDE;
51 virtual void ResetWindowControls() OVERRIDE;
52 virtual void UpdateWindowIcon() OVERRIDE;
53 virtual void UpdateWindowTitle() OVERRIDE;
55 // views::View overrides:
56 virtual gfx::Size GetPreferredSize() OVERRIDE;
57 virtual const char* GetClassName() const OVERRIDE;
58 virtual gfx::Size GetMinimumSize() OVERRIDE;
59 virtual gfx::Size GetMaximumSize() OVERRIDE;
60 virtual void SchedulePaintInRect(const gfx::Rect& r) OVERRIDE;
61 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
63 // Get the view of the header.
64 views::View* GetHeaderView();
66 private:
67 class OverlayView;
69 // Height from top of window to top of client area.
70 int NonClientTopBorderHeight() const;
72 // Not owned.
73 views::Widget* frame_;
75 // View which contains the title and window controls.
76 class HeaderView;
77 HeaderView* header_view_;
79 // Updates the hittest bounds overrides based on the window show type.
80 scoped_ptr<FrameBorderHitTestController> frame_border_hit_test_controller_;
82 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh);
85 } // namespace ash
87 #endif // ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_