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

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

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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
11 #include "ui/base/models/simple_menu_model.h"
12
13 class MediaGalleryContextMenu : public ui::SimpleMenuModel,
14 public ui::SimpleMenuModel::Delegate {
15 public:
16 typedef base::Callback<void(MediaGalleryPrefId pref_id)>
17 ForgetGalleryCallback;
18
19 explicit MediaGalleryContextMenu(const ForgetGalleryCallback& callback);
20 virtual ~MediaGalleryContextMenu();
21
22 void set_pref_id(MediaGalleryPrefId pref_id) {
23 pref_id_ = pref_id;
24 }
25
26 // ui::SimpleMenuModel::Delegate overrides:
27 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
28 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
29 virtual bool IsCommandIdVisible(int command_id) const OVERRIDE;
30 virtual bool GetAcceleratorForCommandId(
31 int command_id, ui::Accelerator* accelerator) OVERRIDE;
32 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
33
34 private:
35 MediaGalleryPrefId pref_id_;
36 ForgetGalleryCallback callback_;
37
38 DISALLOW_COPY_AND_ASSIGN(MediaGalleryContextMenu);
39 };
40
41 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698