OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/download/download_shelf_context_menu.h" |
| 13 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 14 |
| 15 class BaseDownloadItemModel; |
| 16 class DownloadItemGtk; |
| 17 |
| 18 class DownloadShelfContextMenuGtk : public DownloadShelfContextMenu, |
| 19 public MenuGtk::Delegate { |
| 20 public: |
| 21 DownloadShelfContextMenuGtk(BaseDownloadItemModel* model, |
| 22 DownloadItemGtk* download_item); |
| 23 virtual ~DownloadShelfContextMenuGtk(); |
| 24 |
| 25 void Popup(GtkWidget* widget, GdkEventButton* event); |
| 26 |
| 27 private: |
| 28 // MenuGtk::Delegate: |
| 29 virtual void StoppedShowing() OVERRIDE; |
| 30 virtual GtkWidget* GetImageForCommandId(int command_id) const OVERRIDE; |
| 31 |
| 32 // The menu we show on Popup(). We keep a pointer to it for a couple reasons: |
| 33 // * we don't want to have to recreate the menu every time it's popped up. |
| 34 // * we have to keep it in scope for longer than the duration of Popup(), or |
| 35 // completing the user-selected action races against the menu's |
| 36 // destruction. |
| 37 scoped_ptr<MenuGtk> menu_; |
| 38 |
| 39 // The download item that created us. |
| 40 DownloadItemGtk* download_item_gtk_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuGtk); |
| 43 }; |
| 44 |
| 45 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ |
OLD | NEW |