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

Side by Side Diff: chrome/browser/chromeos/login/rounded_view.h

Issue 6529037: Rename ProcessPaint to Paint() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « no previous file | chrome/browser/ui/touch/tabs/touch_tab_strip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_
7 7
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/gfx/canvas_skia.h" 9 #include "ui/gfx/canvas_skia.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 24 matching lines...) Expand all
35 // Empty constructor. 35 // Empty constructor.
36 RoundedView() {} 36 RoundedView() {}
37 37
38 // Constructors. 38 // Constructors.
39 template<typename D> 39 template<typename D>
40 explicit RoundedView(const D &value) : C(value) {} 40 explicit RoundedView(const D &value) : C(value) {}
41 template<typename D1, typename D2> 41 template<typename D1, typename D2>
42 RoundedView(const D1& val1, const D2& val2) : C(val1, val2) {} 42 RoundedView(const D1& val1, const D2& val2) : C(val1, val2) {}
43 43
44 // Overrides views::View. 44 // Overrides views::View.
45 virtual void ProcessPaint(gfx::Canvas* canvas); 45 virtual void Paint(gfx::Canvas* canvas);
46 46
47 protected: 47 protected:
48 // Returns the path that will be used for a clip. 48 // Returns the path that will be used for a clip.
49 virtual SkPath GetClipPath() const; 49 virtual SkPath GetClipPath() const;
50 50
51 // Returns maximal rectangle in the view. 51 // Returns maximal rectangle in the view.
52 virtual SkRect GetViewRect() const; 52 virtual SkRect GetViewRect() const;
53 53
54 // Draws custom frame for the view. 54 // Draws custom frame for the view.
55 virtual void DrawFrame(gfx::Canvas* canvas); 55 virtual void DrawFrame(gfx::Canvas* canvas);
56 }; 56 };
57 57
58 // RoundedView implementation. 58 // RoundedView implementation.
59 59
60 template <typename C> 60 template <typename C>
61 void RoundedView<C>::ProcessPaint(gfx::Canvas* canvas) { 61 void RoundedView<C>::Paint(gfx::Canvas* canvas) {
62 // Setup clip region. 62 // Setup clip region.
63 canvas->Save(); 63 canvas->Save();
64 canvas->AsCanvasSkia()->clipPath(GetClipPath()); 64 canvas->AsCanvasSkia()->clipPath(GetClipPath());
65 // Do original painting. 65 // Do original painting.
66 C::ProcessPaint(canvas); 66 C::Paint(canvas);
67 canvas->Restore(); 67 canvas->Restore();
68 // Add frame. 68 // Add frame.
69 DrawFrame(canvas); 69 DrawFrame(canvas);
70 } 70 }
71 71
72 template <typename C> 72 template <typename C>
73 SkPath RoundedView<C>::GetClipPath() const { 73 SkPath RoundedView<C>::GetClipPath() const {
74 SkPath round_view; 74 SkPath round_view;
75 SkRect view_rect = GetViewRect(); 75 SkRect view_rect = GetViewRect();
76 view_rect.inset(2 * rounded_view::kStrokeWidth, 76 view_rect.inset(2 * rounded_view::kStrokeWidth,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 view_rect.offset(rounded_view::kStrokeWidth - kDelta, 124 view_rect.offset(rounded_view::kStrokeWidth - kDelta,
125 rounded_view::kStrokeWidth - kDelta); 125 rounded_view::kStrokeWidth - kDelta);
126 paint.setColor(rounded_view::kOuterFrameColor); 126 paint.setColor(rounded_view::kOuterFrameColor);
127 canvas->AsCanvasSkia()->drawRoundRect(view_rect, rounded_view::kCornerRadius, 127 canvas->AsCanvasSkia()->drawRoundRect(view_rect, rounded_view::kCornerRadius,
128 rounded_view::kCornerRadius, paint); 128 rounded_view::kCornerRadius, paint);
129 } 129 }
130 130
131 } 131 }
132 132
133 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_ 133 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ROUNDED_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/touch/tabs/touch_tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698