Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/ui/views/download/download_shelf_context_menu_view.cc

Issue 852043002: Initial Implementation of Download Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build & test errors on non-ChromeOS platform. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" 5 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/download/download_item_model.h" 9 #include "chrome/browser/download/download_item_model.h"
10 #include "content/public/browser/download_item.h" 10 #include "content/public/browser/download_item.h"
11 #include "content/public/browser/page_navigator.h" 11 #include "content/public/browser/page_navigator.h"
12 #include "ui/gfx/geometry/point.h" 12 #include "ui/gfx/geometry/point.h"
13 #include "ui/views/controls/menu/menu_runner.h" 13 #include "ui/views/controls/menu/menu_runner.h"
14 14
15 DownloadShelfContextMenuView::DownloadShelfContextMenuView( 15 DownloadShelfContextMenuView::DownloadShelfContextMenuView(
16 content::DownloadItem* download_item, 16 content::DownloadItem* download_item)
17 content::PageNavigator* navigator) 17 : DownloadShelfContextMenu(download_item) {
18 : DownloadShelfContextMenu(download_item, navigator) {
19 } 18 }
20 19
21 DownloadShelfContextMenuView::~DownloadShelfContextMenuView() {} 20 DownloadShelfContextMenuView::~DownloadShelfContextMenuView() {}
22 21
23 void DownloadShelfContextMenuView::Run(views::Widget* parent_widget, 22 void DownloadShelfContextMenuView::Run(views::Widget* parent_widget,
24 const gfx::Rect& rect, 23 const gfx::Rect& rect,
25 ui::MenuSourceType source_type) { 24 ui::MenuSourceType source_type) {
26 ui::MenuModel* menu_model = GetMenuModel(); 25 ui::MenuModel* menu_model = GetMenuModel();
27 // Run() should not be getting called if the DownloadItem was destroyed. 26 // Run() should not be getting called if the DownloadItem was destroyed.
28 DCHECK(menu_model); 27 DCHECK(menu_model);
(...skipping 13 matching lines...) Expand all
42 // while running the menu, which indicates that the containing view may have 41 // while running the menu, which indicates that the containing view may have
43 // been deleted. We ignore the return value because our caller already assumes 42 // been deleted. We ignore the return value because our caller already assumes
44 // that the view could be deleted by the time we return from here. 43 // that the view could be deleted by the time we return from here.
45 if (menu_runner_->RunMenuAt( 44 if (menu_runner_->RunMenuAt(
46 parent_widget, NULL, rect, position, source_type) == 45 parent_widget, NULL, rect, position, source_type) ==
47 views::MenuRunner::MENU_DELETED) { 46 views::MenuRunner::MENU_DELETED) {
48 return; 47 return;
49 } 48 }
50 close_time_ = base::TimeTicks::Now(); 49 close_time_ = base::TimeTicks::Now();
51 } 50 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_context_menu_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698