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

Unified 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: nit Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/media_gallery_context_menu.h
diff --git a/chrome/browser/media_galleries/media_gallery_context_menu.h b/chrome/browser/media_galleries/media_gallery_context_menu.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf2caa343f44b798aa7d562258dbe69709b68697
--- /dev/null
+++ b/chrome/browser/media_galleries/media_gallery_context_menu.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_
+#define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "chrome/browser/media_galleries/media_galleries_preferences.h"
+#include "ui/base/models/simple_menu_model.h"
+
+class MediaGalleryContextMenu : public ui::SimpleMenuModel,
+ public ui::SimpleMenuModel::Delegate {
+ public:
+ typedef base::Callback<void(MediaGalleryPrefId pref_id)>
+ ForgetGalleryCallback;
+
+ explicit MediaGalleryContextMenu(const ForgetGalleryCallback& callback);
+ virtual ~MediaGalleryContextMenu();
+
+ void set_pref_id(MediaGalleryPrefId pref_id) {
+ pref_id_ = pref_id;
+ }
+
+ // ui::SimpleMenuModel::Delegate overrides:
+ virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdVisible(int command_id) const OVERRIDE;
+ virtual bool GetAcceleratorForCommandId(
+ int command_id, ui::Accelerator* accelerator) OVERRIDE;
+ virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+
+ private:
+ MediaGalleryPrefId pref_id_;
+ ForgetGalleryCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaGalleryContextMenu);
+};
+
+#endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERY_CONTEXT_MENU_H_

Powered by Google App Engine
This is Rietveld 408576698