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.h" | 5 #include "ui/views/controls/menu/menu.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "ui/gfx/image/image_skia.h" | 8 #include "ui/gfx/image/image_skia.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 | 11 |
| 12 bool Menu::Delegate::IsItemChecked(int id) const { |
| 13 return false; |
| 14 } |
| 15 |
| 16 bool Menu::Delegate::IsItemDefault(int id) const { |
| 17 return false; |
| 18 } |
| 19 |
| 20 string16 Menu::Delegate::GetLabel(int id) const { |
| 21 return string16(); |
| 22 } |
| 23 |
| 24 bool Menu::Delegate::GetAcceleratorInfo(int id, ui::Accelerator* accel) { |
| 25 return false; |
| 26 } |
| 27 |
| 28 const gfx::ImageSkia& Menu::Delegate::GetIcon(int id) const { |
| 29 return GetEmptyIcon(); |
| 30 } |
| 31 |
| 32 int Menu::Delegate::GetItemCount() const { |
| 33 return 0; |
| 34 } |
| 35 |
| 36 bool Menu::Delegate::IsItemSeparator(int id) const { |
| 37 return false; |
| 38 } |
| 39 |
| 40 bool Menu::Delegate::HasIcon(int id) const { |
| 41 return false; |
| 42 } |
| 43 |
| 44 bool Menu::Delegate::SupportsCommand(int id) const { |
| 45 return true; |
| 46 } |
| 47 |
| 48 bool Menu::Delegate::IsCommandEnabled(int id) const { |
| 49 return true; |
| 50 } |
| 51 |
| 52 bool Menu::Delegate::GetContextualLabel(int id, string16* out) const { |
| 53 return false; |
| 54 } |
| 55 |
12 bool Menu::Delegate::IsRightToLeftUILayout() const { | 56 bool Menu::Delegate::IsRightToLeftUILayout() const { |
13 return base::i18n::IsRTL(); | 57 return base::i18n::IsRTL(); |
14 } | 58 } |
15 | 59 |
16 const gfx::ImageSkia& Menu::Delegate::GetEmptyIcon() const { | 60 const gfx::ImageSkia& Menu::Delegate::GetEmptyIcon() const { |
17 static const gfx::ImageSkia* empty_icon = new gfx::ImageSkia(); | 61 static const gfx::ImageSkia* empty_icon = new gfx::ImageSkia(); |
18 return *empty_icon; | 62 return *empty_icon; |
19 } | 63 } |
20 | 64 |
21 Menu::Menu(Delegate* delegate, AnchorPoint anchor) | 65 Menu::Menu(Delegate* delegate, AnchorPoint anchor) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 int item_id, | 137 int item_id, |
94 const string16& label, | 138 const string16& label, |
95 const gfx::ImageSkia& icon) { | 139 const gfx::ImageSkia& icon) { |
96 AddMenuItemInternal(index, item_id, label, icon, Menu::NORMAL); | 140 AddMenuItemInternal(index, item_id, label, icon, Menu::NORMAL); |
97 } | 141 } |
98 | 142 |
99 Menu::Menu() : delegate_(NULL), anchor_(TOPLEFT) { | 143 Menu::Menu() : delegate_(NULL), anchor_(TOPLEFT) { |
100 } | 144 } |
101 | 145 |
102 } // namespace views | 146 } // namespace views |
OLD | NEW |