-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for shields read-only view
close brave/brave-browser#1196
- Loading branch information
1 parent
1c09c4a
commit b5772d8
Showing
21 changed files
with
458 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...tension/extension/brave_extension/components/readOnlyView/controls/adsTrackersControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
// Feature-specific components | ||
import { | ||
BlockedInfoRowText, | ||
BlockedInfoRowData, | ||
BlockedInfoRowDetails, | ||
BlockedInfoRowSummary, | ||
ArrowUpIcon, | ||
ArrowDownIcon, | ||
BlockedInfoRowStats, | ||
BlockedListStatic, | ||
dummyData | ||
} from 'brave-ui/features/shields' | ||
|
||
// Group components | ||
import StaticResourcesList from '../../shared/resourcesBlockedList/staticResourcesList' | ||
|
||
// Helpers | ||
import { getLocale } from '../../../background/api/localeAPI' | ||
|
||
interface State { | ||
dummyThirdPartyTrackersBlockedOpen: boolean | ||
} | ||
|
||
export default class AdsTrackersControl extends React.PureComponent<{}, State> { | ||
constructor (props: {}) { | ||
super(props) | ||
this.state = { dummyThirdPartyTrackersBlockedOpen: false } | ||
} | ||
onClickFakeThirdPartyTrackersBlocked = () => { | ||
this.setState({ dummyThirdPartyTrackersBlockedOpen: !this.state.dummyThirdPartyTrackersBlockedOpen }) | ||
} | ||
render () { | ||
const { dummyThirdPartyTrackersBlockedOpen } = this.state | ||
return ( | ||
<BlockedInfoRowDetails> | ||
<BlockedInfoRowSummary onClick={this.onClickFakeThirdPartyTrackersBlocked}> | ||
<BlockedInfoRowData disabled={false}> | ||
{ | ||
dummyThirdPartyTrackersBlockedOpen | ||
? <ArrowUpIcon /> | ||
: <ArrowDownIcon /> | ||
} | ||
<BlockedInfoRowStats>{2}</BlockedInfoRowStats> | ||
<BlockedInfoRowText>{getLocale('thirdPartyTrackersBlocked')}</BlockedInfoRowText> | ||
</BlockedInfoRowData> | ||
</BlockedInfoRowSummary> | ||
<BlockedListStatic> | ||
<StaticResourcesList list={dummyData.otherBlockedResources} /> | ||
</BlockedListStatic> | ||
</BlockedInfoRowDetails> | ||
) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...e_extension/extension/brave_extension/components/readOnlyView/controls/cookiesControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
// Feature-specific components | ||
import { | ||
BlockedInfoRowSingleText, | ||
BlockedInfoRowText | ||
} from 'brave-ui/features/shields' | ||
|
||
// Helpers | ||
import { getLocale } from '../../../background/api/localeAPI' | ||
|
||
export default class AdsTrackersControl extends React.PureComponent<{}, {}> { | ||
render () { | ||
return ( | ||
<BlockedInfoRowSingleText> | ||
<BlockedInfoRowText> | ||
<span>{getLocale('thirdPartyCookiesBlocked')}</span> | ||
</BlockedInfoRowText> | ||
</BlockedInfoRowSingleText> | ||
) | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...n/extension/brave_extension/components/readOnlyView/controls/deviceRecognitionControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
// Feature-specific components | ||
import { | ||
BlockedInfoRowDetails, | ||
ArrowUpIcon, | ||
ArrowDownIcon, | ||
BlockedInfoRowStats, | ||
BlockedInfoRowForSelectSummary, | ||
BlockedInfoRowDataForSelect, | ||
BlockedListStatic, | ||
BlockedInfoRowText, | ||
dummyData | ||
} from 'brave-ui/features/shields' | ||
|
||
// Group components | ||
import StaticResourcesList from '../../shared/resourcesBlockedList/staticResourcesList' | ||
|
||
// Helpers | ||
import { getLocale } from '../../../background/api/localeAPI' | ||
|
||
interface State { | ||
dummyThirdPartyFingerprintingBlockedOpen: boolean | ||
} | ||
|
||
export default class AdsTrackersControl extends React.PureComponent<{}, State> { | ||
constructor (props: {}) { | ||
super(props) | ||
this.state = { dummyThirdPartyFingerprintingBlockedOpen: false } | ||
} | ||
|
||
onClickFakeThirdPartyFingerprintingBlocked = () => { | ||
this.setState({ dummyThirdPartyFingerprintingBlockedOpen: !this.state.dummyThirdPartyFingerprintingBlockedOpen }) | ||
} | ||
render () { | ||
const { dummyThirdPartyFingerprintingBlockedOpen } = this.state | ||
return ( | ||
<BlockedInfoRowDetails> | ||
<BlockedInfoRowForSelectSummary onClick={this.onClickFakeThirdPartyFingerprintingBlocked}> | ||
<BlockedInfoRowDataForSelect disabled={false}> | ||
{ | ||
dummyThirdPartyFingerprintingBlockedOpen | ||
? <ArrowUpIcon /> | ||
: <ArrowDownIcon /> | ||
} | ||
<BlockedInfoRowStats>{2}</BlockedInfoRowStats> | ||
<BlockedInfoRowText> | ||
<span>{getLocale('thirdPartyFingerprintingBlocked')}</span> | ||
</BlockedInfoRowText> | ||
</BlockedInfoRowDataForSelect> | ||
</BlockedInfoRowForSelectSummary> | ||
<BlockedListStatic> | ||
<StaticResourcesList list={dummyData.otherBlockedResources} /> | ||
</BlockedListStatic> | ||
</BlockedInfoRowDetails> | ||
) | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...nsion/extension/brave_extension/components/readOnlyView/controls/httpsUpgradesControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import * as React from 'react' | ||
|
||
// Feature-specific components | ||
import { | ||
BlockedInfoRowText, | ||
BlockedInfoRowData, | ||
BlockedInfoRowDetails, | ||
BlockedInfoRowSummary, | ||
ArrowUpIcon, | ||
ArrowDownIcon, | ||
BlockedInfoRowStats, | ||
BlockedListStatic, | ||
dummyData | ||
} from 'brave-ui/features/shields' | ||
|
||
// Group components | ||
import StaticResourcesList from '../../shared/resourcesBlockedList/staticResourcesList' | ||
|
||
// Helpers | ||
import { getLocale } from '../../../background/api/localeAPI' | ||
|
||
interface State { | ||
dummyConnectionsUpgradedHTTPSOpen: boolean | ||
} | ||
|
||
export default class AdsTrackersControl extends React.PureComponent<{}, State> { | ||
constructor (props: {}) { | ||
super(props) | ||
this.state = { dummyConnectionsUpgradedHTTPSOpen: false } | ||
} | ||
|
||
onClickFakeConnectionsUpgradedHTTPS = () => { | ||
this.setState({ dummyConnectionsUpgradedHTTPSOpen: !this.state.dummyConnectionsUpgradedHTTPSOpen }) | ||
} | ||
|
||
render () { | ||
const { dummyConnectionsUpgradedHTTPSOpen } = this.state | ||
return ( | ||
<BlockedInfoRowDetails> | ||
<BlockedInfoRowSummary onClick={this.onClickFakeConnectionsUpgradedHTTPS}> | ||
<BlockedInfoRowData disabled={false}> | ||
{ | ||
dummyConnectionsUpgradedHTTPSOpen | ||
? <ArrowUpIcon /> | ||
: <ArrowDownIcon /> | ||
} | ||
<BlockedInfoRowStats>{2}</BlockedInfoRowStats> | ||
<BlockedInfoRowText>{getLocale('connectionsUpgradedHTTPS')}</BlockedInfoRowText> | ||
</BlockedInfoRowData> | ||
</BlockedInfoRowSummary> | ||
<BlockedListStatic> | ||
<StaticResourcesList list={dummyData.otherBlockedResources} /> | ||
</BlockedListStatic> | ||
</BlockedInfoRowDetails> | ||
) | ||
} | ||
} |
Oops, something went wrong.