Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / system_menu_model_delegate.h
blob750d43d66769ac61c2b463f76315a1c143357ace
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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_
8 #include "base/compiler_specific.h"
9 #include "chrome/browser/ui/browser.h"
10 #include "ui/base/accelerators/accelerator.h"
11 #include "ui/base/models/simple_menu_model.h"
13 // Provides the SimpleMenuModel::Delegate implementation for system context
14 // menus.
15 class SystemMenuModelDelegate : public ui::SimpleMenuModel::Delegate {
16 public:
17 SystemMenuModelDelegate(ui::AcceleratorProvider* provider, Browser* browser);
18 ~SystemMenuModelDelegate() override;
20 Browser* browser() { return browser_; }
22 // Overridden from ui::SimpleMenuModel::Delegate:
23 bool IsCommandIdChecked(int command_id) const override;
24 bool IsCommandIdEnabled(int command_id) const override;
25 bool GetAcceleratorForCommandId(int command_id,
26 ui::Accelerator* accelerator) override;
27 bool IsItemForCommandIdDynamic(int command_id) const override;
28 base::string16 GetLabelForCommandId(int command_id) const override;
29 void ExecuteCommand(int command_id, int event_flags) override;
31 private:
32 ui::AcceleratorProvider* provider_; // weak
33 Browser* browser_; // weak
35 DISALLOW_COPY_AND_ASSIGN(SystemMenuModelDelegate);
38 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_DELEGATE_H_