Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Updating icons in URL bar #5449

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/components/siteInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class SiteInfo extends ImmutableComponent {
extendedValidation: this.isExtendedValidation
})} /><span data-l10n-id='secureConnection' /></li>
} else if (this.runInsecureContent) {
secureIcon = <li><span className='fa fa-unlock' /><span data-l10n-id='mixedConnection' /></li>
secureIcon = <li><span className='fa fa-exclamation-triangle' /><span data-l10n-id='mixedConnection' /></li>
} else {
secureIcon = <li><span className='fa fa-unlock' /><span data-l10n-id='insecureConnection' data-l10n-args={JSON.stringify(l10nArgs)} /></li>
secureIcon = <li><span className='fa fa-exclamation-triangle' /><span data-l10n-id='insecureConnection' data-l10n-args={JSON.stringify(l10nArgs)} /></li>
}

// Figure out the partition info display
Expand Down
9 changes: 6 additions & 3 deletions js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ class UrlBar extends ImmutableComponent {
}

render () {
const showIconSecure = !this.activateSearchEngine && this.isHTTPPage && this.props.isSecure && !this.props.urlbar.get('active')
const showIconInsecure = !this.activateSearchEngine && this.isHTTPPage && !this.props.isSecure && !this.props.urlbar.get('active') && !this.props.titleMode
const showIconSearch = !this.activateSearchEngine && this.props.urlbar.get('active') && this.props.loading === false
const value = this.isActive || (!this.locationValue && this.isFocused())
? undefined
: this.locationValue
Expand All @@ -424,9 +427,9 @@ class UrlBar extends ImmutableComponent {
className={cx({
urlbarIcon: true,
'fa': !this.activateSearchEngine,
'fa-lock': !this.activateSearchEngine && this.isHTTPPage && this.props.isSecure && !this.props.urlbar.get('active'),
'fa-unlock': !this.activateSearchEngine && this.isHTTPPage && !this.props.isSecure && !this.props.urlbar.get('active') && !this.props.titleMode,
'fa fa-file': !this.activateSearchEngine && this.props.urlbar.get('active') && this.props.loading === false,
'fa-lock': showIconSecure,
'fa-exclamation-triangle': showIconInsecure,
'fa fa-search': showIconSearch || (!showIconSecure && !showIconInsecure && !showIconSearch),
extendedValidation: this.extendedValidationSSL
})}
style={
Expand Down
10 changes: 5 additions & 5 deletions less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -769,27 +769,27 @@
}

.urlbarIcon {
color: @focusUrlbarOutline;
color: @siteSecureColor;
left: 14px;
margin-top: 1px;
font-size: 13px;
min-height: 10px;
min-width: 16px;

&.fa-lock,
&.fa-unlock {
&.fa-exclamation-triangle {
margin-top: 1px;
font-size: 16px;
min-height: 10px;
min-width: 16px;
}

&.fa-unlock {
color: @gray;
&.fa-exclamation-triangle {
color: @siteInsecureColor;
}

&.extendedValidation {
color: green;
color: @siteEVColor;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions less/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
@contextMenuFontSize: 14px;
@audioColor: @highlightBlue;
@focusUrlbarOutline: @highlightBlue;
@siteSecureColor: @highlightBlue;
@siteInsecureColor: #FCBA00;
@siteEVColor: green;
@loadTimeColor: @highlightBlue;
@activeTabDefaultColor: @chromePrimary;
@buttonColor: #5a5a5a;
Expand Down
9 changes: 6 additions & 3 deletions test/components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ describe('navigationBar', function () {
.moveToObject(navigator)
.waitForExist(urlbarIcon)
.getAttribute(urlbarIcon, 'class').then((classes) =>
classes.includes('fa-unlock')
classes.includes('fa-exclamation-triangle')
))
.windowByUrl(Brave.browserWindowUrl)
.click(urlbarIcon)
Expand Down Expand Up @@ -791,6 +791,9 @@ describe('navigationBar', function () {
return this.getValue(urlInput).then((val) => val === 'about:blank')
})
})
it('has the search icon', function * () {
yield this.app.client.waitForExist('.urlbarIcon.fa-search')
})
})

describe('page with focused form input', function () {
Expand Down Expand Up @@ -850,8 +853,8 @@ describe('navigationBar', function () {
yield selectsText(this.app.client, 'brave.com')
})

it('has the file icon', function * () {
yield this.app.client.waitForExist('.urlbarIcon.fa-file')
it('has the search icon', function * () {
yield this.app.client.waitForExist('.urlbarIcon.fa-search')
})
})

Expand Down