OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/chromeos/status/status_area_button.h" | 5 #include "chrome/browser/chromeos/status/status_area_button.h" |
6 | 6 |
7 #include "grit/theme_resources.h" | 7 #include "grit/theme_resources.h" |
8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/skbitmap_operations.h" | 10 #include "ui/gfx/skbitmap_operations.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Use an offset that is top aligned with toolbar. | 59 // Use an offset that is top aligned with toolbar. |
60 set_menu_offset(0, 4); | 60 set_menu_offset(0, 4); |
61 | 61 |
62 UpdateTextStyle(); | 62 UpdateTextStyle(); |
63 } | 63 } |
64 | 64 |
65 void StatusAreaButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { | 65 void StatusAreaButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { |
66 if (state() == BS_PUSHED) { | 66 if (state() == BS_PUSHED) { |
67 // Apply 10% white when pushed down. | 67 // Apply 10% white when pushed down. |
68 canvas->FillRectInt(SkColorSetARGB(0x19, 0xFF, 0xFF, 0xFF), | 68 canvas->FillRect(SkColorSetARGB(0x19, 0xFF, 0xFF, 0xFF), GetLocalBounds()); |
69 0, 0, width(), height()); | |
70 } | 69 } |
71 | 70 |
72 if (use_menu_button_paint_) { | 71 if (use_menu_button_paint_) { |
73 views::MenuButton::PaintButton(canvas, mode); | 72 views::MenuButton::PaintButton(canvas, mode); |
74 } else { | 73 } else { |
75 canvas->DrawBitmapInt(icon(), horizontal_padding(), 0); | 74 canvas->DrawBitmapInt(icon(), horizontal_padding(), 0); |
76 OnPaintFocusBorder(canvas); | 75 OnPaintFocusBorder(canvas); |
77 } | 76 } |
78 } | 77 } |
79 | 78 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 break; | 171 break; |
173 case StatusAreaHost::kGrayEmbossed: | 172 case StatusAreaHost::kGrayEmbossed: |
174 SetEnabledColor(kGrayEmbossedTextColor); | 173 SetEnabledColor(kGrayEmbossedTextColor); |
175 SetTextShadowColors(kGrayEmbossedShadowColor, kGrayEmbossedShadowColor); | 174 SetTextShadowColors(kGrayEmbossedShadowColor, kGrayEmbossedShadowColor); |
176 SetTextShadowOffset(0, 1); | 175 SetTextShadowOffset(0, 1); |
177 break; | 176 break; |
178 } | 177 } |
179 } | 178 } |
180 | 179 |
181 } // namespace chromeos | 180 } // namespace chromeos |
OLD | NEW |