diff --git a/app/renderer/components/main/siteInfo.js b/app/renderer/components/main/siteInfo.js index 545d4367bc6..ea53108c323 100644 --- a/app/renderer/components/main/siteInfo.js +++ b/app/renderer/components/main/siteInfo.js @@ -3,17 +3,17 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') -const PropTypes = require('prop-types') const {StyleSheet, css} = require('aphrodite/no-important') // Components -const ImmutableComponent = require('../immutableComponent') +const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') const Button = require('../common/button') // Actions const appActions = require('../../../../js/actions/appActions') const webviewActions = require('../../../../js/actions/webviewActions') +const windowActions = require('../../../../js/actions/windowActions') // Utils const cx = require('../../../../js/lib/classSet') @@ -26,29 +26,37 @@ const platformUtil = require('../../../common/lib/platformUtil') const globalStyles = require('../styles/global') const commonStyles = require('../styles/commonStyles') -class SiteInfo extends ImmutableComponent { - constructor () { - super() +class SiteInfo extends React.Component { + constructor (props) { + super(props) this.onAllowRunInsecureContent = this.onAllowRunInsecureContent.bind(this) this.onDenyRunInsecureContent = this.onDenyRunInsecureContent.bind(this) this.onViewCertificate = this.onViewCertificate.bind(this) } + onAllowRunInsecureContent () { appActions.changeSiteSetting(siteUtil.getOrigin(this.location), 'runInsecureContent', true, this.isPrivate) appActions.loadURLRequested(this.props.frameProps.get('tabId'), this.location) - this.props.onHide() + this.onHide() } + onDenyRunInsecureContent () { appActions.removeSiteSetting(siteUtil.getOrigin(this.location), 'runInsecureContent', this.isPrivate) appActions.loadURLRequested(this.props.frameProps.get('tabId'), this.location) - this.props.onHide() + this.onHide() } + onViewCertificate () { - this.props.onHide() + this.onHide() webviewActions.showCertificate() } + + onHide () { + windowActions.setSiteInfoVisible(false) + } + get isExtendedValidation () { return this.props.frameProps.getIn(['security', 'isExtendedValidation']) } @@ -183,7 +191,7 @@ class SiteInfo extends ImmutableComponent {