summaryrefslogtreecommitdiffstats
path: root/app/menus/simple_menu_model.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 21:44:56 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 21:44:56 +0000
commit735085ed203ee840e493971d9a87c156f45d67b0 (patch)
treeeb1c3bb90981f5014665e9231fead42d7593f60a /app/menus/simple_menu_model.cc
parent87641841064ef4d2a3c084693682c72f16d7ebe9 (diff)
downloadchromium_src-735085ed203ee840e493971d9a87c156f45d67b0.zip
chromium_src-735085ed203ee840e493971d9a87c156f45d67b0.tar.gz
chromium_src-735085ed203ee840e493971d9a87c156f45d67b0.tar.bz2
Move implementations in menu model stuff from header to implementation.
This breaks a dependency on SkBitmap.h for everything that just uses menus. BUG=none TEST=none Review URL: http://codereview.chromium.org/2854046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/menus/simple_menu_model.cc')
-rw-r--r--app/menus/simple_menu_model.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/menus/simple_menu_model.cc b/app/menus/simple_menu_model.cc
index 291aa5a..6a40f75 100644
--- a/app/menus/simple_menu_model.cc
+++ b/app/menus/simple_menu_model.cc
@@ -5,11 +5,37 @@
#include "app/menus/simple_menu_model.h"
#include "app/l10n_util.h"
+#include "third_party/skia/include/core/SkBitmap.h"
static const int kSeparatorId = -1;
namespace menus {
+struct SimpleMenuModel::Item {
+ int command_id;
+ string16 label;
+ SkBitmap icon;
+ ItemType type;
+ int group_id;
+ MenuModel* submenu;
+ ButtonMenuItemModel* button_model;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// SimpleMenuModel::Delegate, public:
+
+bool SimpleMenuModel::Delegate::IsLabelForCommandIdDynamic(
+ int command_id) const {
+ return false;
+}
+
+string16 SimpleMenuModel::Delegate::GetLabelForCommandId(int command_id) const {
+ return string16();
+}
+
+void SimpleMenuModel::Delegate::CommandIdHighlighted(int command_id) {
+}
+
////////////////////////////////////////////////////////////////////////////////
// SimpleMenuModel, public:
@@ -131,6 +157,10 @@ void SimpleMenuModel::SetIcon(int index, const SkBitmap& icon) {
items_[index].icon = icon;
}
+void SimpleMenuModel::Clear() {
+ items_.clear();
+}
+
int SimpleMenuModel::GetIndexOfCommandId(int command_id) {
std::vector<Item>::iterator itr;
for (itr = items_.begin(); itr != items_.end(); itr++) {