• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2013 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#import "chrome/browser/ui/cocoa/download/download_shelf_context_menu_controller.h"
6
7#import "chrome/browser/ui/cocoa/download/download_item_controller.h"
8
9@implementation DownloadShelfContextMenuController
10
11- (id)initWithItemController:(DownloadItemController*)itemController
12                withDelegate:(id<NSMenuDelegate>)menuDelegate {
13  if ((self = [super initWithModel:[itemController contextMenuModel]
14                     useWithPopUpButtonCell:NO])) {
15    // Retain itemController since the lifetime of the ui::MenuModel is bound to
16    // the lifetime of itemController.
17    itemController_.reset([itemController retain]);
18    menuDelegate_ = menuDelegate;
19  }
20  return self;
21}
22
23- (void)menuDidClose:(NSMenu*)menu {
24  [menuDelegate_ menuDidClose:menu];
25  [super menuDidClose:menu];
26}
27
28@end
29