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

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

Issue 348047: [Mac] Do not pump nested tasks in -[NSApp sendEvent:]. (Closed)
Patch Set: More tweaking of that other person's comments. Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/chrome_application_mac.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) 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 "base/mac_util.h" 5 #include "base/mac_util.h"
6 #import "chrome/browser/cocoa/tab_controller.h" 6 #import "chrome/browser/cocoa/tab_controller.h"
7 #import "chrome/browser/cocoa/tab_controller_target.h" 7 #import "chrome/browser/cocoa/tab_controller_target.h"
8 #import "chrome/browser/cocoa/tab_view.h" 8 #import "chrome/browser/cocoa/tab_view.h"
9 #import "third_party/GTM/AppKit/GTMTheme.h" 9 #import "third_party/GTM/AppKit/GTMTheme.h"
10 10
(...skipping 29 matching lines...) Expand all
40 object:[self view]]; 40 object:[self view]];
41 [defaultCenter addObserver:self 41 [defaultCenter addObserver:self
42 selector:@selector(themeChangedNotification:) 42 selector:@selector(themeChangedNotification:)
43 name:kGTMThemeDidChangeNotification 43 name:kGTMThemeDidChangeNotification
44 object:nil]; 44 object:nil];
45 } 45 }
46 return self; 46 return self;
47 } 47 }
48 48
49 - (void)dealloc { 49 - (void)dealloc {
50 // Since the tab can be closed from JavaScript it is possible for
51 // |contextMenu_| to remain visible after the tab has closed, or for
52 // |closeButton_| to be tracking the mouse. Make sure neither sends
53 // us an action after -dealloc.
54 [closeButton_ setTarget:nil];
55 [contextMenu_ setAutoenablesItems:NO];
dmac 2009/11/02 22:29:05 does it make sense just to call [contextMenu_ canc
Scott Hess - ex-Googler 2009/11/02 22:35:15 I had variable success with -cancelTracking. I wa
56 for (NSMenuItem* item in [contextMenu_ itemArray]) {
57 [item setTarget:nil];
58 [item setEnabled:NO];
59 }
60
61 [[NSNotificationCenter defaultCenter] removeObserver:self]; 50 [[NSNotificationCenter defaultCenter] removeObserver:self];
62 [super dealloc]; 51 [super dealloc];
63 } 52 }
64 53
65 // The internals of |-setSelected:| but doesn't check if we're already set 54 // The internals of |-setSelected:| but doesn't check if we're already set
66 // to |selected|. Pass the selection change to the subviews that need it and 55 // to |selected|. Pass the selection change to the subviews that need it and
67 // mark ourselves as needing a redraw. 56 // mark ourselves as needing a redraw.
68 - (void)internalSetSelected:(BOOL)selected { 57 - (void)internalSetSelected:(BOOL)selected {
69 selected_ = selected; 58 selected_ = selected;
70 TabView* tabView = static_cast<TabView*>([self view]); 59 TabView* tabView = static_cast<TabView*>([self view]);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Called by the tabs to determine whether we are in rapid (tab) closure mode. 248 // Called by the tabs to determine whether we are in rapid (tab) closure mode.
260 - (BOOL)inRapidClosureMode { 249 - (BOOL)inRapidClosureMode {
261 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) { 250 if ([[self target] respondsToSelector:@selector(inRapidClosureMode)]) {
262 return [[self target] performSelector:@selector(inRapidClosureMode)] ? 251 return [[self target] performSelector:@selector(inRapidClosureMode)] ?
263 YES : NO; 252 YES : NO;
264 } 253 }
265 return NO; 254 return NO;
266 } 255 }
267 256
268 @end 257 @end
OLDNEW
« no previous file with comments | « chrome/browser/chrome_application_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698