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

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

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 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
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/app/chrome_dll_resource.h" // IDC_HISTORY_MENU 5 #include "chrome/app/chrome_dll_resource.h" // IDC_*
6 #include "chrome/browser/browser.h" 6 #include "chrome/browser/browser.h"
7 #import "chrome/browser/cocoa/history_menu_cocoa_controller.h" 7 #import "chrome/browser/cocoa/history_menu_cocoa_controller.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/cocoa/event_utils.h" 10 #include "chrome/browser/cocoa/event_utils.h"
11 #include "chrome/browser/history/history.h" 11 #include "chrome/browser/history/history.h"
12 #include "chrome/browser/history/history_types.h" 12 #include "chrome/browser/history/history_types.h"
13 #include "chrome/browser/tab_contents/tab_contents.h" 13 #include "chrome/browser/tab_contents/tab_contents.h"
14 #include "webkit/glue/window_open_disposition.h" 14 #include "webkit/glue/window_open_disposition.h"
15 15
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return (*results)[index]; 52 return (*results)[index];
53 } 53 }
54 54
55 - (IBAction)openHistoryMenuItem:(id)sender { 55 - (IBAction)openHistoryMenuItem:(id)sender {
56 NSInteger tag = [sender tag]; 56 NSInteger tag = [sender tag];
57 HistoryMenuBridge::HistoryItem item = [self itemForTag:tag]; 57 HistoryMenuBridge::HistoryItem item = [self itemForTag:tag];
58 DCHECK(item.url.is_valid()); 58 DCHECK(item.url.is_valid());
59 [self openURLForItem:item]; 59 [self openURLForItem:item];
60 } 60 }
61 61
62 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
63 if (Browser* browser = BrowserList::GetLastActive()) {
64 return browser->command_updater()->IsCommandEnabled(
65 IDC_HISTORY_MENU_CONTENTS) ? YES : NO;
66 }
67 // Enable history items when there's no browser window.
68 return YES;
69 }
70
62 @end // HistoryMenuCocoaController 71 @end // HistoryMenuCocoaController
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/download_request_dialog_delegate_mac.mm ('k') | chrome/browser/cocoa/shell_dialogs_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698