OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/cocoa/dev_tools_controller.h" | 5 #import "chrome/browser/ui/cocoa/dev_tools_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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 [self hideDevToolsContainer]; | 122 [self hideDevToolsContainer]; |
123 | 123 |
124 devToolsWindow_ = newDevToolsWindow; | 124 devToolsWindow_ = newDevToolsWindow; |
125 | 125 |
126 if (devToolsWindow_) { | 126 if (devToolsWindow_) { |
127 dockSide_ = devToolsWindow_->dock_side(); | 127 dockSide_ = devToolsWindow_->dock_side(); |
128 [self showDevToolsContainer]; | 128 [self showDevToolsContainer]; |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
| 132 - (CGFloat)topContentOffset { |
| 133 return [splitView_ topContentOffset]; |
| 134 } |
| 135 |
132 - (void)setTopContentOffset:(CGFloat)offset { | 136 - (void)setTopContentOffset:(CGFloat)offset { |
133 [splitView_ setTopContentOffset:offset]; | 137 [splitView_ setTopContentOffset:offset]; |
134 if ([[splitView_ subviews] count] > 1) | 138 if ([[splitView_ subviews] count] > 1) |
135 [self updateDevToolsViewFrame]; | 139 [self updateDevToolsViewFrame]; |
136 } | 140 } |
137 | 141 |
138 - (void)showDevToolsContainer { | 142 - (void)showDevToolsContainer { |
139 NSArray* subviews = [splitView_ subviews]; | 143 NSArray* subviews = [splitView_ subviews]; |
140 DCHECK_EQ([subviews count], 1u); | 144 DCHECK_EQ([subviews count], 1u); |
141 WebContents* devToolsContents = devToolsWindow_->web_contents(); | 145 WebContents* devToolsContents = devToolsWindow_->web_contents(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return NSHeight([splitView_ frame]) - [splitView_ dividerThickness] - | 243 return NSHeight([splitView_ frame]) - [splitView_ dividerThickness] - |
240 devToolsWindow_->GetMinimumHeight(); | 244 devToolsWindow_->GetMinimumHeight(); |
241 } | 245 } |
242 } | 246 } |
243 | 247 |
244 -(void)splitViewWillResizeSubviews:(NSNotification *)notification { | 248 -(void)splitViewWillResizeSubviews:(NSNotification *)notification { |
245 [[splitView_ window] disableScreenUpdatesUntilFlush]; | 249 [[splitView_ window] disableScreenUpdatesUntilFlush]; |
246 } | 250 } |
247 | 251 |
248 @end | 252 @end |
OLD | NEW |