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 <windows.h> | 7 #include <windows.h> |
8 #include <uxtheme.h> | 8 #include <uxtheme.h> |
9 #include <Vssym32.h> | 9 #include <Vssym32.h> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 gfx::Rect separator_bounds(start_x, 0, width(), height()); | 42 gfx::Rect separator_bounds(start_x, 0, width(), height()); |
43 ui::NativeTheme::ExtraParams extra; | 43 ui::NativeTheme::ExtraParams extra; |
44 extra.menu_separator.has_gutter = config.render_gutter; | 44 extra.menu_separator.has_gutter = config.render_gutter; |
45 config.native_theme->Paint( | 45 config.native_theme->Paint( |
46 canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator, | 46 canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator, |
47 ui::NativeTheme::kNormal, separator_bounds, extra); | 47 ui::NativeTheme::kNormal, separator_bounds, extra); |
48 } | 48 } |
49 | 49 |
50 gfx::Size MenuSeparator::GetPreferredSize() { | 50 gfx::Size MenuSeparator::GetPreferredSize() const { |
51 const MenuConfig& config = parent_menu_item_->GetMenuConfig(); | 51 const MenuConfig& config = parent_menu_item_->GetMenuConfig(); |
52 | 52 |
53 if (config.native_theme == ui::NativeThemeAura::instance()) | 53 if (config.native_theme == ui::NativeThemeAura::instance()) |
54 return GetPreferredSizeAura(); | 54 return GetPreferredSizeAura(); |
55 | 55 |
56 return gfx::Size(10, // Just in case we're the only item in a menu. | 56 return gfx::Size(10, // Just in case we're the only item in a menu. |
57 config.separator_height); | 57 config.separator_height); |
58 } | 58 } |
59 | 59 |
60 } // namespace views | 60 } // namespace views |
OLD | NEW |