mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 14:20:14 +02:00
MozReview-Commit-ID: DCcGDjKdIHh --HG-- extra : rebase_source : e4cb58d733c159aa9299348f089e062aa2c2bdd2
25 lines
853 B
JavaScript
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"];
|