From 4c22771c386422700af38aeff1a1ea5c036e38c8 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Tue, 13 Oct 2009 22:41:54 +0000 Subject: 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 --- views/controls/menu/simple_menu_model.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'views/controls') 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 { -- cgit v1.1