| 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 "content/common/notification_service.h" | 7 #include "content/common/notification_service.h" |
| 8 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/skbitmap_operations.h" | 11 #include "ui/gfx/skbitmap_operations.h" |
| 12 #include "views/border.h" | 12 #include "views/border.h" |
| 13 #include "views/view.h" | 13 #include "views/view.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 // Colors for different text styles. | 17 // Colors for different text styles. |
| 18 static const SkColor kWhitePlainTextColor = 0x99ffffff; | 18 static const SkColor kWhitePlainTextColor = 0x99ffffff; |
| 19 static const SkColor kWhiteHaloedTextColor = 0xb3ffffff; | 19 static const SkColor kWhiteHaloedTextColor = 0xb3ffffff; |
| 20 static const SkColor kWhiteHaloedHaloColor = 0xb3000000; | 20 static const SkColor kWhiteHaloedHaloColor = 0xb3000000; |
| 21 static const SkColor kGrayEmbossedTextColor = 0xff4c4c4c; | 21 static const SkColor kGrayEmbossedTextColor = 0xff4c4c4c; |
| 22 static const SkColor kGrayEmbossedShadowColor = 0x80ffffff; | 22 static const SkColor kGrayEmbossedShadowColor = 0x80ffffff; |
| 23 | 23 |
| 24 // Status area font is bigger. | 24 // Status area font is bigger. |
| 25 const int kFontSizeDelta = 1; | 25 const int kFontSizeDelta = 3; |
| 26 | 26 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 28 // StatusAreaButton | 28 // StatusAreaButton |
| 29 | 29 |
| 30 StatusAreaButton::StatusAreaButton(StatusAreaHost* host, | 30 StatusAreaButton::StatusAreaButton(StatusAreaHost* host, |
| 31 views::ViewMenuDelegate* menu_delegate) | 31 views::ViewMenuDelegate* menu_delegate) |
| 32 : MenuButton(NULL, std::wstring(), menu_delegate, false), | 32 : MenuButton(NULL, std::wstring(), menu_delegate, false), |
| 33 use_menu_button_paint_(false), | 33 use_menu_button_paint_(false), |
| 34 active_(true), | 34 active_(true), |
| 35 host_(host) { | 35 host_(host) { |
| 36 set_border(NULL); | 36 set_border(NULL); |
| 37 set_use_menu_button_paint(true); | 37 set_use_menu_button_paint(true); |
| 38 gfx::Font font = | 38 gfx::Font font = |
| 39 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); | 39 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); |
| 40 font = font.DeriveFont(3, gfx::Font::BOLD); | 40 font = font.DeriveFont(kFontSizeDelta, gfx::Font::BOLD); |
| 41 SetFont(font); | 41 SetFont(font); |
| 42 SetShowMultipleIconStates(false); | 42 SetShowMultipleIconStates(false); |
| 43 set_alignment(TextButton::ALIGN_CENTER); | 43 set_alignment(TextButton::ALIGN_CENTER); |
| 44 set_border(NULL); | 44 set_border(NULL); |
| 45 | 45 |
| 46 // Use an offset that is top aligned with toolbar. | 46 // Use an offset that is top aligned with toolbar. |
| 47 set_menu_offset(0, 4); | 47 set_menu_offset(0, 4); |
| 48 | 48 |
| 49 UpdateTextStyle(); | 49 UpdateTextStyle(); |
| 50 } | 50 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 break; | 157 break; |
| 158 case StatusAreaHost::kGrayEmbossed: | 158 case StatusAreaHost::kGrayEmbossed: |
| 159 SetEnabledColor(kGrayEmbossedTextColor); | 159 SetEnabledColor(kGrayEmbossedTextColor); |
| 160 SetTextShadowColors(kGrayEmbossedShadowColor, kGrayEmbossedShadowColor); | 160 SetTextShadowColors(kGrayEmbossedShadowColor, kGrayEmbossedShadowColor); |
| 161 SetTextShadowOffset(0, 1); | 161 SetTextShadowOffset(0, 1); |
| 162 break; | 162 break; |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace chromeos | 166 } // namespace chromeos |
| OLD | NEW |