Commit ab07722a authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS][Dark Mode] Update Open In toolbar for dark mode

Bug: 996437
Change-Id: Ibc0331ad222e2cc3acb79915d3b85f9d3ab5af38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1771969
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690756}
parent 5833f90f
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14845" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14854.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14799.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14806.4"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -33,7 +33,7 @@
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="K7H-Iv-QNk" firstAttribute="width" secondItem="tRS-Cx-RH3" secondAttribute="width" multiplier="0.381966" id="3hJ-Yo-1Tg"/>
<constraint firstItem="K7H-Iv-QNk" firstAttribute="height" secondItem="tRS-Cx-RH3" secondAttribute="height" multiplier="0.381966" id="962-tL-cOd"/>
......
......@@ -23,7 +23,7 @@ source_set("open_in") {
"//ios/chrome/browser/ui/coordinators:chrome_coordinators",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/web_state_list",
"//ios/chrome/common/ui_util",
"//ios/chrome/common/colors",
"//ios/chrome/common/ui_util",
"//ios/third_party/material_components_ios",
"//ios/web/public",
......
......@@ -7,10 +7,10 @@
#include <cmath>
#include "base/logging.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/util/named_guide.h"
#include "ios/chrome/browser/ui/util/rtl_geometry.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
......@@ -28,28 +28,17 @@ const CGFloat kOpenButtonTrailingPadding = 16.0f;
// The toolbar's border related constants.
const CGFloat kTopBorderHeight = 0.5f;
const CGFloat kTopBorderTransparency = 0.13f;
const int kTopBorderColor = 0x000000;
// The toolbar's background related constants.
const int kToolbarBackgroundColor = 0xFFFFFF;
const CGFloat kToolbarBackgroundTransparency = 0.97f;
} // anonymous namespace
@interface OpenInToolbar () {
// Backing object for |self.openButton|.
MDCButton* _openButton;
// Backing object for |self.topBorder|.
UIView* _topBorder;
}
@interface OpenInToolbar ()
// The "Open in..." button that's hooked up with the target and action passed
// on initialization.
@property(nonatomic, retain, readonly) MDCButton* openButton;
@property(nonatomic, strong, readonly) MDCButton* openButton;
// The line used as the border at the top of the toolbar.
@property(nonatomic, retain, readonly) UIView* topBorder;
@property(nonatomic, strong, readonly) UIView* topBorder;
// View used to have a bottom margin to prevent overlapping with the bottom
// toolbar. This view is used because the the CRWWebControllerContainerView is
......@@ -95,6 +84,8 @@ const CGFloat kToolbarBackgroundTransparency = 0.97f;
@synthesize bottomMargin = _bottomMargin;
@synthesize bottomMarginConstraint = _bottomMarginConstraint;
@synthesize openButton = _openButton;
@synthesize topBorder = _topBorder;
- (instancetype)initWithFrame:(CGRect)aRect {
NOTREACHED();
......@@ -105,8 +96,7 @@ const CGFloat kToolbarBackgroundTransparency = 0.97f;
self = [super initWithFrame:CGRectZero];
if (self) {
DCHECK([target respondsToSelector:action]);
[self setBackgroundColor:UIColorFromRGB(kToolbarBackgroundColor,
kToolbarBackgroundTransparency)];
self.backgroundColor = [UIColor colorNamed:kBackgroundColor];
[self addSubview:self.openButton];
[self.openButton addTarget:target
action:action
......@@ -147,7 +137,7 @@ const CGFloat kToolbarBackgroundTransparency = 0.97f;
- (MDCButton*)openButton {
if (!_openButton) {
_openButton = [[MDCFlatButton alloc] init];
[_openButton setTitleColor:[[MDCPalette cr_bluePalette] tint500]
[_openButton setTitleColor:[UIColor colorNamed:kBlueColor]
forState:UIControlStateNormal];
[_openButton setTitle:l10n_util::GetNSStringWithFixup(IDS_IOS_OPEN_IN)
forState:UIControlStateNormal];
......@@ -159,8 +149,7 @@ const CGFloat kToolbarBackgroundTransparency = 0.97f;
- (UIView*)topBorder {
if (!_topBorder) {
_topBorder = [[UIView alloc] initWithFrame:CGRectZero];
[_topBorder setBackgroundColor:UIColorFromRGB(kTopBorderColor,
kTopBorderTransparency)];
_topBorder.backgroundColor = [UIColor colorNamed:kToolbarShadowColor];
}
return _topBorder;
}
......
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