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

Side by Side Diff: ash/frame/default_header_painter.h

Issue 189463013: [Refactor] Move code for painting the window header for browser windows out of ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « ash/frame/custom_frame_view_ash_unittest.cc ('k') | ash/frame/default_header_painter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef ASH_FRAME_DEFAULT_HEADER_PAINTER_H_
6 #define ASH_FRAME_DEFAULT_HEADER_PAINTER_H_
7
8 #include "ash/ash_export.h"
9 #include "ash/frame/header_painter.h"
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" // OVERRIDE
12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "ui/gfx/animation/animation_delegate.h"
15
16 namespace gfx {
17 class Rect;
18 class SlideAnimation;
19 }
20 namespace views {
21 class View;
22 class Widget;
23 }
24
25 namespace ash {
26 class FrameCaptionButtonContainerView;
27
28 // Helper class for painting the default window header.
29 class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
30 public gfx::AnimationDelegate {
31 public:
32 DefaultHeaderPainter();
33 virtual ~DefaultHeaderPainter();
34
35 // DefaultHeaderPainter does not take ownership of any of the parameters.
36 void Init(views::Widget* frame,
37 views::View* header_view,
38 views::View* window_icon,
39 FrameCaptionButtonContainerView* caption_button_container);
40
41 // HeaderPainter overrides:
42 virtual int GetMinimumHeaderWidth() const OVERRIDE;
43 virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) OVERRIDE;
44 virtual void LayoutHeader() OVERRIDE;
45 virtual int GetHeaderHeightForPainting() const OVERRIDE;
46 virtual void SetHeaderHeightForPainting(int height) OVERRIDE;
47 virtual void SchedulePaintForTitle() OVERRIDE;
48
49 private:
50 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment);
51
52 // gfx::AnimationDelegate override:
53 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
54
55 // Paints highlight around the edge of the header for inactive restored
56 // windows.
57 void PaintHighlightForInactiveRestoredWindow(gfx::Canvas* canvas);
58
59 // Paints the title bar, primarily the title string.
60 void PaintTitleBar(gfx::Canvas* canvas);
61
62 // Paints the header/content separator.
63 void PaintHeaderContentSeparator(gfx::Canvas* canvas);
64
65 // Returns the header bounds in the coordinates of |view_|. The header is
66 // assumed to be positioned at the top left corner of |view_| and to have the
67 // same width as |view_|.
68 gfx::Rect GetLocalBounds() const;
69
70 // Returns the bounds for the title.
71 gfx::Rect GetTitleBounds() const;
72
73 views::Widget* frame_;
74 views::View* view_;
75 views::View* window_icon_; // May be NULL.
76 FrameCaptionButtonContainerView* caption_button_container_;
77
78 // The height of the header including the header/content separator.
79 int height_;
80
81 // Whether the header should be painted as active.
82 Mode mode_;
83
84 // Whether the header is painted for the first time.
85 bool initial_paint_;
86
87 scoped_ptr<gfx::SlideAnimation> activation_animation_;
88
89 DISALLOW_COPY_AND_ASSIGN(DefaultHeaderPainter);
90 };
91
92 } // namespace ash
93
94 #endif // ASH_FRAME_DEFAULT_HEADER_PAINTER_H_
OLDNEW
« no previous file with comments | « ash/frame/custom_frame_view_ash_unittest.cc ('k') | ash/frame/default_header_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698