web-view: don't connect to embed-shell in page-created cb
This isn't the right place. It could lead to these signals being
connected multiple times due to PSON.
Michael Catanzaro
4 years ago
918 | 918 | |
919 | 919 | view->web_process_extension = web_process_extension; |
920 | 920 | g_object_add_weak_pointer (G_OBJECT (view->web_process_extension), (gpointer *)&view->web_process_extension); |
921 | ||
922 | g_signal_connect_object (shell, "password-form-focused", | |
923 | G_CALLBACK (password_form_focused_cb), | |
924 | view, 0); | |
925 | ||
926 | g_signal_connect_object (shell, "allow-tls-certificate", | |
927 | G_CALLBACK (allow_tls_certificate_cb), | |
928 | view, 0); | |
929 | ||
930 | g_signal_connect_object (shell, "allow-unsafe-browsing", | |
931 | G_CALLBACK (allow_unsafe_browsing_cb), | |
932 | view, 0); | |
933 | 921 | } |
934 | 922 | |
935 | 923 | static void |
2907 | 2895 | static void |
2908 | 2896 | ephy_web_view_init (EphyWebView *web_view) |
2909 | 2897 | { |
2898 | EphyEmbedShell *shell; | |
2899 | ||
2900 | shell = ephy_embed_shell_get_default (); | |
2901 | ||
2910 | 2902 | web_view->is_blank = TRUE; |
2911 | 2903 | web_view->ever_committed = FALSE; |
2912 | 2904 | web_view->document_type = EPHY_WEB_VIEW_DOCUMENT_HTML; |
2914 | 2906 | |
2915 | 2907 | web_view->file_monitor = ephy_file_monitor_new (web_view); |
2916 | 2908 | |
2917 | web_view->history_service = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ()); | |
2909 | web_view->history_service = ephy_embed_shell_get_global_history_service (shell); | |
2918 | 2910 | web_view->history_service_cancellable = g_cancellable_new (); |
2919 | 2911 | |
2920 | 2912 | g_signal_connect_object (EPHY_SETTINGS_READER, "changed::" EPHY_PREFS_READER_FONT_STYLE, |
2984 | 2976 | G_CALLBACK (authenticate_cb), |
2985 | 2977 | NULL); |
2986 | 2978 | |
2987 | g_signal_connect_object (ephy_embed_shell_get_default (), "page-created", | |
2979 | g_signal_connect_object (shell, "page-created", | |
2988 | 2980 | G_CALLBACK (page_created_cb), |
2981 | web_view, 0); | |
2982 | ||
2983 | g_signal_connect_object (shell, "password-form-focused", | |
2984 | G_CALLBACK (password_form_focused_cb), | |
2985 | web_view, 0); | |
2986 | ||
2987 | g_signal_connect_object (shell, "allow-tls-certificate", | |
2988 | G_CALLBACK (allow_tls_certificate_cb), | |
2989 | web_view, 0); | |
2990 | ||
2991 | g_signal_connect_object (shell, "allow-unsafe-browsing", | |
2992 | G_CALLBACK (allow_unsafe_browsing_cb), | |
2989 | 2993 | web_view, 0); |
2990 | 2994 | } |
2991 | 2995 |