| OLD | NEW |
| 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 #include "ui/views/controls/menu/menu_config.h" | 5 #include "ui/views/controls/menu/menu_config.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
| 11 #include "ui/gfx/native_theme_aura.h" |
| 11 | 12 |
| 12 namespace views { | 13 namespace views { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 MenuConfig* MenuConfig::Create() { | 16 MenuConfig* MenuConfig::Create() { |
| 16 MenuConfig* config = new MenuConfig(); | 17 MenuConfig* config = new MenuConfig(); |
| 18 config->text_color = gfx::NativeTheme::instance()->GetSystemColor( |
| 19 gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor); |
| 17 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 20 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 18 config->font = rb.GetFont(ResourceBundle::BaseFont); | 21 config->font = rb.GetFont(ResourceBundle::BaseFont); |
| 19 config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToSkBitmap()->width(); | 22 config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToSkBitmap()->width(); |
| 20 const SkBitmap* check = rb.GetImageNamed(IDR_MENU_CHECK).ToSkBitmap(); | 23 const SkBitmap* check = rb.GetImageNamed(IDR_MENU_CHECK).ToSkBitmap(); |
| 21 // Add 4 to force some padding between check and label. | 24 // Add 4 to force some padding between check and label. |
| 22 config->check_width = check->width() + 4; | 25 config->check_width = check->width() + 4; |
| 23 config->check_height = check->height(); | 26 config->check_height = check->height(); |
| 24 | 27 |
| 25 return config; | 28 return config; |
| 26 } | 29 } |
| 27 | 30 |
| 28 } // namespace views | 31 } // namespace views |
| OLD | NEW |