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

Commit

Permalink
Follow-up refactor of #3808
Browse files Browse the repository at this point in the history
Auditors: @diracdeltas

Test Plan: N/A
  • Loading branch information
darkdh committed Sep 9, 2016
1 parent cf48e14 commit 4f276b9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ WindowStore
},
isExtendedValidation: boolean, // is using https ev
runInsecureContent: boolean, // has active mixed content
blockedRunInsecureContent: string, // first domain of blocked active mixed content
blockedRunInsecureContent: Array<string> // sources of blocked active mixed content
},
parentFrameKey: number, // the key of the frame this frame was opened from
modalPromptDetail: {...},
Expand Down
2 changes: 1 addition & 1 deletion docs/windowActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ Sets the manage autofill credit card popup detail

### setBlockedRunInsecureContent(frameProps, source)

Sets page url with blocked active mixed content.
Sets source of blocked active mixed content.

**Parameters**

Expand Down
2 changes: 1 addition & 1 deletion js/actions/windowActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ const windowActions = {
},

/**
* Sets page url with blocked active mixed content.
* Sets source of blocked active mixed content.
* @param {Object} frameProps - The frame to set source of
* blocked active mixed content on
* @param {string} source - Source of blocked active mixed content
Expand Down
2 changes: 1 addition & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ class Frame extends ImmutableComponent {
}
})
this.webview.addEventListener('did-block-run-insecure-content', (e) => {
windowActions.setBlockedRunInsecureContent(this.frame, this.props.location)
windowActions.setBlockedRunInsecureContent(this.frame, e.details[0])
})
this.webview.addEventListener('context-menu', (e) => {
contextMenus.onMainContextMenu(e.params, this.frame)
Expand Down
4 changes: 2 additions & 2 deletions js/components/siteInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class SiteInfo extends ImmutableComponent {
this.onDenyRunInsecureContent = this.onDenyRunInsecureContent.bind(this)
}
onAllowRunInsecureContent () {
appActions.changeSiteSetting(siteUtil.getOrigin(this.isBlockedRunInsecureContent),
appActions.changeSiteSetting(siteUtil.getOrigin(this.location),
'runInsecureContent', true, this.isPrivate)
ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.isBlockedRunInsecureContent)
ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_LOAD_URL, {}, this.location)
this.props.onHide()
}
onDenyRunInsecureContent () {
Expand Down
5 changes: 4 additions & 1 deletion js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,11 @@ const doAction = (action) => {
const blockedRunInsecureContentPath =
['frames', FrameStateUtil.getFramePropsIndex(windowState.get('frames'), action.frameProps)]
if (action.source) {
let blockedList = windowState.getIn(
blockedRunInsecureContentPath.concat(['security', 'blockedRunInsecureContent'])) || new Immutable.List()
windowState =
windowState.setIn(blockedRunInsecureContentPath.concat(['security', 'blockedRunInsecureContent']), action.source)
windowState.setIn(blockedRunInsecureContentPath.concat(['security', 'blockedRunInsecureContent']),
blockedList.push(action.source))
} else {
windowState =
windowState.deleteIn(blockedRunInsecureContentPath.concat(['security', 'blockedRunInsecureContent']))
Expand Down

1 comment on commit 4f276b9

@diracdeltas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much cleaner, thanks

Please sign in to comment.