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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_controller.h

Issue 7080064: [Mac] Refactor the logic of tab dragging out of TabView and into a new helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 #import "chrome/browser/ui/cocoa/hover_close_button.h" 10 #import "chrome/browser/ui/cocoa/hover_close_button.h"
11 #import "chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h"
11 #include "chrome/browser/ui/tabs/tab_menu_model.h" 12 #include "chrome/browser/ui/tabs/tab_menu_model.h"
12 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
13 14
14 // The loading/waiting state of the tab. 15 // The loading/waiting state of the tab.
15 enum TabLoadingState { 16 enum TabLoadingState {
16 kTabDone, 17 kTabDone,
17 kTabLoading, 18 kTabLoading,
18 kTabWaiting, 19 kTabWaiting,
19 kTabCrashed, 20 kTabCrashed,
20 }; 21 };
21 22
22 @class MenuController; 23 @class MenuController;
23 namespace TabControllerInternal { 24 namespace TabControllerInternal {
24 class MenuDelegate; 25 class MenuDelegate;
25 } 26 }
26 @class TabView; 27 @class TabView;
27 @protocol TabControllerTarget; 28 @protocol TabControllerTarget;
28 29
29 // A class that manages a single tab in the tab strip. Set its target/action 30 // A class that manages a single tab in the tab strip. Set its target/action
30 // to be sent a message when the tab is selected by the user clicking. Setting 31 // to be sent a message when the tab is selected by the user clicking. Setting
31 // the |loading| property to YES visually indicates that this tab is currently 32 // the |loading| property to YES visually indicates that this tab is currently
32 // loading content via a spinner. 33 // loading content via a spinner.
33 // 34 //
34 // The tab has the notion of an "icon view" which can be used to display 35 // The tab has the notion of an "icon view" which can be used to display
35 // identifying characteristics such as a favicon, or since it's a full-fledged 36 // identifying characteristics such as a favicon, or since it's a full-fledged
36 // view, something with state and animation such as a throbber for illustrating 37 // view, something with state and animation such as a throbber for illustrating
37 // progress. The default in the nib is an image view so nothing special is 38 // progress. The default in the nib is an image view so nothing special is
38 // required if that's all you need. 39 // required if that's all you need.
39 40
40 @interface TabController : NSViewController { 41 @interface TabController : NSViewController<TabDraggingEventTarget> {
41 @private 42 @private
42 IBOutlet NSView* iconView_; 43 IBOutlet NSView* iconView_;
43 IBOutlet NSTextField* titleView_; 44 IBOutlet NSTextField* titleView_;
44 IBOutlet HoverCloseButton* closeButton_; 45 IBOutlet HoverCloseButton* closeButton_;
45 46
46 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib 47 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib
47 BOOL isIconShowing_; // last state of iconView_ in updateVisibility 48 BOOL isIconShowing_; // last state of iconView_ in updateVisibility
48 49
49 BOOL app_; 50 BOOL app_;
50 BOOL mini_; 51 BOOL mini_;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 @end 115 @end
115 116
116 @interface TabController(TestingAPI) 117 @interface TabController(TestingAPI)
117 - (NSString*)toolTip; 118 - (NSString*)toolTip;
118 - (int)iconCapacity; 119 - (int)iconCapacity;
119 - (BOOL)shouldShowIcon; 120 - (BOOL)shouldShowIcon;
120 - (BOOL)shouldShowCloseButton; 121 - (BOOL)shouldShowCloseButton;
121 @end // TabController(TestingAPI) 122 @end // TabController(TestingAPI)
122 123
123 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ 124 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698