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

Unified Diff: chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h

Issue 7051021: gtk: Split DownloadShelfContextMenuGtk out to its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asanka review Created 9 years, 7 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/ui/gtk/download/download_shelf_context_menu_gtk.h
diff --git a/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h b/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ec594227f848b5491eafbfd711516c5f245073a
--- /dev/null
+++ b/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 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_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
+#define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/download/download_shelf_context_menu.h"
+#include "chrome/browser/ui/gtk/menu_gtk.h"
+
+class BaseDownloadItemModel;
+class DownloadItemGtk;
+
+class DownloadShelfContextMenuGtk : public DownloadShelfContextMenu,
+ public MenuGtk::Delegate {
+ public:
+ DownloadShelfContextMenuGtk(BaseDownloadItemModel* model,
+ DownloadItemGtk* download_item);
+ virtual ~DownloadShelfContextMenuGtk();
+
+ void Popup(GtkWidget* widget, GdkEventButton* event);
+
+ private:
+ // MenuGtk::Delegate:
+ virtual void StoppedShowing() OVERRIDE;
+ virtual GtkWidget* GetImageForCommandId(int command_id) const OVERRIDE;
+
+ // The menu we show on Popup(). We keep a pointer to it for a couple reasons:
+ // * we don't want to have to recreate the menu every time it's popped up.
+ // * we have to keep it in scope for longer than the duration of Popup(), or
+ // completing the user-selected action races against the menu's
+ // destruction.
+ scoped_ptr<MenuGtk> menu_;
+
+ // The download item that created us.
+ DownloadItemGtk* download_item_gtk_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuGtk);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.cc ('k') | chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698