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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 WebContents* devToolsContents = devToolsWindow_->web_contents(); | 152 WebContents* devToolsContents = devToolsWindow_->web_contents(); |
153 | 153 |
154 // |devToolsView| is a TabContentsViewCocoa object, whose ViewID was | 154 // |devToolsView| is a TabContentsViewCocoa object, whose ViewID was |
155 // set to VIEW_ID_TAB_CONTAINER initially, so we need to change it to | 155 // set to VIEW_ID_TAB_CONTAINER initially, so we need to change it to |
156 // VIEW_ID_DEV_TOOLS_DOCKED here. | 156 // VIEW_ID_DEV_TOOLS_DOCKED here. |
157 NSView* devToolsView = devToolsContents->GetView()->GetNativeView(); | 157 NSView* devToolsView = devToolsContents->GetView()->GetNativeView(); |
158 view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED); | 158 view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED); |
159 [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; | 159 [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; |
160 | 160 |
161 NSRect containerRect = NSMakeRect(0, 0, 100, 100); | 161 NSRect containerRect = NSMakeRect(0, 0, 100, 100); |
162 scoped_nsobject<NSView> devToolsContainerView( | 162 base::scoped_nsobject<NSView> devToolsContainerView( |
163 [[NSView alloc] initWithFrame:containerRect]); | 163 [[NSView alloc] initWithFrame:containerRect]); |
164 [devToolsContainerView addSubview:devToolsView]; | 164 [devToolsContainerView addSubview:devToolsView]; |
165 [splitView_ addSubview:devToolsContainerView]; | 165 [splitView_ addSubview:devToolsContainerView]; |
166 | 166 |
167 BOOL isVertical = devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT; | 167 BOOL isVertical = devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT; |
168 [splitView_ setVertical:isVertical]; | 168 [splitView_ setVertical:isVertical]; |
169 [self updateDevToolsSplitPosition]; | 169 [self updateDevToolsSplitPosition]; |
170 [self updateDevToolsViewFrame]; | 170 [self updateDevToolsViewFrame]; |
171 } | 171 } |
172 | 172 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return NSHeight([splitView_ frame]) - [splitView_ dividerThickness] - | 267 return NSHeight([splitView_ frame]) - [splitView_ dividerThickness] - |
268 devToolsWindow_->GetMinimumHeight(); | 268 devToolsWindow_->GetMinimumHeight(); |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 -(void)splitViewWillResizeSubviews:(NSNotification *)notification { | 272 -(void)splitViewWillResizeSubviews:(NSNotification *)notification { |
273 [[splitView_ window] disableScreenUpdatesUntilFlush]; | 273 [[splitView_ window] disableScreenUpdatesUntilFlush]; |
274 } | 274 } |
275 | 275 |
276 @end | 276 @end |
OLD | NEW |