This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Bug 1201481 - Let AppTextSelectionDialogs from all opened apps share one single pref. observer in shared global states. #31697
Merged
Conversation
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
@@ -9,6 +9,11 @@ | |||
// states which are shared by apps should be put in this class. | |||
var AppTextSelectionDialogGlobalStates = function() { | |||
this._hasCutOrCopiedTimeoutId = null; | |||
this._isPrefOn = true; | |||
this._appTSDArray = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very sorry for giving you the wrong information, but this should be updated with a Set()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this._appTSDs = new Set();
…one single pref. observer in shared global states. (v2)
@@ -9,6 +9,11 @@ | |||
// states which are shared by apps should be put in this class. | |||
var AppTextSelectionDialogGlobalStates = function() { | |||
this._hasCutOrCopiedTimeoutId = null; | |||
this._isPrefOn = true; | |||
this._appTSDs = new Set(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little small change (sorry): s/_appTSDs/appTSDs/g
since we intend to allow external access of the set.
lissyx
added a commit
that referenced
this pull request
Sep 8, 2015
Bug 1201481 - Let AppTextSelectionDialogs from all opened apps share one single pref. observer in shared global states.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SettingsListener.observe is moved into shared global states. I use an AppTextSelectionDialog array in global states to keep all AppTextSelectionDialog instances from launched apps. The state of each AppTextSelectionDialog would be updated whenever copypaste.enable pref is changed.