1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/wrench_menu/recent_tabs_menu_model_delegate.h"
6 #include "ui/base/models/menu_model.h"
7 #include "ui/gfx/image/image.h"
9 RecentTabsMenuModelDelegate::RecentTabsMenuModelDelegate(
13 menu_([menu retain]) {
14 model_->SetMenuModelDelegate(this);
17 RecentTabsMenuModelDelegate::~RecentTabsMenuModelDelegate() {
18 model_->SetMenuModelDelegate(NULL);
21 void RecentTabsMenuModelDelegate::OnIconChanged(int index) {
23 if (!model_->GetIconAt(index, &icon))
26 NSMenuItem* item = [menu_ itemAtIndex:index];
27 [item setImage:icon.ToNSImage()];