| Index: views/controls/menu/native_menu_win.cc
|
| diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc
|
| index b9c78a1617a2fec961b97e9d7f2bcbc60f2b6d0f..19f32eec16b1e36b25a7ce613ccc8e7a317d93f9 100644
|
| --- a/views/controls/menu/native_menu_win.cc
|
| +++ b/views/controls/menu/native_menu_win.cc
|
| @@ -5,6 +5,7 @@
|
| #include "views/controls/menu/native_menu_win.h"
|
|
|
| #include "base/logging.h"
|
| +#include "base/message_loop.h"
|
| #include "base/stl_util-inl.h"
|
| #include "base/string_util.h"
|
| #include "base/win/wrapped_window_proc.h"
|
| @@ -340,12 +341,18 @@ void NativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
|
| // opening of the menu.
|
| listeners_called_ = false;
|
|
|
| + // Retrieving favicons from history requires nestable tasks.
|
| + MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
|
| +
|
| + model_->SetMenuModelDelegate(this);
|
| +
|
| // Command dispatch is done through WM_MENUCOMMAND, handled by the host
|
| // window.
|
| HWND hwnd = host_window_->hwnd();
|
| TrackPopupMenuEx(menu_, flags, point.x(), point.y(), host_window_->hwnd(),
|
| NULL);
|
|
|
| + model_->SetMenuModelDelegate(NULL);
|
| UnhookWindowsHookEx(hhook);
|
| open_native_menu_win_ = NULL;
|
| }
|
| @@ -416,6 +423,15 @@ void NativeMenuWin::SetMinimumWidth(int width) {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| +void NativeMenuWin::OnIconChanged(int model_index) {
|
| + // Translate the model_index to the menu_index.
|
| + int first_item_index_ = model_->GetFirstItemIndex(GetNativeMenu());
|
| + int menu_index = model_index + first_item_index_;
|
| + // Unfortunately this repaints the entire menu.
|
| + SetMenuItemState(menu_index, model_->IsEnabledAt(model_index),
|
| + model_->IsItemCheckedAt(model_index), false);
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // NativeMenuWin, private:
|
|
|
|
|