class HistoryEventHandlerService implements ValueChangeHandler<String> {

    protected void processForBookmarkedTextFlow(HistoryToken token) {
        if (equal(token.getTextFlowId(), currentHistoryState.getTextFlowId())
                || token.getTextFlowId() == null
                || modalStateHolder.getPageCount() == 0) {
            // target text flow id hasn't changed,
            // or no text flow id in history,
            // or modal navigation state holder is not yet initialized (which
            // means InitEditorEvent will be handling this.
            // See onValueChange(ValueChangeEvent<String>))
            return;
        }

        TransUnitId transUnitId = new TransUnitId(token.getTextFlowId());
        int targetPage = modalStateHolder.getTargetPage(transUnitId);
        if (targetPage != NavigationService.UNDEFINED) {
            Log.info("[gwt-history] bookmarked text flow. Target page: "
                    + targetPage + ", target TU id: " + transUnitId);
            int offset =
                    targetPage
                            * getTransUnitActionContextHolder.getContext()
                                    .getCount();
            eventBus.fireEvent(new BookmarkedTextFlowEvent(offset, transUnitId));
        }
    }

    @Inject public  HistoryEventHandlerService(EventBus eventBus,
            DocumentListPresenter documentListPresenter,
            AppPresenter appPresenter,
            SearchResultsPresenter searchResultsPresenter,
            GetTransUnitActionContextHolder getTransUnitActionContextHolder,
            ModalNavigationStateHolder modalStateHolder,
            UserConfigHolder configHolder);

}