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

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

Issue 7056001: views: Split DownloadShelfContextMenuWin out to its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asanka review Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
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 #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h"
6
7 #include "base/i18n/rtl.h"
8 #include "base/logging.h"
9 #include "chrome/browser/download/download_item.h"
10 #include "chrome/browser/download/download_item_model.h"
11 #include "ui/gfx/point.h"
12 #include "views/controls/menu/menu_2.h"
13
14 DownloadShelfContextMenuView::DownloadShelfContextMenuView(
15 BaseDownloadItemModel* model)
16 : DownloadShelfContextMenu(model) {
17 DCHECK(model);
18 }
19
20 DownloadShelfContextMenuView::~DownloadShelfContextMenuView() {}
21
22 void DownloadShelfContextMenuView::Run(const gfx::Point& point) {
23 if (download_item()->IsComplete())
dmazzoni 2011/05/22 04:39:49 Just a thought, but I wonder why DownloadShelfCont
24 menu_.reset(new views::Menu2(GetFinishedMenuModel()));
25 else
26 menu_.reset(new views::Menu2(GetInProgressMenuModel()));
27
28 // The menu's alignment is determined based on the UI layout.
29 views::Menu2::Alignment alignment;
30 if (base::i18n::IsRTL())
31 alignment = views::Menu2::ALIGN_TOPRIGHT;
32 else
33 alignment = views::Menu2::ALIGN_TOPLEFT;
34 menu_->RunMenuAt(point, alignment);
35 }
36
37 void DownloadShelfContextMenuView::Stop() {
38 set_download_item(NULL);
39 }
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