gecko-dev/browser/extensions/activity-stream/lib/NewTabInit.jsm
k88hudson b607e644b6 Bug 1350411 - Add Message Channel for Activity Stream system add-on r=mconley
MozReview-Commit-ID: DCcGDjKdIHh

--HG--
extra : rebase_source : e4cb58d733c159aa9299348f089e062aa2c2bdd2
2017-04-07 14:13:14 -04:00

25 lines
853 B
JavaScript

/* 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/. */
"use strict";
const {utils: Cu} = Components;
const {actionTypes: at, actionCreators: ac} = Cu.import("resource://activity-stream/common/Actions.jsm", {});
/**
* NewTabInit - A placeholder for now. This will send a copy of the state to all
* newly opened tabs.
*/
this.NewTabInit = class NewTabInit {
onAction(action) {
let newAction;
switch (action.type) {
case at.NEW_TAB_LOAD:
newAction = {type: at.NEW_TAB_INITIAL_STATE, data: this.store.getState()};
this.store.dispatch(ac.SendToContent(newAction, action.meta.fromTarget));
break;
}
}
};
this.EXPORTED_SYMBOLS = ["NewTabInit"];