summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/disclosure_view_controller.h53
-rw-r--r--chrome/browser/cocoa/disclosure_view_controller.mm246
-rw-r--r--chrome/browser/cocoa/disclosure_view_controller_unittest.mm29
-rw-r--r--chrome/browser/cocoa/section_separator_view.h32
-rw-r--r--chrome/browser/cocoa/section_separator_view.mm106
-rw-r--r--chrome/browser/cocoa/section_separator_view_unittest.mm28
-rw-r--r--chrome/browser/cocoa/vertical_layout_view.h22
-rw-r--r--chrome/browser/cocoa/vertical_layout_view.mm73
-rw-r--r--chrome/browser/cocoa/vertical_layout_view_unittest.mm28
9 files changed, 0 insertions, 617 deletions
diff --git a/chrome/browser/cocoa/disclosure_view_controller.h b/chrome/browser/cocoa/disclosure_view_controller.h
deleted file mode 100644
index 312f9fd..0000000
--- a/chrome/browser/cocoa/disclosure_view_controller.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_
-#define CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_
-
-#import <Cocoa/Cocoa.h>
-#include "base/scoped_nsobject.h"
-
-@class DisclosureViewState;
-@class NSViewAnimation;
-
-// A view class that provides a disclosure triangle that controls the size
-// of the view. Toggling the disclosure triangle animates the change in
-// size of the view. The |openHeight| is initialized from the initial size
-// of the view. |disclosureState| is initialized as |NSOnState| (of type
-// NSCellStateValue) which corresponds to "open".
-@interface DisclosureViewController : NSViewController {
- @private
- // The |detailedView_| IBOutlet references the content that becomes visible
- // when the disclosure view is in the "open" state. We hold a reference
- // to the content so that we can hide and show it when disclosure state
- // changes.
- IBOutlet NSBox* detailedView_; // weak reference
-
- // The |disclosureState_| is instantiated from within |awakeFromNib|.
- // We do not hold it as a scoped_nsobject because it is exposed as a KVO
- // compliant property.
- DisclosureViewState* disclosureState_; // strong reference
-
- // Open height determines the height of the disclosed view. This value
- // is derived from the initial height specified in the nib.
- CGFloat openHeight_;
-
- // Value passed in to the designated initializer. Used to set up
- // initial view state when we |awakeFromNib|.
- NSCellStateValue initialDisclosureState_;
-
- // Animation object for view disclosure transitions.
- scoped_nsobject<NSViewAnimation> animation_;
-}
-
-@property (nonatomic, retain) DisclosureViewState* disclosureState;
-
-// Designated initializer. Sets the initial disclosure state.
-- (id)initWithNibName:(NSString *)nibNameOrNil
- bundle:(NSBundle *)nibBundleOrNil
- disclosure:(NSCellStateValue)disclosureState;
-
-@end
-
-#endif // CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_
diff --git a/chrome/browser/cocoa/disclosure_view_controller.mm b/chrome/browser/cocoa/disclosure_view_controller.mm
deleted file mode 100644
index 4e1b8f2..0000000
--- a/chrome/browser/cocoa/disclosure_view_controller.mm
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/cocoa/disclosure_view_controller.h"
-#include "base/logging.h"
-
-namespace {
-const NSInteger kClosedBoxHeight = 20;
-const CGFloat kDisclosureAnimationDurationSeconds = .2;
-NSString* const kKVODisclosedKey = @"disclosed";
-}
-
-// This class externalizes the state of the disclosure control. When the
-// disclosure control is pressed it changes the state of this object. In turn
-// the KVO machinery detects the change to |disclosed| and signals the
-// |observeValueForKeyPath| call in the |DisclosureViewController|.
-@interface DisclosureViewState : NSObject {
- @private
- NSCellStateValue disclosed_;
-}
-@property (nonatomic) NSCellStateValue disclosed;
-@end
-
-@implementation DisclosureViewState
-@synthesize disclosed = disclosed_;
-@end
-
-@interface DisclosureViewController(PrivateMethods)
-
-- (void)initFrameSize:(NSCellStateValue)state;
-- (NSRect)openStateFrameSize:(NSRect)startFrame;
-- (NSRect)closedStateFrameSize:(NSRect)startFrame;
-- (void)startAnimations:(NSView*)view
- start:(NSRect)startFrame
- end:(NSRect)endFrame;
-- (void)discloseDetails:(NSCellStateValue)state;
-- (void)setContentViewVisibility;
-- (void)observeValueForKeyPath:(NSString*)keyPath
- ofObject:(id)object
- change:(NSDictionary*)change
- context:(void*)context;
-
-@end
-
-@implementation DisclosureViewController
-
-@synthesize disclosureState = disclosureState_;
-
-- (void)awakeFromNib {
- // Create the disclosure state.
- [self setDisclosureState:[[[DisclosureViewState alloc] init] autorelease]];
-
- // Set up the initial disclosure state before we install the observer.
- // We don't want our animations firing before we're done initializing.
- [disclosureState_ setValue:[NSNumber numberWithInt:initialDisclosureState_]
- forKey:kKVODisclosedKey];
-
- // Pick up "open" height from the initial state of the view in the nib.
- openHeight_ = [[self view] frame].size.height;
-
- // Set frame size according to initial disclosure state.
- [self initFrameSize:initialDisclosureState_];
-
- // Set content visibility according to initial disclosure state.
- [self setContentViewVisibility];
-
- // Setup observers so that when disclosure state changes we resize frame
- // accordingly.
- [disclosureState_ addObserver:self forKeyPath:kKVODisclosedKey
- options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
- context:nil];
-}
-
-- (id)initWithNibName:(NSString *)nibNameOrNil
- bundle:(NSBundle *)nibBundleOrNil
- disclosure:(NSCellStateValue)disclosureState {
- if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
- initialDisclosureState_ = disclosureState;
- }
- return self;
-}
-
-- (void)dealloc {
- [disclosureState_ removeObserver:self forKeyPath:kKVODisclosedKey];
- [animation_ stopAnimation];
- [disclosureState_ release];
- [super dealloc];
-}
-
-@end
-
-@implementation DisclosureViewController(PrivateMethods)
-
-// Initializes the view's frame geometry based on the input |state|.
-// If the |state| is NSOnState then the frame size corresponds to "open".
-// If the |state| is NSOffState then the frame size corresponds to "closed".
-// The |origin.x| and |size.width| remain unchanged, but the |origin.y| and
-// |size.height| may vary.
-- (void)initFrameSize:(NSCellStateValue)state {
- if (state == NSOnState) {
- [[self view] setFrame:[self openStateFrameSize:[[self view] frame]]];
- }
- else if (state == NSOffState) {
- [[self view] setFrame:[self closedStateFrameSize:[[self view] frame]]];
- }
- else {
- NOTREACHED();
- }
-}
-
-// Computes the frame geometry during the "open" state of the disclosure view.
-- (NSRect)openStateFrameSize:(NSRect)startFrame {
- return NSMakeRect(startFrame.origin.x,
- startFrame.size.height - openHeight_ +
- startFrame.origin.y,
- startFrame.size.width,
- openHeight_);
-}
-
-// Computes the frame geometry during the "closed" state of the disclosure view.
-- (NSRect)closedStateFrameSize:(NSRect)startFrame {
- return NSMakeRect(startFrame.origin.x,
- startFrame.size.height - kClosedBoxHeight +
- startFrame.origin.y,
- startFrame.size.width,
- kClosedBoxHeight);
-}
-
-// Animates the opening or closing of the disclosure view. The |startFrame|
-// specifies the frame geometry at the beginning of the animation and the
-// |endFrame| specifies the geometry at the end of the animation. The input
-// |view| is view managed by this controller.
-- (void)startAnimations:(NSView*)view
- start:(NSRect)startFrame
- end:(NSRect)endFrame
-{
- // Setup dictionary describing animation.
- // Create the attributes dictionary for the first view.
- NSMutableDictionary* dictionary;
- dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
- // Specify which view to modify.
- view, NSViewAnimationTargetKey,
- // Specify the starting position of the view.
- [NSValue valueWithRect:startFrame], NSViewAnimationStartFrameKey,
- // Change the ending position of the view.
- [NSValue valueWithRect:endFrame], NSViewAnimationEndFrameKey,
- nil];
-
- // Stop any existing animation.
- [animation_ stopAnimation];
-
- // Create the view animation object.
- animation_.reset([[NSViewAnimation alloc] initWithViewAnimations:
- [NSArray arrayWithObject:dictionary]]);
-
- // Set some additional attributes for the animation.
- [animation_ setDuration:kDisclosureAnimationDurationSeconds];
- [animation_ setAnimationCurve:NSAnimationEaseIn];
-
- // Set self as delegate so we can toggle visibility at end of animation.
- [animation_ setDelegate:self];
-
- // Run the animation.
- [animation_ startAnimation];
-}
-
-// NSAnimationDelegate method. Before starting the animation we show the
-// |detailedView_|.
-- (BOOL)animationShouldStart:(NSAnimation*)animation {
- [detailedView_ setHidden:NO];
- return YES;
-}
-
-// NSAnimationDelegate method. If animation stops before ending we release
-// our animation object.
-- (void)animationDidStop:(NSAnimation*)animation {
- animation_.reset();
-}
-
-// NSAnimationDelegate method. Once the disclosure animation is over we set
-// content view visibility to match disclosure state.
-// |animation_| reference is relinquished at end of animation.
-- (void)animationDidEnd:(NSAnimation*)animation {
- [self setContentViewVisibility];
- animation_.reset();
-}
-
-// This method is invoked when the disclosure state changes. It computes
-// the appropriate view frame geometry and then initiates the animation to
-// change that geometry.
-- (void)discloseDetails:(NSCellStateValue)state {
- NSRect startFrame = [[self view] frame];
- NSRect endFrame = startFrame;
-
- if (state == NSOnState) {
- endFrame = [self openStateFrameSize:startFrame];
- } else if (state == NSOffState) {
- endFrame = [self closedStateFrameSize:startFrame];
- } else {
- NOTREACHED();
- return;
- }
-
- [self startAnimations:[self view] start:startFrame end:endFrame];
-}
-
-// Sets the "hidden" state of the content view according to the current
-// disclosure state. We do this so that the view hierarchy knows to remove
-// undisclosed content from the first responder chain.
-- (void)setContentViewVisibility {
- NSCellStateValue disclosed = [[disclosureState_ valueForKey:kKVODisclosedKey]
- intValue];
-
- if (disclosed == NSOnState) {
- [detailedView_ setHidden:NO];
- } else if (disclosed == NSOffState) {
- [detailedView_ setHidden:YES];
- } else {
- NOTREACHED();
- return;
- }
-}
-
-// The |DisclosureViewController| is an observer of an instance of a
-// |DisclosureViewState| object. This object lives within the controller's
-// nib file. When the KVO machinery detects a change to the state
-// it triggers this call and we initiate the change in frame geometry of the
-// view.
-- (void)observeValueForKeyPath:(NSString*)keyPath
- ofObject:(id)object
- change:(NSDictionary*)change
- context:(void*)context {
- if ([keyPath isEqualToString:kKVODisclosedKey]) {
- NSCellStateValue newValue =
- [[change objectForKey:NSKeyValueChangeNewKey] intValue];
- NSCellStateValue oldValue =
- [[change objectForKey:NSKeyValueChangeOldKey] intValue];
-
- if (newValue != oldValue) {
- [self discloseDetails:newValue];
- }
- }
-}
-
-@end
diff --git a/chrome/browser/cocoa/disclosure_view_controller_unittest.mm b/chrome/browser/cocoa/disclosure_view_controller_unittest.mm
deleted file mode 100644
index 0f0e2aa..0000000
--- a/chrome/browser/cocoa/disclosure_view_controller_unittest.mm
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/scoped_nsobject.h"
-#include "chrome/browser/cocoa/browser_test_helper.h"
-#import "chrome/browser/cocoa/cocoa_test_helper.h"
-#import "chrome/browser/cocoa/disclosure_view_controller.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-class DisclosureViewControllerTest : public CocoaTest {
- public:
- DisclosureViewControllerTest() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DisclosureViewControllerTest);
-};
-
-TEST_F(DisclosureViewControllerTest, Basic) {
- // A basic test that creates a new instance and releases.
- // Aids valgrind leak detection.
- scoped_nsobject<DisclosureViewController> controller(
- [[DisclosureViewController alloc]
- initWithNibName:@"" bundle:nil disclosure:NSOnState]);
- EXPECT_TRUE(controller.get());
-}
-
-}
diff --git a/chrome/browser/cocoa/section_separator_view.h b/chrome/browser/cocoa/section_separator_view.h
deleted file mode 100644
index 22a9412..0000000
--- a/chrome/browser/cocoa/section_separator_view.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_COCOA_SECTION_SEPARATOR_VIEW_
-#define CHROME_BROWSER_COCOA_SECTION_SEPARATOR_VIEW_
-
-#import <Cocoa/Cocoa.h>
-
-// A view class that renders a gradient "section" separator. The visual
-// style is modelled similarly to iPhone table view separators. This view
-// paints a simple top-to-bottom gradient in its bounds of fixed gray values.
-// Optionally, it also paints a "topline" and "baseline". Default is to
-// draw both topline and baseline, but these can be overridden.
-// The user of the class can override the color of the base line and top line
-// using the |baselineSeparatorColor| and |toplineSeparatorColor| properties.
-@interface SectionSeparatorView : NSView {
- @private
- BOOL showBaseLine_;
- NSColor* baselineSeparatorColor_;
- BOOL showTopLine_;
- NSColor* toplineSeparatorColor_;
-}
-
-@property (nonatomic, assign) BOOL showBaseLine;
-@property (nonatomic, retain) NSColor* baselineSeparatorColor;
-@property (nonatomic, assign) BOOL showTopLine;
-@property (nonatomic, retain) NSColor* toplineSeparatorColor;
-
-@end
-
-#endif // CHROME_BROWSER_COCOA_SECTION_SEPARATOR_VIEW_
diff --git a/chrome/browser/cocoa/section_separator_view.mm b/chrome/browser/cocoa/section_separator_view.mm
deleted file mode 100644
index a7968bc..0000000
--- a/chrome/browser/cocoa/section_separator_view.mm
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/cocoa/section_separator_view.h"
-
-@interface SectionSeparatorView (PrivateMethods)
-- (void)drawGradientRect:(NSRect)rect;
-- (void)drawBaseLineRect:(NSRect)rect;
-- (void)drawTopLineRect:(NSRect)rect;
-@end
-
-@implementation SectionSeparatorView
-
-@synthesize showBaseLine = showBaseLine_;
-@synthesize baselineSeparatorColor = baselineSeparatorColor_;
-@synthesize showTopLine = showTopLine_;
-@synthesize toplineSeparatorColor = toplineSeparatorColor_;
-
-- (id)initWithFrame:(NSRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- [self setShowBaseLine:YES];
- [self setBaselineSeparatorColor:[NSColor grayColor]];
- [self setShowTopLine:YES];
- [self setToplineSeparatorColor:[NSColor lightGrayColor]];
- }
- return self;
-}
-
-- (void)dealloc {
- [baselineSeparatorColor_ release];
- [toplineSeparatorColor_ release];
- [super dealloc];
-}
-
-- (void)drawRect:(NSRect)rect {
- NSRect gradientBounds = [self bounds];
- NSRect baselineRect = gradientBounds;
- NSRect toplineRect = gradientBounds;
- gradientBounds.size.height -= 1;
- gradientBounds.origin.y += 1;
- baselineRect.size.height = 1;
- baselineRect.origin.y = 0;
- toplineRect.size.height = 1;
- toplineRect.origin.y = gradientBounds.size.height;
- [self drawGradientRect:gradientBounds];
- if ([self showBaseLine])
- [self drawBaseLineRect:baselineRect];
- if ([self showTopLine])
- [self drawTopLineRect:toplineRect];
-}
-
-@end
-
-@implementation SectionSeparatorView (PrivateMethods)
-
-// This method draws the gradient fill of the "separator" bar. The input
-// |rect| designates the bounds that will be filled with the the gradient.
-// The gradient has two stops, lighter gray blending to
-// darker gray, descending from the top of the |rect| to the bottom.
-- (void)drawGradientRect:(NSRect)rect {
- // Compute start and end points where to draw the gradient.
- CGPoint startPoint = CGPointMake(NSMinX(rect), NSMinY(rect));
- CGPoint endPoint = CGPointMake(NSMinX(rect), NSMaxY(rect));
-
- // Setup the context and colorspace.
- CGContextRef context =
- (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- CGContextSaveGState(context);
- CGColorSpaceRef colorspace =
- CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
-
- // Create the gradient.
- const size_t stopCount = 2;
- CGFloat stops[stopCount] = { 0.0, 1.0 };
- CGFloat components[8] = {
- 0.75, 0.75, 0.75, 1.0, // start color
- 0.95, 0.95, 0.95, 1.0 }; // end color
-
- CGGradientRef gradient = CGGradientCreateWithColorComponents(
- colorspace, components, stops, stopCount);
-
- CGContextClipToRect(context, *(CGRect*)&rect);
- CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0);
-
- CGGradientRelease(gradient);
- CGColorSpaceRelease(colorspace);
- CGContextRestoreGState(context);
-}
-
-// Draws the base line of the separator bar using the |baselineSeparatorColor_|
-// designated color.
-- (void)drawBaseLineRect:(NSRect)rect {
- [baselineSeparatorColor_ set];
- NSFrameRect(rect);
-}
-
-// Draws the top line of the separator bar using the |toplineSeparatorColor_|
-// designated color.
-- (void)drawTopLineRect:(NSRect)rect {
- [toplineSeparatorColor_ set];
- NSFrameRect(rect);
-}
-
-@end
diff --git a/chrome/browser/cocoa/section_separator_view_unittest.mm b/chrome/browser/cocoa/section_separator_view_unittest.mm
deleted file mode 100644
index f51d660..0000000
--- a/chrome/browser/cocoa/section_separator_view_unittest.mm
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/scoped_nsobject.h"
-#include "chrome/browser/cocoa/browser_test_helper.h"
-#import "chrome/browser/cocoa/cocoa_test_helper.h"
-#import "chrome/browser/cocoa/section_separator_view.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-class SectionSeparatorViewTest : public CocoaTest {
- public:
- SectionSeparatorViewTest() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SectionSeparatorViewTest);
-};
-
-TEST_F(SectionSeparatorViewTest, Basic) {
- // A basic test that creates a new instance and releases.
- // Aids valgrind leak detection.
- scoped_nsobject<SectionSeparatorView> view([[SectionSeparatorView alloc]
- initWithFrame:NSMakeRect(0, 0, 10, 10)]);
- EXPECT_TRUE(view.get());
-}
-
-}
diff --git a/chrome/browser/cocoa/vertical_layout_view.h b/chrome/browser/cocoa/vertical_layout_view.h
deleted file mode 100644
index 56e9954..0000000
--- a/chrome/browser/cocoa/vertical_layout_view.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_COCOA_VERTICAL_LAYOUT_VIEW_
-#define CHROME_BROWSER_COCOA_VERTICAL_LAYOUT_VIEW_
-
-#import <Cocoa/Cocoa.h>
-
-// A view class that automatically performs layout of child views based
-// on paint order of the children in the view hierarchy. The children are
-// arranged top-to-bottom (in y-order) based on each child's height.
-// Horizontal (x) positions are left as specified. Layout is performed when
-// children are added, removed, or have their frames changed. Layout is also
-// performed when this view (|self|) has its frame changed.
-// Autoresizing is disabled for |VerticalLayoutView|s.
-@interface VerticalLayoutView : NSView {
-}
-
-@end
-
-#endif // CHROME_BROWSER_COCOA_VERTICAL_LAYOUT_VIEW_
diff --git a/chrome/browser/cocoa/vertical_layout_view.mm b/chrome/browser/cocoa/vertical_layout_view.mm
deleted file mode 100644
index f2070db..0000000
--- a/chrome/browser/cocoa/vertical_layout_view.mm
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/cocoa/vertical_layout_view.h"
-
-@interface VerticalLayoutView(PrivateMethods)
-- (void)layoutChildren;
-@end
-
-@implementation VerticalLayoutView
-
-- (id)initWithFrame:(NSRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- // Turn auto resizing off, we'll be laying out our children programatically.
- [self setAutoresizesSubviews:NO];
- [self setAutoresizingMask:NSViewNotSizable];
- }
-
- return self;
-}
-
-// Flip the coordinate system to arrange child views from top to bottom
-// with top at 0, increasing down. This simplifies the logic and plays
-// well with containing scroll views.
-- (BOOL)isFlipped {
- return YES;
-}
-
-// Override the default |viewWillDraw| to indicate to drawing machinery proper
-// arrangement of subviews.
-- (void)viewWillDraw {
- // Reposition child views prior to super's descent into its |viewWillDraw|
- // pass.
- [self layoutChildren];
-
- // Default descent into subviews.
- [super viewWillDraw];
-
- // Adjust children again to account for any modifications made during the
- // prior descent. Most importantly we resize our own frame to properly
- // adjust any containing scroll view.
- [self layoutChildren];
-}
-
-@end
-
-@implementation VerticalLayoutView(PrivateMethods)
-
-// This method traverses the immediate subviews measuring their height and
-// adjusting their frames so they are arranged vertically ordered relative
-// to their sibling views. Note the dependency here on the |isFlipped|
-// state. This code assumes |isFlipped| is YES.
-- (void)layoutChildren {
- NSArray* children = [self subviews];
- int childCount = [children count];
-
- CGFloat yPosition = 0.0;
- for (int i = childCount-1; i >= 0; --i) {
- NSView* child = [children objectAtIndex:i];
- [child setFrameOrigin:NSMakePoint([child frame].origin.x, yPosition)];
- yPosition += [child frame].size.height;
- }
-
- // Resize self to reflect vertical extent of children.
- [self setFrame:NSMakeRect([self frame].origin.x,
- [self frame].origin.y,
- [self frame].size.width,
- yPosition)];
-}
-
-@end
diff --git a/chrome/browser/cocoa/vertical_layout_view_unittest.mm b/chrome/browser/cocoa/vertical_layout_view_unittest.mm
deleted file mode 100644
index 90730df..0000000
--- a/chrome/browser/cocoa/vertical_layout_view_unittest.mm
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/scoped_nsobject.h"
-#include "chrome/browser/cocoa/browser_test_helper.h"
-#import "chrome/browser/cocoa/cocoa_test_helper.h"
-#import "chrome/browser/cocoa/vertical_layout_view.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-class VerticalLayoutViewTest : public CocoaTest {
- public:
- VerticalLayoutViewTest() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VerticalLayoutViewTest);
-};
-
-TEST_F(VerticalLayoutViewTest, Basic) {
- // A basic test that creates a new instance and releases.
- // Aids valgrind leak detection.
- scoped_nsobject<VerticalLayoutView> view([[VerticalLayoutView alloc]
- initWithFrame:NSMakeRect(0, 0, 10, 10)]);
- EXPECT_TRUE(view.get());
-}
-
-}