OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sidebar_controller.h" | 5 #import "chrome/browser/cocoa/sidebar_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include <Cocoa/Cocoa.h> | 9 #include <Cocoa/Cocoa.h> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 sidebarContents_ = NULL; | 46 sidebarContents_ = NULL; |
47 } | 47 } |
48 return self; | 48 return self; |
49 } | 49 } |
50 | 50 |
51 - (void)dealloc { | 51 - (void)dealloc { |
52 [splitView_ setDelegate:nil]; | 52 [splitView_ setDelegate:nil]; |
53 [super dealloc]; | 53 [super dealloc]; |
54 } | 54 } |
55 | 55 |
56 - (NSView*)view { | 56 - (NSSplitView*)view { |
57 return splitView_.get(); | 57 return splitView_.get(); |
58 } | 58 } |
59 | 59 |
60 - (NSSplitView*)splitView { | 60 - (NSSplitView*)splitView { |
61 return splitView_.get(); | 61 return splitView_.get(); |
62 } | 62 } |
63 | 63 |
64 - (void)updateSidebarForTabContents:(TabContents*)contents { | 64 - (void)updateSidebarForTabContents:(TabContents*)contents { |
65 // Get the active sidebar content. | 65 // Get the active sidebar content. |
66 if (SidebarManager::GetInstance() == NULL) // Happens in tests. | 66 if (SidebarManager::GetInstance() == NULL) // Happens in tests. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 - (BOOL)splitView:(NSSplitView *)splitView | 161 - (BOOL)splitView:(NSSplitView *)splitView |
162 shouldAdjustSizeOfSubview:(NSView *)subview { | 162 shouldAdjustSizeOfSubview:(NSView *)subview { |
163 // Return NO for the sidebar view to indicate that it should not be resized | 163 // Return NO for the sidebar view to indicate that it should not be resized |
164 // automatically. The sidebar keeps the width set by the user. | 164 // automatically. The sidebar keeps the width set by the user. |
165 if ([[splitView_ subviews] indexOfObject:subview] == 1) | 165 if ([[splitView_ subviews] indexOfObject:subview] == 1) |
166 return NO; | 166 return NO; |
167 return YES; | 167 return YES; |
168 } | 168 } |
169 | 169 |
170 @end | 170 @end |
OLD | NEW |