12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file. 42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef UI_APP_LIST_APP_LIST_MENU_H_ 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define UI_APP_LIST_APP_LIST_MENU_H_ 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "ui/app_list/app_list_view_delegate.h" 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ui/base/models/simple_menu_model.h" 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace app_list { 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Menu for the app list. This is shown in the top right hand corner of the 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// app list. 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// TODO(benwells): We should consider moving this into Chrome. 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class AppListMenu : public ui::SimpleMenuModel::Delegate { 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public: 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) enum AppListMenuCommands { 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) SHOW_SETTINGS, 2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) SHOW_HELP, 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) SHOW_FEEDBACK, 2268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // |SELECT_PROFILE| must remain the last enum because values greater than 2368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // |SELECT_PROFILE| are used to indicate a profile index. 2468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) SELECT_PROFILE, 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) }; 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 27f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) explicit AppListMenu(AppListViewDelegate* delegate); 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual ~AppListMenu(); 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ui::SimpleMenuModel* menu_model() { return &menu_model_; } 312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private: 332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void InitMenu(); 342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual bool GetAcceleratorForCommandId( 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int command_id, 392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ui::Accelerator* accelerator) OVERRIDE; 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ui::SimpleMenuModel menu_model_; 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) AppListViewDelegate* delegate_; 44f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) AppListViewDelegate::Users users_; 452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(AppListMenu); 472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}; 482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace app_list 502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif // UI_APP_LIST_APP_LIST_MENU_H_ 52