forked from brave/browser-laptop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converts Tabs related components into redux
Resolves brave#8690
- Loading branch information
Showing
33 changed files
with
1,883 additions
and
1,419 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
/* 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/. */ | ||
|
||
const locale = require('../../../js/l10n') | ||
const frameStateUtil = require('../../../js/state/frameStateUtil.js') | ||
|
||
module.exports.iconSize = 16 | ||
|
||
const tabContentState = { | ||
getDisplayTitle: (state, frameKey) => { | ||
const frame = frameStateUtil.getFrameByKey(state, frameKey) | ||
|
||
if (!frame) { | ||
return '' | ||
} | ||
|
||
// For renderer initiated navigation, make sure we show Untitled | ||
// until we know what we're loading. We should probably do this for | ||
// all about: pages that we already know the title for so we don't have | ||
// to wait for the title to be parsed. | ||
if (frame.get('location') === 'about:blank') { | ||
return locale.translation('aboutBlankTitle') | ||
} else if (frame.get('location') === 'about:newtab') { | ||
return locale.translation('newTab') | ||
} | ||
|
||
// YouTube tries to change the title to add a play icon when | ||
// there is audio. Since we have our own audio indicator we get | ||
// rid of it. | ||
return (frame.get('title') || frame.get('location') || '').replace('▶ ', '') | ||
} | ||
} | ||
|
||
module.exports = tabContentState |
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
Oops, something went wrong.