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. 4 5#ifndef CHROME_BROWSER_UI_COCOA_WRENCH_MENU_RECENT_TABS_MENU_MODEL_DELEGATE_H_ 6#define CHROME_BROWSER_UI_COCOA_WRENCH_MENU_RECENT_TABS_MENU_MODEL_DELEGATE_H_ 7 8#import <Cocoa/Cocoa.h> 9 10#include "base/mac/scoped_nsobject.h" 11#include "ui/base/models/menu_model_delegate.h" 12 13namespace ui { 14class MenuModel; 15} 16 17// Updates the recent tabs menu when the model changes. 18class RecentTabsMenuModelDelegate : public ui::MenuModelDelegate { 19 public: 20 // |model| must live longer than this object. 21 RecentTabsMenuModelDelegate(ui::MenuModel* model, NSMenu* menu); 22 virtual ~RecentTabsMenuModelDelegate(); 23 24 // ui::MenuModelDelegate: 25 virtual void OnIconChanged(int index) OVERRIDE; 26 27 private: 28 ui::MenuModel* model_; // weak 29 base::scoped_nsobject<NSMenu> menu_; 30 31 DISALLOW_COPY_AND_ASSIGN(RecentTabsMenuModelDelegate); 32}; 33 34#endif // CHROME_BROWSER_UI_COCOA_WRENCH_MENU_RECENT_TABS_MENU_MODEL_DELEGATE_H_ 35