| 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_separator.h" | 5 #include "ui/views/controls/menu/menu_separator.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkColor.h" | 7 #include "third_party/skia/include/core/SkColor.h" |
| 8 #include "ui/base/native_theme/native_theme.h" | |
| 9 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
| 9 #include "ui/gfx/native_theme.h" |
| 10 #include "ui/views/controls/menu/menu_config.h" | 10 #include "ui/views/controls/menu/menu_config.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 const int kSeparatorHeight = 1; | 14 const int kSeparatorHeight = 1; |
| 15 | 15 |
| 16 } // namespace | 16 } // namespace |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 | 19 |
| 20 void MenuSeparator::OnPaint(gfx::Canvas* canvas) { | 20 void MenuSeparator::OnPaint(gfx::Canvas* canvas) { |
| 21 canvas->FillRect(gfx::Rect(0, height() / 2, width(), kSeparatorHeight), | 21 canvas->FillRect(gfx::Rect(0, height() / 2, width(), kSeparatorHeight), |
| 22 ui::NativeTheme::instance()->GetSystemColor( | 22 gfx::NativeTheme::instance()->GetSystemColor( |
| 23 ui::NativeTheme::kColorId_MenuSeparatorColor)); | 23 gfx::NativeTheme::kColorId_MenuSeparatorColor)); |
| 24 } | 24 } |
| 25 | 25 |
| 26 gfx::Size MenuSeparator::GetPreferredSize() { | 26 gfx::Size MenuSeparator::GetPreferredSize() { |
| 27 return gfx::Size(10, // Just in case we're the only item in a menu. | 27 return gfx::Size(10, // Just in case we're the only item in a menu. |
| 28 MenuConfig::instance().separator_height); | 28 MenuConfig::instance().separator_height); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace views | 31 } // namespace views |
| OLD | NEW |