Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / app_context_menu.h
blob2dc3d89cff44da0ee2e9f1382582b3d06797ffdb
1 // Copyright 2013 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_APP_LIST_APP_CONTEXT_MENU_H_
6 #define CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/base/models/simple_menu_model.h"
14 class AppListControllerDelegate;
15 class Profile;
17 namespace extensions {
18 class ContextMenuMatcher;
21 namespace app_list {
23 class AppContextMenuDelegate;
25 class AppContextMenu : public ui::SimpleMenuModel::Delegate {
26 public:
27 AppContextMenu(AppContextMenuDelegate* delegate,
28 Profile* profile,
29 const std::string& app_id,
30 AppListControllerDelegate* controller,
31 bool is_platform_app,
32 bool is_search_result_);
33 virtual ~AppContextMenu();
35 // Note this could return NULL if corresponding extension is gone.
36 ui::MenuModel* GetMenuModel();
38 private:
39 // ui::SimpleMenuModel::Delegate overrides:
40 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE;
41 virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE;
42 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
43 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
44 virtual bool GetAcceleratorForCommandId(
45 int command_id,
46 ui::Accelerator* acclelrator) OVERRIDE;
47 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
49 AppContextMenuDelegate* delegate_;
50 Profile* profile_;
51 const std::string app_id_;
52 AppListControllerDelegate* controller_;
53 bool is_platform_app_;
54 bool is_search_result_;
56 scoped_ptr<ui::SimpleMenuModel> menu_model_;
57 scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_;
59 DISALLOW_COPY_AND_ASSIGN(AppContextMenu);
62 } // namespace app_list
64 #endif // CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_