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

Side by Side Diff: ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.mm

Issue 2685823002: [ios clean] ToolsMenu UI changes (Closed)
Patch Set: Tools Menu UI Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/tools/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // ====== New Architecture ===== 5 // ====== New Architecture =====
6 // = This code is only used in the new iOS Chrome architecture. = 6 // = This code is only used in the new iOS Chrome architecture. =
7 // ============================================================================ 7 // ============================================================================
8 8
9 #import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h" 9 #import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 self.presentationFrame.size = menuSize; 43 self.presentationFrame.size = menuSize;
44 self.presentationFrame.origin = CGPointMake( 44 self.presentationFrame.origin = CGPointMake(
45 (self.containerView.bounds.size.width - menuSize.width) / 2.0, 45 (self.containerView.bounds.size.width - menuSize.width) / 2.0,
46 (self.containerView.bounds.size.height - menuSize.height) / 2.0); 46 (self.containerView.bounds.size.height - menuSize.height) / 2.0);
47 } 47 }
48 } 48 }
49 return self.presentationFrame; 49 return self.presentationFrame;
50 } 50 }
51 51
52 - (void)presentationTransitionWillBegin { 52 - (void)presentationTransitionWillBegin {
53 self.presentedView.layer.borderWidth = 1.0; 53 self.presentedView.layer.shadowRadius = 5.0f;
54 self.presentedView.layer.shadowRadius = 1.0; 54 [self.presentedView.layer setShadowOpacity:0.4f];
edchin 2017/02/11 00:00:25 nit: Make this line same as others. (dot vs. brack
sczs 2017/02/11 00:04:15 Done.
55 self.presentedView.layer.borderColor = [UIColor blackColor].CGColor; 55 self.presentedView.layer.shadowOffset = CGSizeMake(0, 0);
edchin 2017/02/11 00:00:25 nit: Other floats here use the form 0.0f.
sczs 2017/02/11 00:04:15 Done.
56 self.presentedView.layer.cornerRadius = 2.0f;
56 57
57 self.dismissRecognizer = 58 self.dismissRecognizer =
58 [[UITapGestureRecognizer alloc] initWithTarget:self 59 [[UITapGestureRecognizer alloc] initWithTarget:self
59 action:@selector(tapToDismiss:)]; 60 action:@selector(tapToDismiss:)];
60 [self.containerView addGestureRecognizer:self.dismissRecognizer]; 61 [self.containerView addGestureRecognizer:self.dismissRecognizer];
61 } 62 }
62 63
63 #pragma mark - Private methods. 64 #pragma mark - Private methods.
64 65
65 - (void)tapToDismiss:(UIGestureRecognizer*)recognizer { 66 - (void)tapToDismiss:(UIGestureRecognizer*)recognizer {
66 [self.toolbarCommandHandler closeToolsMenu]; 67 [self.toolbarCommandHandler closeToolsMenu];
67 } 68 }
68 69
69 // Checks if the presenting view controller conforms to 70 // Checks if the presenting view controller conforms to
70 // MenuPresentationDelegate and, if so, sets that view controller as the 71 // MenuPresentationDelegate and, if so, sets that view controller as the
71 // presentation delegate. This can't be done at init time, becuase the 72 // presentation delegate. This can't be done at init time, becuase the
72 // presenting view controller may not have been determined by UIKit yet. 73 // presenting view controller may not have been determined by UIKit yet.
73 - (void)updatePresentationDelegate { 74 - (void)updatePresentationDelegate {
74 if ([self.presentingViewController 75 if ([self.presentingViewController
75 conformsToProtocol:@protocol(MenuPresentationDelegate)]) { 76 conformsToProtocol:@protocol(MenuPresentationDelegate)]) {
76 self.presentationDelegate = static_cast<id<MenuPresentationDelegate>>( 77 self.presentationDelegate = static_cast<id<MenuPresentationDelegate>>(
77 self.presentingViewController); 78 self.presentingViewController);
78 } 79 }
79 } 80 }
80 81
81 @end 82 @end
OLDNEW
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/tools/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698