| Index: chrome/browser/ui/views/recent_tabs_menu_model_delegate.h
|
| diff --git a/chrome/browser/ui/views/recent_tabs_menu_model_delegate.h b/chrome/browser/ui/views/recent_tabs_menu_model_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..871522a5459070433a4f61d87689ad07e278c4b6
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/recent_tabs_menu_model_delegate.h
|
| @@ -0,0 +1,66 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_VIEWS_RECENT_TABS_MENU_MODEL_DELEGATE_H_
|
| +#define CHROME_BROWSER_UI_VIEWS_RECENT_TABS_MENU_MODEL_DELEGATE_H_
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "third_party/skia/include/core/SkColor.h"
|
| +#include "ui/base/models/menu_model_delegate.h"
|
| +
|
| +class MenuItemsChangedDelegate;
|
| +class RecentTabsSubMenuModel;
|
| +
|
| +namespace gfx {
|
| +class Font;
|
| +};
|
| +
|
| +namespace views {
|
| +class MenuItemView;
|
| +};
|
| +
|
| +// Provides the ui::MenuModelDelegate implementation for RecentTabsSubMenuModel
|
| +// items.
|
| +class RecentTabsMenuModelDelegate : public ui::MenuModelDelegate {
|
| + public:
|
| + RecentTabsMenuModelDelegate(MenuItemsChangedDelegate* items_changed_delegate,
|
| + RecentTabsSubMenuModel* model,
|
| + views::MenuItemView* menu_item,
|
| + int first_command_id,
|
| + int max_command_id);
|
| + virtual ~RecentTabsMenuModelDelegate();
|
| +
|
| + void PopulateMenu();
|
| +
|
| + // Return the specific menu width of recent tabs submenu if |menu| is the
|
| + // recent tabs submenu, else return -1.
|
| + int GetMaxWidthForMenu(views::MenuItemView* menu);
|
| +
|
| + const gfx::Font* GetLabelFontAt(int item_id) const;
|
| +
|
| + bool GetForegroundColor(int command_id, bool is_hovered,
|
| + SkColor* override_color) const;
|
| +
|
| + // ui::MenuModelDelegate implementation:
|
| + virtual void OnIconChanged(int index) OVERRIDE;
|
| + virtual void PrepareForChange() OVERRIDE;
|
| + virtual void OnItemRemoved(int index) OVERRIDE;
|
| + virtual void OnItemAdded(int index) OVERRIDE;
|
| + virtual void ChangesDone() OVERRIDE;
|
| +
|
| + private:
|
| + int ModelIndexToMenuItemId(int model_index) const;
|
| + int MenuItemIdToModelIndex(int menu_item_id) const;
|
| +
|
| + MenuItemsChangedDelegate* items_changed_delegate_;
|
| + RecentTabsSubMenuModel* model_;
|
| + views::MenuItemView* menu_item_;
|
| + int first_command_id_;
|
| + int max_command_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(RecentTabsMenuModelDelegate);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_RECENT_TABS_MENU_MODEL_DELEGATE_H_
|
|
|