download_shelf_context_menu_view.h revision 7d4cd473f85ac64c3747c96c277f9e506a0d2246
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_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ 6#define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ 7 8#include "base/basictypes.h" 9#include "base/compiler_specific.h" 10#include "base/memory/scoped_ptr.h" 11#include "chrome/browser/download/download_shelf_context_menu.h" 12#include "ui/base/ui_base_types.h" 13 14namespace content { 15class DownloadItem; 16class PageNavigator; 17} 18 19namespace gfx { 20class Rect; 21} 22 23namespace views { 24class MenuRunner; 25class Widget; 26} 27 28class DownloadShelfContextMenuView : public DownloadShelfContextMenu { 29 public: 30 DownloadShelfContextMenuView(content::DownloadItem* download_item, 31 content::PageNavigator* navigator); 32 virtual ~DownloadShelfContextMenuView(); 33 34 // |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|. 36 void Run(views::Widget* parent_widget, 37 const gfx::Rect& rect, 38 ui::MenuSourceType source_type); 39 40 private: 41 scoped_ptr<views::MenuRunner> menu_runner_; 42 43 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuView); 44}; 45 46#endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ 47