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

Side by Side Diff: chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm

Issue 11906008: Make Mac menu code obey incognito availability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adjust comment Created 7 years, 11 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
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/history_menu_cocoa_controller.h" 5 #import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h"
6 6
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU 8 #include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU
9 #import "chrome/browser/app_controller_mac.h" 9 #import "chrome/browser/app_controller_mac.h"
10 #include "chrome/browser/history/history.h" 10 #include "chrome/browser/history/history.h"
(...skipping 16 matching lines...) Expand all
27 - (id)initWithBridge:(HistoryMenuBridge*)bridge { 27 - (id)initWithBridge:(HistoryMenuBridge*)bridge {
28 if ((self = [super init])) { 28 if ((self = [super init])) {
29 bridge_ = bridge; 29 bridge_ = bridge;
30 DCHECK(bridge_); 30 DCHECK(bridge_);
31 } 31 }
32 return self; 32 return self;
33 } 33 }
34 34
35 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { 35 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem {
36 AppController* controller = [NSApp delegate]; 36 AppController* controller = [NSApp delegate];
37 return [controller keyWindowIsNotModal]; 37 return ![controller keyWindowIsModal];
38 } 38 }
39 39
40 // Open the URL of the given history item in the current tab. 40 // Open the URL of the given history item in the current tab.
41 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)node { 41 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)node {
42 Browser* browser = 42 Browser* browser =
43 chrome::FindOrCreateTabbedBrowser(bridge_->profile(), 43 chrome::FindOrCreateTabbedBrowser(bridge_->profile(),
44 chrome::HOST_DESKTOP_TYPE_NATIVE); 44 chrome::HOST_DESKTOP_TYPE_NATIVE);
45 WindowOpenDisposition disposition = 45 WindowOpenDisposition disposition =
46 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); 46 event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
47 47
(...skipping 14 matching lines...) Expand all
62 } 62 }
63 } 63 }
64 64
65 - (IBAction)openHistoryMenuItem:(id)sender { 65 - (IBAction)openHistoryMenuItem:(id)sender {
66 const HistoryMenuBridge::HistoryItem* item = 66 const HistoryMenuBridge::HistoryItem* item =
67 bridge_->HistoryItemForMenuItem(sender); 67 bridge_->HistoryItemForMenuItem(sender);
68 [self openURLForItem:item]; 68 [self openURLForItem:item];
69 } 69 }
70 70
71 @end // HistoryMenuCocoaController 71 @end // HistoryMenuCocoaController
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698