diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 17:44:40 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-12 17:44:40 +0000 |
commit | 65b541890c5a048796bd2fc9ac687f0bac02bebe (patch) | |
tree | 9a02ae860b48a53abb147bc6cd2141fc4210d4e1 /views/controls/menu | |
parent | 56ec62a9dbeda39c379b31ebb48756e2f1bcedaf (diff) | |
download | chromium_src-65b541890c5a048796bd2fc9ac687f0bac02bebe.zip chromium_src-65b541890c5a048796bd2fc9ac687f0bac02bebe.tar.gz chromium_src-65b541890c5a048796bd2fc9ac687f0bac02bebe.tar.bz2 |
Gets blocked popups to work on views/gtk. I had to fix a couple of
additional things here:
. Avoid doing anything in OnSizeAllocation if the size hasn't
changed. Because of how gtk works I was getting stuck in a loop if I
OnSizeAllocate did anything if the size hadn't changed.
. Applied similar shortcut to TabContentsViewGtk.
. Made SimpleMenuModel only ask delegate for checked state if the item
is a check.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/261051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu')
-rw-r--r-- | views/controls/menu/simple_menu_model.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/views/controls/menu/simple_menu_model.cc b/views/controls/menu/simple_menu_model.cc index de86bce..67a9e2d 100644 --- a/views/controls/menu/simple_menu_model.cc +++ b/views/controls/menu/simple_menu_model.cc @@ -103,7 +103,9 @@ bool SimpleMenuModel::GetAcceleratorAt(int index, bool SimpleMenuModel::IsItemCheckedAt(int index) const { if (!delegate_) return false; - return delegate_->IsCommandIdChecked(GetCommandIdAt(index)); + int item_index = FlipIndex(index); + return (items_[item_index].type == TYPE_CHECK) ? + delegate_->IsCommandIdChecked(GetCommandIdAt(index)) : false; } int SimpleMenuModel::GetGroupIdAt(int index) const { |