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"
13 class FrameBorderHitTestController;
25 class FrameCaptionButtonContainerView;
27 // A NonClientFrameView used for dialogs and other non-browser windows.
28 // See also views::CustomFrameView and BrowserNonClientFrameViewAsh.
29 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
31 // Internal class name.
32 static const char kViewClassName[];
34 explicit CustomFrameViewAsh(views::Widget* frame);
35 virtual ~CustomFrameViewAsh();
37 // views::NonClientFrameView overrides:
38 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
39 virtual gfx::Rect GetWindowBoundsForClientBounds(
40 const gfx::Rect& client_bounds) const OVERRIDE;
41 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
42 virtual void GetWindowMask(const gfx::Size& size,
43 gfx::Path* window_mask) OVERRIDE;
44 virtual void ResetWindowControls() OVERRIDE;
45 virtual void UpdateWindowIcon() OVERRIDE;
46 virtual void UpdateWindowTitle() OVERRIDE;
48 // views::View overrides:
49 virtual gfx::Size GetPreferredSize() OVERRIDE;
50 virtual void Layout() OVERRIDE;
51 virtual const char* GetClassName() const OVERRIDE;
52 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
53 virtual gfx::Size GetMinimumSize() OVERRIDE;
54 virtual gfx::Size GetMaximumSize() OVERRIDE;
57 // Height from top of window to top of client area.
58 int NonClientTopBorderHeight() const;
61 views::Widget* frame_;
63 // View which contains the window controls.
64 FrameCaptionButtonContainerView* caption_button_container_;
66 // Helper class for painting the header.
67 scoped_ptr<HeaderPainter> header_painter_;
69 // Updates the hittest bounds overrides based on the window show type.
70 scoped_ptr<FrameBorderHitTestController> frame_border_hit_test_controller_;
72 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh);
77 #endif // ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_