Commit 88fc5ccf authored by Christian Sadilek's avatar Christian Sadilek
Browse files

Make BrowserAction names consistent

parent c1fdc7a0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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
@@ -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()))
    }

    /**
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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)
    }

+2 −2
Original line number Diff line number Diff line
@@ -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].
@@ -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()
}
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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