Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.mm

Issue 2586993002: Upstream Chrome on iOS source code [3/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.mm b/ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.mm
new file mode 100644
index 0000000000000000000000000000000000000000..3aaa4ad404c7641b5a477529877aa8f341340bfa
--- /dev/null
+++ b/ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.mm
@@ -0,0 +1,55 @@
+// Copyright 2014 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 "ios/chrome/browser/ui/bookmarks/bars/bookmark_top_bar.h"
+
+#include "base/mac/objc_property_releaser.h"
+#include "base/mac/scoped_nsobject.h"
+
+@interface BookmarkTopBar () {
+ base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkBar;
+}
+@property(nonatomic, retain) UIView* contentView;
+@end
+
+@implementation BookmarkTopBar
+
+@synthesize contentView = _contentView;
+
++ (CGFloat)expectedContentViewHeight {
+ return 56.0;
+}
+
+- (instancetype)initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+ if (self) {
+ _propertyReleaser_BookmarkBar.Init(self, [BookmarkTopBar class]);
+
+ self.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin |
+ UIViewAutoresizingFlexibleWidth;
+
+ base::scoped_nsobject<UIView> contentView([[UIView alloc] init]);
+ self.contentView.backgroundColor = [UIColor clearColor];
+ [self addSubview:contentView];
+ self.contentView = contentView;
+
+ [self statelessLayoutContentView];
+ }
+ return self;
+}
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+
+ // The content view.
+ [self statelessLayoutContentView];
+}
+
+- (void)statelessLayoutContentView {
+ self.contentView.frame = CGRectMake(
+ 0,
+ CGRectGetHeight(self.bounds) - [[self class] expectedContentViewHeight],
+ CGRectGetWidth(self.bounds), [[self class] expectedContentViewHeight]);
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698