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

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

Issue 2962018: Respect Spaces when dragging tabs on OS X (Closed)
Patch Set: Fix up comments Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_view.mm » ('j') | chrome/browser/cocoa/tab_view.mm » ('J')
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 #ifndef CHROME_BROWSER_COCOA_TAB_VIEW_H_ 5 #ifndef CHROME_BROWSER_COCOA_TAB_VIEW_H_
6 #define CHROME_BROWSER_COCOA_TAB_VIEW_H_ 6 #define CHROME_BROWSER_COCOA_TAB_VIEW_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <ApplicationServices/ApplicationServices.h>
10
11 #include <map>
9 12
10 #include "base/scoped_nsobject.h" 13 #include "base/scoped_nsobject.h"
11 #import "chrome/browser/cocoa/background_gradient_view.h" 14 #import "chrome/browser/cocoa/background_gradient_view.h"
12 #import "chrome/browser/cocoa/hover_close_button.h" 15 #import "chrome/browser/cocoa/hover_close_button.h"
13 16
14 namespace tabs { 17 namespace tabs {
15 18
16 // Nomenclature: 19 // Nomenclature:
17 // Tabs _glow_ under two different circumstances, when they are _hovered_ (by 20 // Tabs _glow_ under two different circumstances, when they are _hovered_ (by
18 // the mouse) and when they are _alerted_ (to show that the tab's title has 21 // the mouse) and when they are _alerted_ (to show that the tab's title has
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // TODO(alcor): these references may need to be strong to avoid crashes 77 // TODO(alcor): these references may need to be strong to avoid crashes
75 // due to JS closing windows 78 // due to JS closing windows
76 TabWindowController* sourceController_; // weak. controller starting the drag 79 TabWindowController* sourceController_; // weak. controller starting the drag
77 NSWindow* sourceWindow_; // weak. The window starting the drag 80 NSWindow* sourceWindow_; // weak. The window starting the drag
78 NSRect sourceWindowFrame_; 81 NSRect sourceWindowFrame_;
79 NSRect sourceTabFrame_; 82 NSRect sourceTabFrame_;
80 83
81 TabWindowController* draggedController_; // weak. Controller being dragged. 84 TabWindowController* draggedController_; // weak. Controller being dragged.
82 NSWindow* dragWindow_; // weak. The window being dragged 85 NSWindow* dragWindow_; // weak. The window being dragged
83 NSWindow* dragOverlay_; // weak. The overlay being dragged 86 NSWindow* dragOverlay_; // weak. The overlay being dragged
87 // Cache workspace IDs per-drag because computing them on 10.5 with
88 // CGWindowListCreateDescriptionFromArray is expensive.
89 // resetDragControllers clears this cache.
90 //
91 // TODO(davidben): When 10.5 becomes unsupported, remove this.
92 std::map<CGWindowID, int> workspaceIDCache_;
84 93
85 TabWindowController* targetController_; // weak. Controller being targeted 94 TabWindowController* targetController_; // weak. Controller being targeted
86 NSCellStateValue state_; 95 NSCellStateValue state_;
87 } 96 }
88 97
89 @property(assign, nonatomic) NSCellStateValue state; 98 @property(assign, nonatomic) NSCellStateValue state;
90 @property(assign, nonatomic) CGFloat hoverAlpha; 99 @property(assign, nonatomic) CGFloat hoverAlpha;
91 @property(assign, nonatomic) CGFloat alertAlpha; 100 @property(assign, nonatomic) CGFloat alertAlpha;
92 101
93 // Determines if the tab is in the process of animating closed. It may still 102 // Determines if the tab is in the process of animating closed. It may still
(...skipping 17 matching lines...) Expand all
111 120
112 // The TabController |controller_| is not the only owner of this view. If the 121 // The TabController |controller_| is not the only owner of this view. If the
113 // controller is released before this view, then we could be hanging onto a 122 // controller is released before this view, then we could be hanging onto a
114 // garbage pointer. To prevent this, the TabController uses this interface to 123 // garbage pointer. To prevent this, the TabController uses this interface to
115 // clear the |controller_| pointer when it is dying. 124 // clear the |controller_| pointer when it is dying.
116 @interface TabView (TabControllerInterface) 125 @interface TabView (TabControllerInterface)
117 - (void)setController:(TabController*)controller; 126 - (void)setController:(TabController*)controller;
118 @end 127 @end
119 128
120 #endif // CHROME_BROWSER_COCOA_TAB_VIEW_H_ 129 #endif // CHROME_BROWSER_COCOA_TAB_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_view.mm » ('j') | chrome/browser/cocoa/tab_view.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698