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_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/download/download_shelf_context_menu.h" | 11 #include "chrome/browser/download/download_shelf_context_menu.h" |
12 | 12 |
13 class DownloadItemModel; | |
14 | |
15 namespace content { | 13 namespace content { |
| 14 class DownloadItem; |
16 class PageNavigator; | 15 class PageNavigator; |
17 } | 16 } |
18 | 17 |
19 namespace gfx { | 18 namespace gfx { |
20 class Rect; | 19 class Rect; |
21 } | 20 } |
22 | 21 |
23 namespace views { | 22 namespace views { |
24 class MenuRunner; | 23 class MenuRunner; |
25 class Widget; | 24 class Widget; |
26 } | 25 } |
27 | 26 |
28 class DownloadShelfContextMenuView : public DownloadShelfContextMenu { | 27 class DownloadShelfContextMenuView : public DownloadShelfContextMenu { |
29 public: | 28 public: |
30 DownloadShelfContextMenuView(DownloadItemModel* model, | 29 DownloadShelfContextMenuView(content::DownloadItem* download_item, |
31 content::PageNavigator* navigator); | 30 content::PageNavigator* navigator); |
32 virtual ~DownloadShelfContextMenuView(); | 31 virtual ~DownloadShelfContextMenuView(); |
33 | 32 |
34 // |rect| is the bounding area for positioning the menu in screen coordinates. | 33 // |rect| is the bounding area for positioning the menu in screen coordinates. |
35 // The menu will be positioned above or below but not overlapping |rect|. | 34 // The menu will be positioned above or below but not overlapping |rect|. |
36 void Run(views::Widget* parent_widget, const gfx::Rect& rect); | 35 void Run(views::Widget* parent_widget, const gfx::Rect& rect); |
37 | 36 |
38 private: | 37 private: |
39 scoped_ptr<views::MenuRunner> menu_runner_; | 38 scoped_ptr<views::MenuRunner> menu_runner_; |
40 | 39 |
41 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuView); | 40 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuView); |
42 }; | 41 }; |
43 | 42 |
44 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ | 43 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ |
OLD | NEW |