OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_elevated_toolbar.h" |
| 6 |
| 7 #include "base/mac/objc_property_releaser.h" |
| 8 #import "ios/third_party/material_components_ios/src/components/ShadowElevations
/src/MaterialShadowElevations.h" |
| 9 #import "ios/third_party/material_components_ios/src/components/ShadowLayer/src/
MaterialShadowLayer.h" |
| 10 |
| 11 @implementation BookmarksElevatedToolbar { |
| 12 base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarksElevatedToolbar; |
| 13 } |
| 14 |
| 15 @synthesize shadowLayer = _shadowLayer; |
| 16 |
| 17 #pragma mark - Lifecycle |
| 18 |
| 19 - (instancetype)init { |
| 20 self = [super init]; |
| 21 if (self) { |
| 22 _propertyReleaser_BookmarksElevatedToolbar.Init( |
| 23 self, [BookmarksElevatedToolbar class]); |
| 24 } |
| 25 return self; |
| 26 } |
| 27 |
| 28 #pragma mark - Properties |
| 29 |
| 30 - (MDCShadowLayer*)shadowLayer { |
| 31 if (!_shadowLayer) { |
| 32 _shadowLayer = [[MDCShadowLayer alloc] init]; |
| 33 _shadowLayer.elevation = MDCShadowElevationNone; |
| 34 [self.layer addSublayer:self.shadowLayer]; |
| 35 } |
| 36 return _shadowLayer; |
| 37 } |
| 38 |
| 39 - (void)setShadowElevation:(CGFloat)shadowElevation { |
| 40 self.shadowLayer.elevation = shadowElevation; |
| 41 } |
| 42 |
| 43 - (CGFloat)shadowElevation { |
| 44 return self.shadowLayer.elevation; |
| 45 } |
| 46 |
| 47 #pragma mark - UIView |
| 48 |
| 49 - (void)layoutSubviews { |
| 50 [super layoutSubviews]; |
| 51 self.shadowLayer.frame = self.layer.bounds; |
| 52 } |
| 53 |
| 54 @end |
OLD | NEW |