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

Side by Side Diff: ios/chrome/browser/ui/contextual_search/contextual_search_mask_view.mm

Issue 2824493002: Reland of [ObjC ARC] Converts ios/chrome/browser/ui/contextual_search:contextual_search to ARC. (Closed)
Patch Set: fix test Created 3 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "ios/chrome/browser/ui/contextual_search/contextual_search_mask_view.h" 5 #include "ios/chrome/browser/ui/contextual_search/contextual_search_mask_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "ios/chrome/browser/ui/contextual_search/contextual_search_panel_view.h" 8 #import "ios/chrome/browser/ui/contextual_search/contextual_search_panel_view.h"
9 #import "ios/chrome/browser/ui/uikit_ui_util.h" 9 #import "ios/chrome/browser/ui/uikit_ui_util.h"
10 10
11 // Linearly map |delta| in the range [0, 1] to a value in [min, max]. 11 // Linearly map |delta| in the range [0, 1] to a value in [min, max].
12 #define LERP(min, max, delta) (min * (1 - delta) + max * delta) 12 #define LERP(min, max, delta) (min * (1 - delta) + max * delta)
13 13
14 #if !defined(__has_feature) || !__has_feature(objc_arc)
15 #error "This file requires ARC support."
16 #endif
17
14 namespace { 18 namespace {
15 const CGFloat kPhoneMaskLimit = 1.0; 19 const CGFloat kPhoneMaskLimit = 1.0;
16 const CGFloat kPadMaskLimit = 0.8; 20 const CGFloat kPadMaskLimit = 0.8;
17 } 21 }
18 22
19 @implementation ContextualSearchMaskView { 23 @implementation ContextualSearchMaskView {
20 CGFloat _maskLimit; 24 CGFloat _maskLimit;
21 } 25 }
22 26
23 - (instancetype)init { 27 - (instancetype)init {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 ratio = LERP(0, _maskLimit, ratio); 73 ratio = LERP(0, _maskLimit, ratio);
70 74
71 self.alpha = ratio * ratio; 75 self.alpha = ratio * ratio;
72 } 76 }
73 77
74 - (void)panelWillPromote:(ContextualSearchPanelView*)panel { 78 - (void)panelWillPromote:(ContextualSearchPanelView*)panel {
75 [panel removeMotionObserver:self]; 79 [panel removeMotionObserver:self];
76 } 80 }
77 81
78 @end 82 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698