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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_controller.mm

Issue 1125423002: Dismiss context menu when download bar is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dismiss context menu using NSMenu API. Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" 5 #import "chrome/browser/ui/cocoa/download/download_item_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 364
365 - (IBAction)dismissMaliciousDownload:(id)sender { 365 - (IBAction)dismissMaliciousDownload:(id)sender {
366 // ExperienceSampling: User dismissed the dangerous download. 366 // ExperienceSampling: User dismissed the dangerous download.
367 [self updateExperienceSamplingEvent:ExperienceSamplingEvent::kDeny]; 367 [self updateExperienceSamplingEvent:ExperienceSamplingEvent::kDeny];
368 [self remove]; 368 [self remove];
369 // WARNING: we are deleted at this point. 369 // WARNING: we are deleted at this point.
370 } 370 }
371 371
372 - (IBAction)showContextMenu:(id)sender { 372 - (IBAction)showContextMenu:(id)sender {
373 base::scoped_nsobject<DownloadShelfContextMenuController> menuController( 373 [progressView_ showContextMenu];
374 [[DownloadShelfContextMenuController alloc]
375 initWithItemController:self
376 withDelegate:nil]);
377 [NSMenu popUpContextMenu:[menuController menu]
378 withEvent:[NSApp currentEvent]
379 forView:[self view]];
380 } 374 }
381 375
382 @end 376 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698