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/app_controller_mac.mm

Issue 196101: Revert 26016 - valgrind leak -... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « no previous file | chrome/browser/app_controller_mac_unittest.mm » ('j') | 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) 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 #import "chrome/browser/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac_util.h" 9 #include "base/mac_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 30 matching lines...) Expand all
41 - (void)initMenuState; 41 - (void)initMenuState;
42 - (void)openURLs:(const std::vector<GURL>&)urls; 42 - (void)openURLs:(const std::vector<GURL>&)urls;
43 - (void)openPendingURLs; 43 - (void)openPendingURLs;
44 - (void)getUrl:(NSAppleEventDescriptor*)event 44 - (void)getUrl:(NSAppleEventDescriptor*)event
45 withReply:(NSAppleEventDescriptor*)reply; 45 withReply:(NSAppleEventDescriptor*)reply;
46 - (void)openFiles:(NSAppleEventDescriptor*)event 46 - (void)openFiles:(NSAppleEventDescriptor*)event
47 withReply:(NSAppleEventDescriptor*)reply; 47 withReply:(NSAppleEventDescriptor*)reply;
48 - (void)windowLayeringDidChange:(NSNotification*)inNotification; 48 - (void)windowLayeringDidChange:(NSNotification*)inNotification;
49 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount; 49 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount;
50 - (BOOL)shouldQuitWithInProgressDownloads; 50 - (BOOL)shouldQuitWithInProgressDownloads;
51 - (NSMenu*)applicationDockMenu:(NSApplication*)sender;
52 @end 51 @end
53 52
54 @implementation AppController 53 @implementation AppController
55 54
56 // This method is called very early in application startup (ie, before 55 // This method is called very early in application startup (ie, before
57 // the profile is loaded or any preferences have been registered). Defer any 56 // the profile is loaded or any preferences have been registered). Defer any
58 // user-data initialization until -applicationDidFinishLaunching:. 57 // user-data initialization until -applicationDidFinishLaunching:.
59 - (void)awakeFromNib { 58 - (void)awakeFromNib {
60 pendingURLs_.reset(new std::vector<GURL>()); 59 pendingURLs_.reset(new std::vector<GURL>());
61 60
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 addObserver:self 659 addObserver:self
661 selector:@selector(aboutWindowClosed:) 660 selector:@selector(aboutWindowClosed:)
662 name:kUserClosedAboutNotification 661 name:kUserClosedAboutNotification
663 object:aboutController_.get()]; 662 object:aboutController_.get()];
664 } 663 }
665 if (![[aboutController_ window] isVisible]) 664 if (![[aboutController_ window] isVisible])
666 [[aboutController_ window] center]; 665 [[aboutController_ window] center];
667 [aboutController_ showWindow:self]; 666 [aboutController_ showWindow:self];
668 } 667 }
669 668
670 - (NSMenu*)applicationDockMenu:(id)sender {
671 NSMenu* result = [[[NSMenu alloc] initWithTitle: @""] autorelease];
672 NSString* titleStr;
673 id item;
674
675 titleStr = base::SysWideToNSString(
676 l10n_util::GetString(IDS_NEW_WINDOW_MAC));
677 item = [[[NSMenuItem alloc] initWithTitle:titleStr
678 action:@selector(commandDispatch:)
679 keyEquivalent:@""] autorelease];
680 [item setTarget:self];
681 [item setTag:IDC_NEW_WINDOW];
682 [result addItem:item];
683
684 titleStr = base::SysWideToNSString(
685 l10n_util::GetString(IDS_NEW_INCOGNITO_WINDOW_MAC));
686 item = [[[NSMenuItem alloc] initWithTitle:titleStr
687 action:@selector(commandDispatch:)
688 keyEquivalent:@""] autorelease];
689 [item setTarget:self];
690 [item setTag:IDC_NEW_INCOGNITO_WINDOW];
691 [result addItem:item];
692
693 return result;
694 }
695
696 @end 669 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698