| Index: chrome/browser/ui/cocoa/dev_tools_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/dev_tools_controller.mm b/chrome/browser/ui/cocoa/dev_tools_controller.mm
|
| index 7c976860801f0d3643aa5358ef9e473389b6e9c4..d9e5b77594d457ab43c4bcf55c6cf7d8da152d6e 100644
|
| --- a/chrome/browser/ui/cocoa/dev_tools_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm
|
| @@ -8,7 +8,6 @@
|
|
|
| #include <Cocoa/Cocoa.h>
|
|
|
| -#import "base/mac/foundation_util.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -20,11 +19,9 @@
|
| using content::WebContents;
|
|
|
| @interface GraySplitView : NSSplitView {
|
| - CGFloat topContentOffset_;
|
| BOOL dividerHidden_;
|
| }
|
|
|
| -@property(assign, nonatomic) CGFloat topContentOffset;
|
| @property(assign, nonatomic) BOOL dividerHidden;
|
|
|
| - (NSColor*)dividerColor;
|
| @@ -35,7 +32,6 @@ using content::WebContents;
|
|
|
| @implementation GraySplitView
|
|
|
| -@synthesize topContentOffset = topContentOffset_;
|
| @synthesize dividerHidden = dividerHidden_;
|
|
|
| - (NSColor*)dividerColor {
|
| @@ -46,29 +42,12 @@ using content::WebContents;
|
| return dividerHidden_ ? 0 : [super dividerThickness];
|
| }
|
|
|
| -- (void)drawDividerInRect:(NSRect)aRect {
|
| - NSRect dividerRect = aRect;
|
| - if ([self isVertical]) {
|
| - dividerRect.size.height -= topContentOffset_;
|
| - dividerRect.origin.y += topContentOffset_;
|
| - }
|
| - [super drawDividerInRect:dividerRect];
|
| -}
|
| -
|
| -- (NSView*)hitTest:(NSPoint)point {
|
| - NSPoint viewPoint = [self convertPoint:point fromView:[self superview]];
|
| - if (viewPoint.y < topContentOffset_)
|
| - return nil;
|
| - return [super hitTest:point];
|
| -}
|
| -
|
| @end
|
|
|
| @interface DevToolsController (Private)
|
| - (void)showDevToolsContainer;
|
| - (void)hideDevToolsContainer;
|
| - (void)updateDevToolsSplitPosition;
|
| -- (void)updateDevToolsViewFrame;
|
| @end
|
|
|
|
|
| @@ -136,16 +115,6 @@ using content::WebContents;
|
| }
|
| }
|
|
|
| -- (CGFloat)topContentOffset {
|
| - return [splitView_ topContentOffset];
|
| -}
|
| -
|
| -- (void)setTopContentOffset:(CGFloat)offset {
|
| - [splitView_ setTopContentOffset:offset];
|
| - if ([[splitView_ subviews] count] > 1)
|
| - [self updateDevToolsViewFrame];
|
| -}
|
| -
|
| - (void)showDevToolsContainer {
|
| NSArray* subviews = [splitView_ subviews];
|
| DCHECK_EQ([subviews count], 1u);
|
| @@ -156,18 +125,11 @@ using content::WebContents;
|
| // VIEW_ID_DEV_TOOLS_DOCKED here.
|
| NSView* devToolsView = devToolsContents->GetView()->GetNativeView();
|
| view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED);
|
| - [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
| -
|
| - NSRect containerRect = NSMakeRect(0, 0, 100, 100);
|
| - base::scoped_nsobject<NSView> devToolsContainerView(
|
| - [[NSView alloc] initWithFrame:containerRect]);
|
| - [devToolsContainerView addSubview:devToolsView];
|
| - [splitView_ addSubview:devToolsContainerView];
|
| + [splitView_ addSubview:devToolsView];
|
|
|
| BOOL isVertical = devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT;
|
| [splitView_ setVertical:isVertical];
|
| [self updateDevToolsSplitPosition];
|
| - [self updateDevToolsViewFrame];
|
| }
|
|
|
| - (void)hideDevToolsContainer {
|
| @@ -215,15 +177,6 @@ using content::WebContents;
|
| [splitView_ adjustSubviews];
|
| }
|
|
|
| -- (void)updateDevToolsViewFrame {
|
| - NSView* devToolsView =
|
| - devToolsWindow_->web_contents()->GetView()->GetNativeView();
|
| - NSRect devToolsRect = [[devToolsView superview] bounds];
|
| - if (devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT)
|
| - devToolsRect.size.height -= [splitView_ topContentOffset];
|
| - [devToolsView setFrame:devToolsRect];
|
| -}
|
| -
|
| // NSSplitViewDelegate protocol.
|
| - (BOOL)splitView:(NSSplitView *)splitView
|
| shouldAdjustSizeOfSubview:(NSView *)subview {
|
| @@ -236,16 +189,6 @@ using content::WebContents;
|
| return YES;
|
| }
|
|
|
| -- (CGFloat)splitView:(NSSplitView*)splitView
|
| - constrainSplitPosition:(CGFloat)proposedPosition
|
| - ofSubviewAt:(NSInteger)dividerIndex {
|
| - if (![splitView_ isVertical] &&
|
| - proposedPosition < [splitView_ topContentOffset]) {
|
| - return [splitView_ topContentOffset];
|
| - }
|
| - return proposedPosition;
|
| -}
|
| -
|
| - (NSRect)splitView:(NSSplitView*)splitView
|
| effectiveRect:(NSRect)proposedEffectiveRect
|
| forDrawnRect:(NSRect)drawnRect
|
|
|