Index: app/menus/simple_menu_model.cc |
diff --git a/app/menus/simple_menu_model.cc b/app/menus/simple_menu_model.cc |
index b645b098305b6e3debbf74768b603f56693ba2b4..427bbf15d01bb164f72314c6d384f447ac336ef1 100644 |
--- a/app/menus/simple_menu_model.cc |
+++ b/app/menus/simple_menu_model.cc |
@@ -28,7 +28,7 @@ bool SimpleMenuModel::Delegate::IsCommandIdVisible(int command_id) const { |
return true; |
} |
-bool SimpleMenuModel::Delegate::IsLabelForCommandIdDynamic( |
+bool SimpleMenuModel::Delegate::IsItemForCommandIdDynamic( |
int command_id) const { |
return false; |
} |
@@ -37,6 +37,11 @@ string16 SimpleMenuModel::Delegate::GetLabelForCommandId(int command_id) const { |
return string16(); |
} |
+bool SimpleMenuModel::Delegate::GetIconForCommandId( |
+ int command_id, SkBitmap* bitmap) const { |
+ return false; |
+} |
+ |
void SimpleMenuModel::Delegate::CommandIdHighlighted(int command_id) { |
} |
@@ -201,14 +206,14 @@ int SimpleMenuModel::GetCommandIdAt(int index) const { |
} |
string16 SimpleMenuModel::GetLabelAt(int index) const { |
- if (IsLabelDynamicAt(index)) |
+ if (IsItemDynamicAt(index)) |
return delegate_->GetLabelForCommandId(GetCommandIdAt(index)); |
return items_.at(FlipIndex(index)).label; |
} |
-bool SimpleMenuModel::IsLabelDynamicAt(int index) const { |
+bool SimpleMenuModel::IsItemDynamicAt(int index) const { |
if (delegate_) |
- return delegate_->IsLabelForCommandIdDynamic(GetCommandIdAt(index)); |
+ return delegate_->IsItemForCommandIdDynamic(GetCommandIdAt(index)); |
return false; |
} |
@@ -235,6 +240,9 @@ int SimpleMenuModel::GetGroupIdAt(int index) const { |
} |
bool SimpleMenuModel::GetIconAt(int index, SkBitmap* icon) const { |
+ if (IsItemDynamicAt(index)) |
+ return delegate_->GetIconForCommandId(GetCommandIdAt(index), icon); |
+ |
if (items_[index].icon.isNull()) |
return false; |