• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 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_TABS_TAB_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_
7 #pragma once
8 
9 #include "ui/base/models/simple_menu_model.h"
10 
11 class TabStripModel;
12 
13 // A menu model that builds the contents of the tab context menu. To make sure
14 // the menu reflects the real state of the tab a new TabMenuModel should be
15 // created each time the menu is shown.
16 class TabMenuModel : public ui::SimpleMenuModel {
17  public:
18   // TODO: nuke this constructor when callers are updated.
19   TabMenuModel(ui::SimpleMenuModel::Delegate* delegate, bool is_pinned);
20   TabMenuModel(ui::SimpleMenuModel::Delegate* delegate,
21                TabStripModel* tab_strip,
22                int index);
~TabMenuModel()23   virtual ~TabMenuModel() {}
24 
25   // Returns true if vertical tabs are enabled.
26   static bool AreVerticalTabsEnabled();
27 
28  private:
29   // TODO: nuke this when first constructor is removed.
30   void Build(bool is_pinned);
31   void Build(TabStripModel* tab_strip, int index);
32 
33   DISALLOW_COPY_AND_ASSIGN(TabMenuModel);
34 };
35 
36 #endif  // CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_
37