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

Side by Side Diff: ui/views/background.h

Issue 2838273002: Reland 097f9cde453ea57eb4aa037f44add782391c5eb9 (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « ui/message_center/views/message_bubble_base.cc ('k') | ui/views/background.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) 2012 The Chromium Authors. All rights reserved. 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 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 UI_VIEWS_BACKGROUND_H_ 5 #ifndef UI_VIEWS_BACKGROUND_H_
6 #define UI_VIEWS_BACKGROUND_H_ 6 #define UI_VIEWS_BACKGROUND_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/native_theme/native_theme.h"
15 #include "ui/views/views_export.h" 16 #include "ui/views/views_export.h"
16 17
17 #if defined(OS_WIN) 18 #if defined(OS_WIN)
18 #include <windows.h> 19 #include <windows.h>
19 #endif // defined(OS_WIN) 20 #endif // defined(OS_WIN)
20 21
21 namespace gfx { 22 namespace gfx {
22 class Canvas; 23 class Canvas;
23 } 24 }
24 25
(...skipping 15 matching lines...) Expand all
40 // 41 //
41 ///////////////////////////////////////////////////////////////////////////// 42 /////////////////////////////////////////////////////////////////////////////
42 class VIEWS_EXPORT Background { 43 class VIEWS_EXPORT Background {
43 public: 44 public:
44 Background(); 45 Background();
45 virtual ~Background(); 46 virtual ~Background();
46 47
47 // Creates a background that fills the canvas in the specified color. 48 // Creates a background that fills the canvas in the specified color.
48 static Background* CreateSolidBackground(SkColor color); 49 static Background* CreateSolidBackground(SkColor color);
49 50
51 // Creates a background that fills the canvas in the color specified by the
52 // view's NativeTheme and the given color identifier.
53 static Background* CreateThemedSolidBackground(
54 View* view,
55 ui::NativeTheme::ColorId color_id);
56
50 // Creates a background that fills the canvas in the specified color. 57 // Creates a background that fills the canvas in the specified color.
51 static Background* CreateSolidBackground(int r, int g, int b) { 58 static Background* CreateSolidBackground(int r, int g, int b) {
52 return CreateSolidBackground(SkColorSetRGB(r, g, b)); 59 return CreateSolidBackground(SkColorSetRGB(r, g, b));
53 } 60 }
54 61
55 // Creates a background that fills the canvas in the specified color. 62 // Creates a background that fills the canvas in the specified color.
56 static Background* CreateSolidBackground(int r, int g, int b, int a) { 63 static Background* CreateSolidBackground(int r, int g, int b, int a) {
57 return CreateSolidBackground(SkColorSetARGB(a, r, g, b)); 64 return CreateSolidBackground(SkColorSetARGB(a, r, g, b));
58 } 65 }
59 66
(...skipping 18 matching lines...) Expand all
78 85
79 private: 86 private:
80 SkColor color_; 87 SkColor color_;
81 88
82 DISALLOW_COPY_AND_ASSIGN(Background); 89 DISALLOW_COPY_AND_ASSIGN(Background);
83 }; 90 };
84 91
85 } // namespace views 92 } // namespace views
86 93
87 #endif // UI_VIEWS_BACKGROUND_H_ 94 #endif // UI_VIEWS_BACKGROUND_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/message_bubble_base.cc ('k') | ui/views/background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698