Loading components/browser/session/src/main/java/mozilla/components/browser/session/Session.kt +4 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import mozilla.components.browser.state.action.ContentAction.UpdateIconAction import mozilla.components.browser.state.action.ContentAction.UpdateLoadingStateAction import mozilla.components.browser.state.action.ContentAction.UpdateProgressAction import mozilla.components.browser.state.action.ContentAction.UpdateSearchTermsAction import mozilla.components.browser.state.action.ContentAction.UpdateSecurityInfo import mozilla.components.browser.state.action.ContentAction.UpdateSecurityInfoAction import mozilla.components.browser.state.action.ContentAction.UpdateThumbnailAction import mozilla.components.browser.state.action.ContentAction.UpdateTitleAction import mozilla.components.browser.state.action.ContentAction.UpdateUrlAction Loading Loading @@ -257,7 +257,7 @@ class Session( */ var securityInfo: SecurityInfo by Delegates.observable(SecurityInfo()) { _, old, new -> notifyObservers(old, new) { onSecurityChanged(this@Session, new) } store?.syncDispatch(UpdateSecurityInfo(id, new.toSecurityInfoState())) store?.syncDispatch(UpdateSecurityInfoAction(id, new.toSecurityInfoState())) } /** Loading Loading @@ -332,10 +332,10 @@ class Session( if (new.isEmpty()) { // From `EngineObserver` we can assume that this means the trackers have been cleared. // The `ClearTrackers` action will also clear the loaded trackers list. That is always // The `ClearTrackersAction` will also clear the loaded trackers list. That is always // the case when this list is cleared from `EngineObserver`. For the sake of migrating // to browser-state we assume that no other code changes the tracking properties. store?.syncDispatch(TrackingProtectionAction.ClearTrackers(id)) store?.syncDispatch(TrackingProtectionAction.ClearTrackersAction(id)) } else { // `EngineObserver` always adds new trackers to the end of the list. So we just dispatch // an action for the last item in the list. Loading components/browser/session/src/test/java/mozilla/components/browser/session/SessionTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ class SessionTest { session.store = store session.securityInfo = Session.SecurityInfo(true, "mozilla.org", "issuer") verify(store).dispatch(ContentAction.UpdateSecurityInfo(session.id, session.securityInfo.toSecurityInfoState())) verify(store).dispatch(ContentAction.UpdateSecurityInfoAction(session.id, session.securityInfo.toSecurityInfoState())) verifyNoMoreInteractions(store) } Loading components/browser/state/src/main/java/mozilla/components/browser/state/action/BrowserAction.kt +2 −2 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ sealed class ContentAction : BrowserAction() { /** * Updates the [SecurityInfoState] of the [ContentState] with the given [sessionId]. */ data class UpdateSecurityInfo(val sessionId: String, val securityInfo: SecurityInfoState) : ContentAction() data class UpdateSecurityInfoAction(val sessionId: String, val securityInfo: SecurityInfoState) : ContentAction() /** * Updates the icon of the [ContentState] with the given [sessionId]. Loading Loading @@ -213,5 +213,5 @@ sealed class TrackingProtectionAction : BrowserAction() { /** * Clears the [TrackingProtectionState.blockedTrackers] and [TrackingProtectionState.blockedTrackers] lists. */ data class ClearTrackers(val tabId: String) : TrackingProtectionAction() data class ClearTrackersAction(val tabId: String) : TrackingProtectionAction() } components/browser/state/src/main/java/mozilla/components/browser/state/reducer/ContentStateReducer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ internal object ContentStateReducer { is ContentAction.UpdateSearchTermsAction -> updateContentState(state, action.sessionId) { it.copy(searchTerms = action.searchTerms) } is ContentAction.UpdateSecurityInfo -> updateContentState(state, action.sessionId) { is ContentAction.UpdateSecurityInfoAction -> updateContentState(state, action.sessionId) { it.copy(securityInfo = action.securityInfo) } is ContentAction.UpdateIconAction -> updateContentState(state, action.sessionId) { Loading components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TrackingProtectionStateReducer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ internal object TrackingProtectionStateReducer { is TrackingProtectionAction.TrackerLoadedAction -> state.copyWithTrackingProtectionState(action.tabId) { it.copy(loadedTrackers = it.loadedTrackers + action.tracker) } is TrackingProtectionAction.ClearTrackers -> state.copyWithTrackingProtectionState(action.tabId) { is TrackingProtectionAction.ClearTrackersAction -> state.copyWithTrackingProtectionState(action.tabId) { it.copy(loadedTrackers = emptyList(), blockedTrackers = emptyList()) } } Loading Loading
components/browser/session/src/main/java/mozilla/components/browser/session/Session.kt +4 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import mozilla.components.browser.state.action.ContentAction.UpdateIconAction import mozilla.components.browser.state.action.ContentAction.UpdateLoadingStateAction import mozilla.components.browser.state.action.ContentAction.UpdateProgressAction import mozilla.components.browser.state.action.ContentAction.UpdateSearchTermsAction import mozilla.components.browser.state.action.ContentAction.UpdateSecurityInfo import mozilla.components.browser.state.action.ContentAction.UpdateSecurityInfoAction import mozilla.components.browser.state.action.ContentAction.UpdateThumbnailAction import mozilla.components.browser.state.action.ContentAction.UpdateTitleAction import mozilla.components.browser.state.action.ContentAction.UpdateUrlAction Loading Loading @@ -257,7 +257,7 @@ class Session( */ var securityInfo: SecurityInfo by Delegates.observable(SecurityInfo()) { _, old, new -> notifyObservers(old, new) { onSecurityChanged(this@Session, new) } store?.syncDispatch(UpdateSecurityInfo(id, new.toSecurityInfoState())) store?.syncDispatch(UpdateSecurityInfoAction(id, new.toSecurityInfoState())) } /** Loading Loading @@ -332,10 +332,10 @@ class Session( if (new.isEmpty()) { // From `EngineObserver` we can assume that this means the trackers have been cleared. // The `ClearTrackers` action will also clear the loaded trackers list. That is always // The `ClearTrackersAction` will also clear the loaded trackers list. That is always // the case when this list is cleared from `EngineObserver`. For the sake of migrating // to browser-state we assume that no other code changes the tracking properties. store?.syncDispatch(TrackingProtectionAction.ClearTrackers(id)) store?.syncDispatch(TrackingProtectionAction.ClearTrackersAction(id)) } else { // `EngineObserver` always adds new trackers to the end of the list. So we just dispatch // an action for the last item in the list. Loading
components/browser/session/src/test/java/mozilla/components/browser/session/SessionTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ class SessionTest { session.store = store session.securityInfo = Session.SecurityInfo(true, "mozilla.org", "issuer") verify(store).dispatch(ContentAction.UpdateSecurityInfo(session.id, session.securityInfo.toSecurityInfoState())) verify(store).dispatch(ContentAction.UpdateSecurityInfoAction(session.id, session.securityInfo.toSecurityInfoState())) verifyNoMoreInteractions(store) } Loading
components/browser/state/src/main/java/mozilla/components/browser/state/action/BrowserAction.kt +2 −2 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ sealed class ContentAction : BrowserAction() { /** * Updates the [SecurityInfoState] of the [ContentState] with the given [sessionId]. */ data class UpdateSecurityInfo(val sessionId: String, val securityInfo: SecurityInfoState) : ContentAction() data class UpdateSecurityInfoAction(val sessionId: String, val securityInfo: SecurityInfoState) : ContentAction() /** * Updates the icon of the [ContentState] with the given [sessionId]. Loading Loading @@ -213,5 +213,5 @@ sealed class TrackingProtectionAction : BrowserAction() { /** * Clears the [TrackingProtectionState.blockedTrackers] and [TrackingProtectionState.blockedTrackers] lists. */ data class ClearTrackers(val tabId: String) : TrackingProtectionAction() data class ClearTrackersAction(val tabId: String) : TrackingProtectionAction() }
components/browser/state/src/main/java/mozilla/components/browser/state/reducer/ContentStateReducer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ internal object ContentStateReducer { is ContentAction.UpdateSearchTermsAction -> updateContentState(state, action.sessionId) { it.copy(searchTerms = action.searchTerms) } is ContentAction.UpdateSecurityInfo -> updateContentState(state, action.sessionId) { is ContentAction.UpdateSecurityInfoAction -> updateContentState(state, action.sessionId) { it.copy(securityInfo = action.securityInfo) } is ContentAction.UpdateIconAction -> updateContentState(state, action.sessionId) { Loading
components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TrackingProtectionStateReducer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ internal object TrackingProtectionStateReducer { is TrackingProtectionAction.TrackerLoadedAction -> state.copyWithTrackingProtectionState(action.tabId) { it.copy(loadedTrackers = it.loadedTrackers + action.tracker) } is TrackingProtectionAction.ClearTrackers -> state.copyWithTrackingProtectionState(action.tabId) { is TrackingProtectionAction.ClearTrackersAction -> state.copyWithTrackingProtectionState(action.tabId) { it.copy(loadedTrackers = emptyList(), blockedTrackers = emptyList()) } } Loading