Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: ui/aura_shell/toplevel_frame_view.h

Issue 7977012: Adds a NonClientFrameView for generic toplevel windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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/base/animation/animation_delegate.h"
11 #include "views/controls/button/button.h"
12 #include "views/window/non_client_view.h"
13
14 namespace ui {
15 class SlideAnimation;
16 }
17
18 namespace aura_shell {
19 namespace internal {
20
21 class SizingBorder;
22
23 class AURA_SHELL_EXPORT ToplevelFrameView : public views::NonClientFrameView,
sky 2011/09/22 18:06:19 Add a description
24 public views::ButtonListener {
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 ShowSizingBorder(SizingBorder* 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 EnableClose(bool enable) OVERRIDE;
60 virtual void ResetWindowControls() OVERRIDE;
61 virtual void UpdateWindowIcon() OVERRIDE;
62
63 // Overridden from views::View:
64 virtual void Layout() OVERRIDE;
65 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
66 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE;
67 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
68 virtual views::View* GetEventHandlerForPoint(
69 const gfx::Point& point) OVERRIDE;
70
71 // Overridden from views::ButtonListener:
72 virtual void ButtonPressed(views::Button* sender,
73 const views::Event& event) OVERRIDE;
74
75 gfx::Rect client_view_bounds_;
76
77 views::Button* close_button_;
78 views::Button* zoom_button_;
79
80 int current_hittest_code_;
81
82 SizingBorder* left_edge_;
83 SizingBorder* right_edge_;
84 SizingBorder* bottom_edge_;
85
86 DISALLOW_COPY_AND_ASSIGN(ToplevelFrameView);
87 };
88
89 } // namespace internal
90 } // namespace aura_shell
91
92 #endif // #ifndef UI_AURA_SHELL_TOPLEVEL_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698