[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / download / download_shelf_context_menu_controller.mm
blobff6841f6e3b1bb41020a5b3e3311bb2c02b75f8a
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.
5 #import "chrome/browser/ui/cocoa/download/download_shelf_context_menu_controller.h"
7 #import "chrome/browser/ui/cocoa/download/download_item_controller.h"
9 @implementation DownloadShelfContextMenuController
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;
23 - (void)menuDidClose:(NSMenu*)menu {
24   [menuDelegate_ menuDidClose:menu];
25   [super menuDidClose:menu];
28 @end