2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #ifndef BROWSER_POLICY_DECISION_MAKER_H
20 #define BROWSER_POLICY_DECISION_MAKER_H
22 #include "browser-config.h"
23 #include "browser-view.h"
29 class Browser_Common_View;
31 class Browser_Policy_Decision_Maker : public Browser_Common_View {
33 Browser_Policy_Decision_Maker(Evas_Object *navi_bar, Browser_View *browser_view);
34 ~Browser_Policy_Decision_Maker(void);
36 void init(Evas_Object *ewk_view);
46 /* ewk view event callback functions */
47 static void __decide_policy_for_navigation_action(void *data, Evas_Object *obj, void *event_info);
48 static void __decide_policy_for_response_cb(void *data, Evas_Object *obj, void *event_info);
50 /* download client callback functions */
51 static void __download_did_start_cb(const char *download_url, void *user_data);
53 /* Elementary event callback functions */
54 static void __popup_response_cb(void *data, Evas_Object *obj, void *event_info);
55 static void __player_cb(void *data, Evas_Object *obj, void *event_info);
56 static void __internet_cb(void *data, Evas_Object *obj, void *event_info);
57 static bool __launch_matched_application_cb(service_h service, const char *package, void *data);
59 /* Warning : MUST free() returned char* */
60 void _request_download(Ewk_Policy_Decision *policy_decision);
61 Eina_Bool _launch_download_app(const char *url, const char *cookies = NULL);
62 string _get_extension_name_from_url(string &url);
63 Eina_Bool _show_app_list_popup(void);
64 const char *_get_app_name_from_pkg_name(string& pkg_name);
65 Eina_Bool _handle_exscheme(void);
67 Evas_Object *m_ewk_view;
68 Evas_Object *m_navi_bar;
69 Evas_Object *m_list_popup;
70 Evas_Object *m_app_list;
71 Browser_View *m_browser_view;
72 Eina_Bool m_found_matched_app;
76 string m_default_player_pkg_name;
78 #endif /* BROWSER_POLICY_DECISION_MAKER_H */