diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 22:41:54 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 22:41:54 +0000 |
commit | 4c22771c386422700af38aeff1a1ea5c036e38c8 (patch) | |
tree | cb2e5ee3aa702c72ea0f67e702c4666475dfc801 /views/controls/menu | |
parent | 9a295b8b77f4ad665fa5a3ec9201d44850b38a88 (diff) | |
download | chromium_src-4c22771c386422700af38aeff1a1ea5c036e38c8.zip chromium_src-4c22771c386422700af38aeff1a1ea5c036e38c8.tar.gz chromium_src-4c22771c386422700af38aeff1a1ea5c036e38c8.tar.bz2 |
Take 2 of getting blocked popups to work on views/gtk. My first attempt was not deleting the blocked popup container view views,
which resulted in a reliability crash. This differs from the first patch in that BlockedPopupContainerViewViews::Destroy now does
a delete this.
From the original patch:
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/274019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28903 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 { |