| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 explicit DownloadShelfContextMenuView(content::DownloadItem* download_item); | 33 explicit DownloadShelfContextMenuView(content::DownloadItem* download_item); |
| 34 ~DownloadShelfContextMenuView() override; | 34 ~DownloadShelfContextMenuView() override; |
| 35 | 35 |
| 36 base::TimeTicks close_time() const { return close_time_; } | 36 base::TimeTicks close_time() const { return close_time_; } |
| 37 | 37 |
| 38 // |rect| is the bounding area for positioning the menu in screen coordinates. | 38 // |rect| is the bounding area for positioning the menu in screen coordinates. |
| 39 // The menu will be positioned above or below but not overlapping |rect|. | 39 // The menu will be positioned above or below but not overlapping |rect|. |
| 40 void Run(views::Widget* parent_widget, | 40 void Run(views::Widget* parent_widget, |
| 41 const gfx::Rect& rect, | 41 const gfx::Rect& rect, |
| 42 ui::MenuSourceType source_type); | 42 ui::MenuSourceType source_type, |
| 43 const base::Closure& on_menu_closed_callback); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 // Callback for MenuModelAdapter | 46 // Callback for MenuModelAdapter |
| 46 void OnMenuClosed(); | 47 void OnMenuClosed(const base::Closure& on_menu_closed_callback); |
| 47 | 48 |
| 48 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; | 49 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; |
| 49 std::unique_ptr<views::MenuRunner> menu_runner_; | 50 std::unique_ptr<views::MenuRunner> menu_runner_; |
| 50 | 51 |
| 51 // Time the menu was closed. | 52 // Time the menu was closed. |
| 52 base::TimeTicks close_time_; | 53 base::TimeTicks close_time_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuView); | 55 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuView); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ | 58 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_VIEW_H_ |
| OLD | NEW |