| OLD | NEW |
| 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 #import "ios/chrome/share_extension/share_extension_view.h" | 5 #import "ios/chrome/share_extension/share_extension_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "ios/chrome/share_extension/ui_util.h" | 8 #import "ios/chrome/share_extension/ui_util.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) | 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 // Create an empty image to replace the standard gray background of the | 303 // Create an empty image to replace the standard gray background of the |
| 304 // UINavigationBar. | 304 // UINavigationBar. |
| 305 UIImage* emptyImage = [[UIImage alloc] init]; | 305 UIImage* emptyImage = [[UIImage alloc] init]; |
| 306 [navigationBar setBackgroundImage:emptyImage | 306 [navigationBar setBackgroundImage:emptyImage |
| 307 forBarMetrics:UIBarMetricsDefault]; | 307 forBarMetrics:UIBarMetricsDefault]; |
| 308 [navigationBar setShadowImage:emptyImage]; | 308 [navigationBar setShadowImage:emptyImage]; |
| 309 [navigationBar setTranslucent:YES]; | 309 [navigationBar setTranslucent:YES]; |
| 310 [navigationBar setTranslatesAutoresizingMaskIntoConstraints:NO]; | 310 [navigationBar setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| 311 | 311 |
| 312 UIButton* systemButton = [UIButton buttonWithType:UIButtonTypeSystem]; |
| 313 UIColor* systemColor = [systemButton titleColorForState:UIControlStateNormal]; |
| 312 UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc] | 314 UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc] |
| 313 initWithBarButtonSystemItem:UIBarButtonSystemItemCancel | 315 initWithBarButtonSystemItem:UIBarButtonSystemItemCancel |
| 314 target:self | 316 target:self |
| 315 action:@selector(cancelPressed:)]; | 317 action:@selector(cancelPressed:)]; |
| 318 [cancelButton setTintColor:systemColor]; |
| 316 | 319 |
| 317 NSString* appName = | 320 NSString* appName = |
| 318 [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; | 321 [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; |
| 319 UINavigationItem* titleItem = | 322 UINavigationItem* titleItem = |
| 320 [[UINavigationItem alloc] initWithTitle:appName]; | 323 [[UINavigationItem alloc] initWithTitle:appName]; |
| 321 [titleItem setLeftBarButtonItem:cancelButton]; | 324 [titleItem setLeftBarButtonItem:cancelButton]; |
| 322 [titleItem setHidesBackButton:YES]; | 325 [titleItem setHidesBackButton:YES]; |
| 323 [navigationBar pushNavigationItem:titleItem animated:NO]; | 326 [navigationBar pushNavigationItem:titleItem animated:NO]; |
| 324 return navigationBar; | 327 return navigationBar; |
| 325 } | 328 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 [self.screenshotView.widthAnchor constraintEqualToConstant:kScreenshotSize] | 430 [self.screenshotView.widthAnchor constraintEqualToConstant:kScreenshotSize] |
| 428 .active = YES; | 431 .active = YES; |
| 429 [self.titleURLContainer.trailingAnchor | 432 [self.titleURLContainer.trailingAnchor |
| 430 constraintEqualToAnchor:self.screenshotView.leadingAnchor | 433 constraintEqualToAnchor:self.screenshotView.leadingAnchor |
| 431 constant:-kShareExtensionPadding] | 434 constant:-kShareExtensionPadding] |
| 432 .active = YES; | 435 .active = YES; |
| 433 [[self screenshotView] setImage:screenshot]; | 436 [[self screenshotView] setImage:screenshot]; |
| 434 } | 437 } |
| 435 | 438 |
| 436 @end | 439 @end |
| OLD | NEW |