Move EWK implementation code into ewk/ directory where it belongs.
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_auth_request.cc
1 // Copyright (C) 2012 Intel Corporation. All rights reserved.
2 // Copyright 2014 Samsung Electronics. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #include "ewk_auth_request.h"
7 #include "private/ewk_private.h"
8 #include "private/ewk_auth_challenge_private.h"
9
10 Eina_Bool ewk_auth_request_authenticate(Ewk_Auth_Request* request, const char* username, const char* password)
11 {
12 #if defined(OS_TIZEN_TV)
13   EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
14   EINA_SAFETY_ON_NULL_RETURN_VAL(username, false);
15   EINA_SAFETY_ON_NULL_RETURN_VAL(password, false);
16   request->is_decided = true;
17   request->login_delegate->Proceed(username, password);
18   return true;
19 #else
20   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
21   return false;
22 #endif
23 }
24
25 Eina_Bool ewk_auth_request_cancel(Ewk_Auth_Request* request)
26 {
27 #if defined(OS_TIZEN_TV)
28   EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
29   request->is_decided = true;
30   request->login_delegate->Cancel();
31   return true;
32 #else
33   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
34   return false;
35 #endif
36 }
37
38 const char* ewk_auth_request_realm_get(const Ewk_Auth_Request* request)
39 {
40 #if defined(OS_TIZEN_TV)
41   EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
42   return request->realm.c_str();
43 #else
44   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
45   return NULL;
46 #endif
47 }