OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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. | |
4 | |
5 #ifndef UI_AURA_SHELL_TOPLEVEL_FRAME_VIEW_H_ | |
6 #define UI_AURA_SHELL_TOPLEVEL_FRAME_VIEW_H_ | |
7 #pragma once | |
8 | |
9 #include "ui/aura_shell/aura_shell_export.h" | |
10 #include "ui/views/controls/button/button.h" | |
11 #include "ui/views/window/non_client_view.h" | |
12 | |
13 namespace aura_shell { | |
14 namespace internal { | |
15 | |
16 class FrameComponent; | |
17 class SizingBorder; | |
18 class WindowCaption; | |
19 | |
20 // A NonClientFrameView implementation for generic top-level windows in Aura. | |
21 // TODO(beng): Find a way to automatically this for all top-level windows in | |
22 // Aura. Right now windows have to override CreateNonClientFrameView | |
23 // on WidgetDelegate to specify this. | |
24 class AURA_SHELL_EXPORT ToplevelFrameView : public views::NonClientFrameView { | |
25 public: | |
26 ToplevelFrameView(); | |
27 virtual ~ToplevelFrameView(); | |
28 | |
29 private: | |
30 // Returns the height of the side/bottom non-client edges. | |
31 int NonClientBorderThickness() const; | |
32 | |
33 // Returns the height of the top non-client edge - the caption. | |
34 int NonClientTopBorderHeight() const; | |
35 | |
36 // Implementation of NonClientHitTest(). | |
37 int NonClientHitTestImpl(const gfx::Point& point); | |
38 | |
39 // Shows the specified |sizing_border|, hiding all others. | |
40 // If |sizing_border| is NULL, all other sizing borders are hidden. | |
41 void ShowFrameComponent(FrameComponent* sizing_border); | |
42 | |
43 // Returns true if the specified point (in FrameView coordinates) hit-tests | |
44 // against the specified child. | |
45 bool PointIsInChildView(views::View* child, const gfx::Point& point) const; | |
46 | |
47 // Returns the bounds of the specified sizing border for its visible and | |
48 // hidden states. | |
49 gfx::Rect GetHiddenBoundsForSizingBorder(int frame_component) const; | |
50 gfx::Rect GetVisibleBoundsForSizingBorder(int frame_component) const; | |
51 | |
52 // Overridden from views::NonClientFrameView: | |
53 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | |
54 virtual gfx::Rect GetWindowBoundsForClientBounds( | |
55 const gfx::Rect& client_bounds) const OVERRIDE; | |
56 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | |
57 virtual void GetWindowMask(const gfx::Size& size, | |
58 gfx::Path* window_mask) OVERRIDE; | |
59 virtual void ResetWindowControls() OVERRIDE; | |
60 virtual void UpdateWindowIcon() OVERRIDE; | |
61 | |
62 // Overridden from views::View: | |
63 virtual void Layout() OVERRIDE; | |
64 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; | |
65 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | |
66 virtual views::View* GetEventHandlerForPoint( | |
67 const gfx::Point& point) OVERRIDE; | |
68 virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE; | |
69 | |
70 gfx::Rect client_view_bounds_; | |
71 | |
72 int current_hittest_code_; | |
73 | |
74 WindowCaption* caption_; | |
75 SizingBorder* left_edge_; | |
76 SizingBorder* right_edge_; | |
77 SizingBorder* bottom_edge_; | |
78 | |
79 DISALLOW_COPY_AND_ASSIGN(ToplevelFrameView); | |
80 }; | |
81 | |
82 } // namespace internal | |
83 } // namespace aura_shell | |
84 | |
85 #endif // #ifndef UI_AURA_SHELL_TOPLEVEL_FRAME_VIEW_H_ | |
OLD | NEW |