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)#include "chrome/browser/media_galleries/media_gallery_context_menu.h" 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "grit/generated_resources.h" 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/base/l10n/l10n_util.h" 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/base/models/menu_model.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)MediaGalleryContextMenu::MediaGalleryContextMenu( 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const ForgetGalleryCallback& callback) 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) : ui::SimpleMenuModel(NULL), 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) callback_(callback) { 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) set_delegate(this); 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) AddItem(1, l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_DELETE)); 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)MediaGalleryContextMenu::~MediaGalleryContextMenu() {} 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool MediaGalleryContextMenu::IsCommandIdChecked(int command_id) const { 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool MediaGalleryContextMenu::IsCommandIdEnabled(int command_id) const { 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return true; 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool MediaGalleryContextMenu::IsCommandIdVisible(int command_id) const { 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return true; 305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool MediaGalleryContextMenu::GetAcceleratorForCommandId( 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int command_id, ui::Accelerator* accelerator) { 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)void MediaGalleryContextMenu::ExecuteCommand(int command_id, int event_flags) { 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) callback_.Run(pref_id_); 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 40