package cc.winboll.studio.webpagesources.handler;

/**
 * @Author ZhanGSKen@QQ.COM
 * @Date 2023/07/13 15:43:48
 * @Describe 源码视图窗口事务处理类
 */
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import cc.winboll.studio.webpagesources.fragment.SourcesFragment;

public class SourcesFragmentHandler extends Handler {

    public static final String TAG = "SourcesFragmentHandler";

    public static final int MSG_UPDATE = 0;
    public static final String BUNDLE_KEY_HTML = "BUNDLE_KEY_HTML";

    SourcesFragment mSourcesFragment;
    public SourcesFragmentHandler(SourcesFragment fragment) {
        mSourcesFragment = fragment;
    }

    public void handleMessage(Message msg) {
        switch (msg.what) {
            case MSG_UPDATE:{
                    Bundle bundle = msg.getData();
                    String szHtml = (String)bundle.getSerializable(BUNDLE_KEY_HTML);
                    mSourcesFragment.showCurrentWebPageHtml(szHtml);
                    break;
                }
        }
        super.handleMessage(msg);
    }
}
