15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_ 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/basictypes.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/callback.h" 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/browser/media_galleries/media_galleries_preferences.h" 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/base/models/simple_menu_model.h" 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class MediaGalleryContextMenu : public ui::SimpleMenuModel, 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public ui::SimpleMenuModel::Delegate { 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) typedef base::Callback<void(MediaGalleryPrefId pref_id)> 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ForgetGalleryCallback; 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) explicit MediaGalleryContextMenu(const ForgetGalleryCallback& callback); 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual ~MediaGalleryContextMenu(); 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) void set_pref_id(MediaGalleryPrefId pref_id) { 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) pref_id_ = pref_id; 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // ui::SimpleMenuModel::Delegate overrides: 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool IsCommandIdVisible(int command_id) const OVERRIDE; 305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool GetAcceleratorForCommandId( 315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int command_id, ui::Accelerator* accelerator) OVERRIDE; 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private: 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) MediaGalleryPrefId pref_id_; 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ForgetGalleryCallback callback_; 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(MediaGalleryContextMenu); 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_ 42