Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: chrome/browser/media_galleries/media_gallery_context_menu.cc

Issue 148093011: Abstract media galleries context menu code and use it in scan result dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Header too Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #include "chrome/browser/media_galleries/media_gallery_context_menu.h"
6 #include "grit/generated_resources.h"
7 #include "ui/base/l10n/l10n_util.h"
8 #include "ui/base/models/menu_model.h"
9
10 MediaGalleryContextMenu::MediaGalleryContextMenu(
11 const ForgetGalleryCallback& callback)
12 : ui::SimpleMenuModel(NULL),
13 callback_(callback) {
14 set_delegate(this);
15 AddItem(1, l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_DELETE));
16 }
17
18 MediaGalleryContextMenu::~MediaGalleryContextMenu() {}
19
20 bool MediaGalleryContextMenu::IsCommandIdChecked(int command_id) const {
21 return false;
22 }
23
24 bool MediaGalleryContextMenu::IsCommandIdEnabled(int command_id) const {
25 return true;
26 }
27
28 bool MediaGalleryContextMenu::IsCommandIdVisible(int command_id) const {
29 return true;
30 }
31
32 bool MediaGalleryContextMenu::GetAcceleratorForCommandId(
33 int command_id, ui::Accelerator* accelerator) {
34 return false;
35 }
36
37 void MediaGalleryContextMenu::ExecuteCommand(int command_id,
38 int event_flags) {
Lei Zhang 2014/01/29 00:26:24 nit: indentation
vandebo (ex-Chrome) 2014/01/29 17:16:55 Done.
39 callback_.Run(pref_id_);
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698