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

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

Issue 43137: Add a TabController class to manage a TabView (with corresponding xib). Rewri... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/cocoa/tab_view.h"
6
7 @implementation TabView
8
9 - (id)initWithFrame:(NSRect)frame {
10 self = [super initWithFrame:frame];
11 if (self) {
12 // [self gtm_registerForThemeNotifications];
TVL 2009/03/12 15:56:42 ? - pending custom drawing?
13 }
14 return self;
15 }
16
17 - (void)dealloc {
18 // [self gtm_unregisterForThemeNotifications];
TVL 2009/03/12 15:56:42 ?
19 [super dealloc];
20 }
21
22 // Overridden so that mouse clicks come to this view (the parent of the
23 // hierarchy) first. We want to handle clicks and drags in this class and
24 // leave the background button for display purposes only.
25 - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent {
26 return YES;
27 }
28
29 // Determines which view a click in our frame actually hit. It's always this
30 // view, never a child.
31 // TODO(alcor): Figure out what to do with the close button. Are we using a
32 // NSButton for it, or drawing it ourselves with a cell?
33 - (NSView *)hitTest:(NSPoint)aPoint {
34 if (NSPointInRect(aPoint, [self frame])) return self;
35 return nil;
36 }
37
38 // Handle clicks and drags in this button. We get here because we have
39 // overridden acceptsFirstMouse: and the click is within our bounds.
40 - (void)mouseDown:(NSEvent *)theEvent {
41 // fire the action to select the tab
42 if ([[controller_ target] respondsToSelector:[controller_ action]])
43 [[controller_ target] performSelector:[controller_ action]
44 withObject:self];
45
46 // TODO(alcor): handle dragging...
47 }
48
49 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698