OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ | 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_ | 6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/download/download_shelf_context_menu.h" | 12 #include "chrome/browser/download/download_shelf_context_menu.h" |
13 #include "chrome/browser/ui/gtk/menu_gtk.h" | 13 #include "chrome/browser/ui/gtk/menu_gtk.h" |
14 | 14 |
15 class BaseDownloadItemModel; | 15 class BaseDownloadItemModel; |
16 class DownloadItemGtk; | 16 class DownloadItemGtk; |
17 | 17 |
18 class DownloadShelfContextMenuGtk : public DownloadShelfContextMenu, | 18 class DownloadShelfContextMenuGtk : public DownloadShelfContextMenu, |
19 public MenuGtk::Delegate { | 19 public MenuGtk::Delegate { |
20 public: | 20 public: |
21 DownloadShelfContextMenuGtk(BaseDownloadItemModel* model, | 21 DownloadShelfContextMenuGtk(BaseDownloadItemModel* model, |
22 DownloadItemGtk* download_item); | 22 DownloadItemGtk* download_item, |
| 23 content::PageNavigator* navigator); |
23 virtual ~DownloadShelfContextMenuGtk(); | 24 virtual ~DownloadShelfContextMenuGtk(); |
24 | 25 |
25 void Popup(GtkWidget* widget, GdkEventButton* event); | 26 void Popup(GtkWidget* widget, GdkEventButton* event); |
26 | 27 |
27 private: | 28 private: |
28 // MenuGtk::Delegate: | 29 // MenuGtk::Delegate: |
29 virtual void StoppedShowing() OVERRIDE; | 30 virtual void StoppedShowing() OVERRIDE; |
30 virtual GtkWidget* GetImageForCommandId(int command_id) const OVERRIDE; | 31 virtual GtkWidget* GetImageForCommandId(int command_id) const OVERRIDE; |
31 | 32 |
32 // The menu we show on Popup(). We keep a pointer to it for a couple reasons: | 33 // 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 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 // * 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 // completing the user-selected action races against the menu's |
36 // destruction. | 37 // destruction. |
37 scoped_ptr<MenuGtk> menu_; | 38 scoped_ptr<MenuGtk> menu_; |
38 | 39 |
39 // The download item that created us. | 40 // The download item that created us. |
40 DownloadItemGtk* download_item_gtk_; | 41 DownloadItemGtk* download_item_gtk_; |
41 | 42 |
42 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuGtk); | 43 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuGtk); |
43 }; | 44 }; |
44 | 45 |
45 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ | 46 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_ |
OLD | NEW |