static void get_request_token_ready_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { OAuthService *self = user_data; GError *error = NULL; char *url; GtkWidget *dialog; if (! oauth_service_get_request_token_finish (self, result, &error)) { gth_task_completed (GTH_TASK (self), error); return; } url = self->priv->consumer->get_authorization_url (self); dialog = oauth_ask_authorization_dialog_new (url); _gtk_window_resize_to_fit_screen_height (dialog, 1024); _web_service_set_auth_dialog (WEB_SERVICE (self), GTK_DIALOG (dialog)); g_signal_connect (OAUTH_ASK_AUTHORIZATION_DIALOG (dialog), "load-request", G_CALLBACK (ask_authorization_dialog_load_request_cb), self); gtk_widget_show (dialog); g_free (url); }
static void oauth_ask_authorization_dialog_finalize (GObject *obj) { OAuthAskAuthorizationDialog *self; self = OAUTH_ASK_AUTHORIZATION_DIALOG (obj); _g_object_unref (self->priv->builder); G_OBJECT_CLASS (oauth_ask_authorization_dialog_parent_class)->finalize (obj); }
static void picasa_web_service_ask_authorization (WebService *base) { PicasaWebService *self = PICASA_WEB_SERVICE (base); GtkWidget *dialog; _g_strset (&self->priv->refresh_token, NULL); _g_strset (&self->priv->access_token, NULL); dialog = oauth_ask_authorization_dialog_new (picasa_web_service_get_authorization_url (self)); gtk_window_set_default_size (GTK_WINDOW (dialog), 680, 580); _web_service_set_auth_dialog (WEB_SERVICE (self), GTK_DIALOG (dialog)); g_signal_connect (OAUTH_ASK_AUTHORIZATION_DIALOG (dialog), "loaded", G_CALLBACK (ask_authorization_dialog_loaded_cb), self); gtk_widget_show (dialog); }
static GtkWidget * webkit_view_create_cb (WebKitWebView *web_view, gpointer user_data) { return oauth_ask_authorization_dialog_get_view (OAUTH_ASK_AUTHORIZATION_DIALOG (user_data)); }