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

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

Issue 500030: Factor tab context menu into a shared model and fix mac and win to use it. Im... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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 #import "chrome/browser/cocoa/tab_view.h" 5 #import "chrome/browser/cocoa/tab_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/nsimage_cache_mac.h" 8 #include "base/nsimage_cache_mac.h"
9 #import "chrome/browser/cocoa/tab_controller.h" 9 #import "chrome/browser/cocoa/tab_controller.h"
10 #import "chrome/browser/cocoa/tab_window_controller.h" 10 #import "chrome/browser/cocoa/tab_window_controller.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 - (void)awakeFromNib { 47 - (void)awakeFromNib {
48 [self setShowsDivider:NO]; 48 [self setShowsDivider:NO];
49 } 49 }
50 50
51 - (void)dealloc { 51 - (void)dealloc {
52 // Cancel any delayed requests that may still be pending (drags or hover). 52 // Cancel any delayed requests that may still be pending (drags or hover).
53 [NSObject cancelPreviousPerformRequestsWithTarget:self]; 53 [NSObject cancelPreviousPerformRequestsWithTarget:self];
54 [super dealloc]; 54 [super dealloc];
55 } 55 }
56 56
57 // Use the TabController to provide the menu rather than obtaining it from the
58 // nib file.
59 - (NSMenu*)menu {
60 return [controller_ menu];
61 }
62
57 // Overridden so that mouse clicks come to this view (the parent of the 63 // Overridden so that mouse clicks come to this view (the parent of the
58 // hierarchy) first. We want to handle clicks and drags in this class and 64 // hierarchy) first. We want to handle clicks and drags in this class and
59 // leave the background button for display purposes only. 65 // leave the background button for display purposes only.
60 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { 66 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
61 return YES; 67 return YES;
62 } 68 }
63 69
64 - (void)adjustHoverValue { 70 - (void)adjustHoverValue {
65 NSTimeInterval thisUpdate = [NSDate timeIntervalSinceReferenceDate]; 71 NSTimeInterval thisUpdate = [NSDate timeIntervalSinceReferenceDate];
66 72
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 - (void)setClosing:(BOOL)closing { 771 - (void)setClosing:(BOOL)closing {
766 closing_ = closing; // Safe because the property is nonatomic. 772 closing_ = closing; // Safe because the property is nonatomic.
767 // When closing, ensure clicks to the close button go nowhere. 773 // When closing, ensure clicks to the close button go nowhere.
768 if (closing) { 774 if (closing) {
769 [closeButton_ setTarget:nil]; 775 [closeButton_ setTarget:nil];
770 [closeButton_ setAction:nil]; 776 [closeButton_ setAction:nil];
771 } 777 }
772 } 778 }
773 779
774 @end // @implementation TabView 780 @end // @implementation TabView
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698