Commit 42dd78c5 authored by sczs's avatar sczs Committed by Commit bot

Revert of [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC....

Revert of [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. (patchset #3 id:40001 of https://codereview.chromium.org/2808873002/ )

Reason for revert:
Reverting since ios_chrome_smoke_egtests its failing and it broke the autoroller.

https://uberchromegw.corp.google.com/i/internal.bling.main/builders/chromium-autoroller/builds/373/steps/ios_chrome_smoke_egtests%20%28iPhone%205s%20iOS%2010.0%29/logs/stdio

Original issue's description:
> [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC.
>
> Automatically generated ARCMigrate commit
> Notable issues:None
> BUG=624363
> TEST=None
>
> Review-Url: https://codereview.chromium.org/2808873002
> Cr-Commit-Position: refs/heads/master@{#467947}
> Committed: https://chromium.googlesource.com/chromium/src/+/8b6e180812e904c59ff0d72a3b2d4d8df7d7f37b

TBR=stkhapugin@chromium.org,sdefresne@chromium.org,gambard@chromium.org,olivierrobin@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=624363

Review-Url: https://codereview.chromium.org/2852713002
Cr-Commit-Position: refs/heads/master@{#467981}
parent 394a4f2f
...@@ -38,7 +38,6 @@ bundle_data("resources") { ...@@ -38,7 +38,6 @@ bundle_data("resources") {
} }
source_set("toolbar") { source_set("toolbar") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [ sources = [
"new_tab_button.h", "new_tab_button.h",
"new_tab_button.mm", "new_tab_button.mm",
...@@ -91,7 +90,6 @@ source_set("toolbar") { ...@@ -91,7 +90,6 @@ source_set("toolbar") {
"//ios/chrome/browser/ui/fancy_ui", "//ios/chrome/browser/ui/fancy_ui",
"//ios/chrome/browser/ui/history", "//ios/chrome/browser/ui/history",
"//ios/chrome/browser/ui/keyboard", "//ios/chrome/browser/ui/keyboard",
"//ios/chrome/browser/ui/popup_menu",
"//ios/chrome/browser/ui/qr_scanner", "//ios/chrome/browser/ui/qr_scanner",
"//ios/chrome/browser/ui/tools_menu", "//ios/chrome/browser/ui/tools_menu",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
......
specific_include_rules = {
"^toolbar_model_impl_ios\.mm$": [
"+ios/web/web_state/ui/crw_web_controller.h",
],
}
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace { namespace {
// Amount by which to inset the button's content. // Amount by which to inset the button's content.
const CGFloat kContentInset = 6.0; const CGFloat kContentInset = 6.0;
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
#import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace toolbar { namespace toolbar {
// The colors used to tint the buttons in the toolbar. // The colors used to tint the buttons in the toolbar.
......
...@@ -114,18 +114,18 @@ extern const CGRect kToolbarFrame[INTERFACE_IDIOM_COUNT]; ...@@ -114,18 +114,18 @@ extern const CGRect kToolbarFrame[INTERFACE_IDIOM_COUNT];
// from also being visible. // from also being visible.
// TODO(blundell): Figure out how to fix this and have the top-level view be a // TODO(blundell): Figure out how to fix this and have the top-level view be a
// UIView. b/6167700 // UIView. b/6167700
@property(nonatomic, readonly, strong) ToolbarView* view; @property(nonatomic, readonly, retain) ToolbarView* view;
// The view for the toolbar background image. This is a subview of |view| to // The view for the toolbar background image. This is a subview of |view| to
// allow clients to alter the transparency of the background image without // allow clients to alter the transparency of the background image without
// affecting the other components of the toolbar. // affecting the other components of the toolbar.
@property(nonatomic, readonly, strong) UIImageView* backgroundView; @property(nonatomic, readonly, retain) UIImageView* backgroundView;
// The view for the toolbar shadow image. This is a subview of |view| to allow // The view for the toolbar shadow image. This is a subview of |view| to allow
// clients to alter the visibility of the shadow without affecting other // clients to alter the visibility of the shadow without affecting other
// components of the toolbar. // components of the toolbar.
@property(nonatomic, readonly, strong) UIImageView* shadowView; @property(nonatomic, readonly, retain) UIImageView* shadowView;
// The tools popup controller. Nil if the tools popup menu is not visible. // The tools popup controller. Nil if the tools popup menu is not visible.
@property(nonatomic, readonly, strong) @property(nonatomic, readonly, retain)
ToolsPopupController* toolsPopupController; ToolsPopupController* toolsPopupController;
// Style of this toolbar. // Style of this toolbar.
......
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
#import "ios/web/public/ssl_status.h" #import "ios/web/public/ssl_status.h"
#import "ios/web/public/web_state/web_state.h" #import "ios/web/public/web_state/web_state.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
ToolbarModelDelegateIOS::ToolbarModelDelegateIOS(WebStateList* web_state_list) ToolbarModelDelegateIOS::ToolbarModelDelegateIOS(WebStateList* web_state_list)
: web_state_list_(web_state_list) {} : web_state_list_(web_state_list) {}
......
...@@ -13,11 +13,6 @@ ...@@ -13,11 +13,6 @@
#include "ios/chrome/browser/tabs/tab.h" #include "ios/chrome/browser/tabs/tab.h"
#include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h" #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h"
#import "ios/web/public/web_state/web_state.h" #import "ios/web/public/web_state/web_state.h"
#import "ios/web/web_state/ui/crw_web_controller.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace { namespace {
const size_t kMaxURLDisplayChars = 32 * 1024; const size_t kMaxURLDisplayChars = 32 * 1024;
......
...@@ -9,10 +9,6 @@ ...@@ -9,10 +9,6 @@
#include "ios/chrome/browser/ui/toolbar/toolbar_button_tints.h" #include "ios/chrome/browser/ui/toolbar/toolbar_button_tints.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace { namespace {
// The number of dots drawn. // The number of dots drawn.
const int kNumberOfDots = 3; const int kNumberOfDots = 3;
...@@ -52,7 +48,7 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -52,7 +48,7 @@ const CGFloat kLineWidthAtApogee = 3;
// Whether the reading list contains unseen items. // Whether the reading list contains unseen items.
BOOL readingListContainsUnseenItems_; BOOL readingListContainsUnseenItems_;
// The CALayers containing the drawn dots. // The CALayers containing the drawn dots.
NSMutableArray<CAShapeLayer*>* pathLayers_; base::scoped_nsobject<CAShapeLayer> pathLayers_[kNumberOfDots];
// Whether the CALayers are being animated. // Whether the CALayers are being animated.
BOOL animationOnGoing_; BOOL animationOnGoing_;
} }
...@@ -85,7 +81,6 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -85,7 +81,6 @@ const CGFloat kLineWidthAtApogee = 3;
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[self setTintColor:toolbar::HighlighButtonTint(style_) [self setTintColor:toolbar::HighlighButtonTint(style_)
forState:UIControlStateHighlighted]; forState:UIControlStateHighlighted];
pathLayers_ = [[NSMutableArray alloc] initWithCapacity:kNumberOfDots];
} }
return self; return self;
} }
...@@ -118,7 +113,7 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -118,7 +113,7 @@ const CGFloat kLineWidthAtApogee = 3;
- (void)initializeShapeLayers { - (void)initializeShapeLayers {
for (int i = 0; i < kNumberOfDots; i++) { for (int i = 0; i < kNumberOfDots; i++) {
CAShapeLayer* pathLayer = pathLayers_[i]; base::scoped_nsobject<CAShapeLayer>& pathLayer = pathLayers_[i];
if (pathLayer) { if (pathLayer) {
[pathLayer removeFromSuperlayer]; [pathLayer removeFromSuperlayer];
} }
...@@ -130,7 +125,7 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -130,7 +125,7 @@ const CGFloat kLineWidthAtApogee = 3;
[path moveToPoint:CGPointMake(x - kMaxWidthOfSegment * 0.5, y)]; [path moveToPoint:CGPointMake(x - kMaxWidthOfSegment * 0.5, y)];
[path addLineToPoint:CGPointMake(x + kMaxWidthOfSegment * 0.5, y)]; [path addLineToPoint:CGPointMake(x + kMaxWidthOfSegment * 0.5, y)];
pathLayer = [CAShapeLayer layer]; pathLayer.reset([[CAShapeLayer layer] retain]);
[pathLayer setFrame:self.bounds]; [pathLayer setFrame:self.bounds];
[pathLayer setPath:path.CGPath]; [pathLayer setPath:path.CGPath];
[pathLayer setStrokeColor:[self.tintColor CGColor]]; [pathLayer setStrokeColor:[self.tintColor CGColor]];
...@@ -139,8 +134,7 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -139,8 +134,7 @@ const CGFloat kLineWidthAtApogee = 3;
[pathLayer setLineCap:kCALineCapRound]; [pathLayer setLineCap:kCALineCapRound];
[pathLayer setStrokeStart:kStrokeStartAtRest]; [pathLayer setStrokeStart:kStrokeStartAtRest];
[pathLayer setStrokeEnd:kStrokeEndAtRest]; [pathLayer setStrokeEnd:kStrokeEndAtRest];
[self.layer addSublayer:pathLayer]; [self.layer addSublayer:pathLayer.get()];
pathLayers_[i] = pathLayer;
} }
} }
...@@ -212,7 +206,8 @@ const CGFloat kLineWidthAtApogee = 3; ...@@ -212,7 +206,8 @@ const CGFloat kLineWidthAtApogee = 3;
// Add four animations for each stroke. // Add four animations for each stroke.
for (int i = 0; i < kNumberOfDots; i++) { for (int i = 0; i < kNumberOfDots; i++) {
CAShapeLayer* pathLayer = pathLayers_[i]; base::scoped_nsobject<CAShapeLayer>& pathLayer = pathLayers_[i];
DCHECK(pathLayer.get());
const int frameStart = const int frameStart =
(kNumberOfDots - i) * kFramesBetweenAnimationOfEachDot; (kNumberOfDots - i) * kFramesBetweenAnimationOfEachDot;
......
...@@ -9,17 +9,13 @@ ...@@ -9,17 +9,13 @@
#include "components/reading_list/core/reading_list_model.h" #include "components/reading_list/core/reading_list_model.h"
#import "ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface ToolsMenuButtonObserverBridge () @interface ToolsMenuButtonObserverBridge ()
- (void)updateButtonWithModel:(const ReadingListModel*)model; - (void)updateButtonWithModel:(const ReadingListModel*)model;
- (void)buttonPressed:(UIButton*)sender; - (void)buttonPressed:(UIButton*)sender;
@end @end
@implementation ToolsMenuButtonObserverBridge { @implementation ToolsMenuButtonObserverBridge {
ToolbarToolsMenuButton* _button; base::scoped_nsobject<ToolbarToolsMenuButton> _button;
ReadingListModel* _model; ReadingListModel* _model;
std::unique_ptr<ReadingListModelBridge> _modelBridge; std::unique_ptr<ReadingListModelBridge> _modelBridge;
} }
...@@ -28,7 +24,7 @@ ...@@ -28,7 +24,7 @@
toolbarButton:(ToolbarToolsMenuButton*)button { toolbarButton:(ToolbarToolsMenuButton*)button {
self = [super init]; self = [super init];
if (self) { if (self) {
_button = button; _button.reset([button retain]);
_model = readingListModel; _model = readingListModel;
[_button addTarget:self [_button addTarget:self
action:@selector(buttonPressed:) action:@selector(buttonPressed:)
......
...@@ -87,8 +87,8 @@ extern const CGFloat kiPhoneOmniboxPlaceholderColorBrightness; ...@@ -87,8 +87,8 @@ extern const CGFloat kiPhoneOmniboxPlaceholderColorBrightness;
QRScannerViewControllerDelegate, QRScannerViewControllerDelegate,
VoiceSearchControllerDelegate> VoiceSearchControllerDelegate>
@property(nonatomic, weak) id<WebToolbarDelegate> delegate; @property(nonatomic, assign) id<WebToolbarDelegate> delegate;
@property(nonatomic, weak, readonly) id<UrlLoader> urlLoader; @property(nonatomic, assign, readonly) id<UrlLoader> urlLoader;
// Mark inherited initializer as unavailable. // Mark inherited initializer as unavailable.
- (instancetype)initWithStyle:(ToolbarControllerStyle)style NS_UNAVAILABLE; - (instancetype)initWithStyle:(ToolbarControllerStyle)style NS_UNAVAILABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment