From 86927216ba72c03d68d281c24a5245682309404a Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Thu, 11 Jun 2015 10:26:07 +0900 Subject: [PATCH 01/16] [Issues] TNEF-2062,TNEF-2056,TNEF-2055,TNEF-2129, TNEF-2128,TNEF-2127 [Problem] Not possible to Click the web contents area. [Cause] In the 800x60 size area of searchbox, mouse click is not working to web contents area [Solution] Removed the searchbox code. Searchbox is not scope of reference browser GUI. [Verify] click the 1120,130~1920,190 area Change-Id: I431a91da11010526a9df24476a43347e4d1fd4e0 Signed-off-by: sungwon2.han --- services/SimpleUI/SimpleUI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 3801759..17f89da 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -283,9 +283,9 @@ int SimpleUI::exec(const std::string& _url) - m_searchBox = std::make_shared(m_window.get()); - m_searchBox->textChanged.connect(boost::bind(&SimpleUI::searchWebPage, this, _1, _2)); - elm_object_part_content_set(m_mainLayout, "search_box", m_searchBox->getContent()); + //m_searchBox = std::make_shared(m_window.get()); + //m_searchBox->textChanged.connect(boost::bind(&SimpleUI::searchWebPage, this, _1, _2)); + //elm_object_part_content_set(m_mainLayout, "search_box", m_searchBox->getContent()); m_sessionService = std::dynamic_pointer_cast < -- 2.7.4 From 56d361c8b9c63ce114f3c2dde43b023dd1712deb Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Thu, 11 Jun 2015 13:16:47 +0900 Subject: [PATCH 02/16] [Issues] TNEF-2062,TNEF-2056,TNEF-2055,TNEF-2129, TNEF-2128,TNEF-2127 [Problem] Not possible to Click the web contents area. [Cause] In the 800x60 size area of searchbox, mouse click is not working to web contents area [Solution] Removed the searchbox code. Searchbox is not scope of reference browser GUI. [Verify] click the 1120,130~1920,190 area Change-Id: I69dd8bb644e144ffb286d60444062709196bcfbc Signed-off-by: sungwon2.han --- services/SimpleUI/CMakeLists.txt | 3 - services/SimpleUI/SearchBox.cpp | 150 --------- services/SimpleUI/SearchBox.h | 70 ----- services/SimpleUI/SimpleUI.cpp | 28 +- services/SimpleUI/SimpleUI.h | 5 - services/SimpleUI/edc/MainLayout.edc | 15 - services/SimpleUI/edc/SearchBox.edc | 570 ----------------------------------- 7 files changed, 1 insertion(+), 840 deletions(-) delete mode 100644 services/SimpleUI/SearchBox.cpp delete mode 100644 services/SimpleUI/SearchBox.h delete mode 100644 services/SimpleUI/edc/SearchBox.edc diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 587c2db..4053a76 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -12,7 +12,6 @@ set(SimpleUI_SRCS SimpleScroller.cpp WebTitleBar.cpp RelatedWebPages.cpp - SearchBox.cpp CustomPopup.cpp ) @@ -28,7 +27,6 @@ set(SimpleUI_HEADERS HistoryList.h WebTitleBar.h RelatedWebPages.h - SearchBox.h CustomPopup.h ) @@ -95,7 +93,6 @@ set(edcFiles ErrorMessage.edc RelatedPages.edc Tooltip.edc - SearchBox.edc CustomPopup.edc ) diff --git a/services/SimpleUI/SearchBox.cpp b/services/SimpleUI/SearchBox.cpp deleted file mode 100644 index 9185c46..0000000 --- a/services/SimpleUI/SearchBox.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "SearchBox.h" -#include "BrowserLogger.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -SearchBox::SearchBox(Evas_Object *parent) -{ - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/SearchBox.edj"); - elm_theme_extension_add(NULL, edjFilePath.c_str()); - - m_entry_layout = elm_layout_add(parent); - if(!elm_layout_file_set(m_entry_layout, edjFilePath.c_str(), "search_box")) - throw std::runtime_error("Layout file not found: " + edjFilePath); - - m_webSearchEntry = elm_entry_add(m_entry_layout); - - elm_object_style_set(m_webSearchEntry, "search_entry"); - - elm_entry_single_line_set(m_webSearchEntry, EINA_TRUE); - elm_entry_scrollable_set(m_webSearchEntry, EINA_TRUE); - - search_caseSensitive = false; - - elm_object_translatable_part_text_set(m_webSearchEntry, "elm.guide", "Search"); - - evas_object_smart_callback_add(m_webSearchEntry, "changed,user", SearchBox::searchNext, this); - - //Add Case sensitive checkbox - m_caseSensitive = elm_check_add(m_entry_layout); - elm_object_part_text_set(m_caseSensitive, "default", "Match case"); - elm_object_part_text_set(m_caseSensitive, "on", "Match case"); - elm_object_part_text_set(m_caseSensitive, "off", "Match case"); - elm_check_state_set(m_caseSensitive, EINA_FALSE); - elm_object_part_content_set(m_entry_layout, "search_opts_case", m_caseSensitive); - - //Add prev and next buttons - m_searchPrev = elm_button_add(m_entry_layout); - elm_object_style_set(m_searchPrev, "default_button"); - elm_object_part_text_set(m_searchPrev, "default", "Prev"); - elm_object_part_content_set(m_entry_layout, "search_opts_prev", m_searchPrev); - - m_searchNext = elm_button_add(m_entry_layout); - elm_object_style_set(m_searchNext, "default_button"); - elm_object_part_text_set(m_searchNext, "default", "Next"); - elm_object_part_content_set(m_entry_layout, "search_opts_next", m_searchNext); - - evas_object_smart_callback_add(m_searchNext, "clicked", SearchBox::searchNext, this); - evas_object_smart_callback_add(m_searchPrev, "clicked", SearchBox::searchPrev, this); - evas_object_smart_callback_add(m_caseSensitive, "changed", SearchBox::caseSensitiveChanged, this); - - elm_object_part_content_set(m_entry_layout, "search_entry_swallow", m_webSearchEntry); - - hide(); -} - -Evas_Object* SearchBox::getContent() -{ - return m_entry_layout; -} - -void SearchBox::hide() -{ - elm_object_signal_emit(m_entry_layout, "elm,state,hide", "elm"); - elm_object_signal_emit(m_searchNext, "elm,state,hide", "elm"); - elm_object_signal_emit(m_searchPrev, "elm,state,hide", "elm"); - elm_object_signal_emit(m_webSearchEntry, "elm,state,hide", "elm"); - elm_entry_entry_set(m_webSearchEntry, ""); -// evas_object_hide(m_caseSensitive); - visible = false; -} - -void SearchBox::show() -{ - elm_object_signal_emit(m_entry_layout, "elm,state,show", "elm"); - elm_object_signal_emit(m_searchNext, "elm,state,show", "elm"); - elm_object_signal_emit(m_searchPrev, "elm,state,show", "elm"); - elm_object_signal_emit(m_webSearchEntry, "elm,state,show", "elm"); -// evas_object_show(m_caseSensitive); - visible = true; -} - -bool SearchBox::is_visible() -{ - return visible; -} - -void SearchBox::searchNext(void *data, Evas_Object */*obj*/, void */*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - SearchBox *self = reinterpret_cast(data); - std::string entry(elm_entry_markup_to_utf8(elm_entry_entry_get(self->m_webSearchEntry))); - - if (self->search_caseSensitive) - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT); - else - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE); - -} - -void SearchBox::searchPrev(void *data, Evas_Object */*obj*/, void */*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - SearchBox *self = reinterpret_cast(data); - std::string entry(elm_entry_markup_to_utf8(elm_entry_entry_get(self->m_webSearchEntry))); - - if (self->search_caseSensitive) - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_BACKWARDS); - else - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE | EWK_FIND_OPTIONS_BACKWARDS); - -} - -void SearchBox::caseSensitiveChanged(void *data, Evas_Object */*obj*/, void */*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - SearchBox *self = reinterpret_cast(data); - std::string entry(elm_entry_markup_to_utf8(elm_entry_entry_get(self->m_webSearchEntry))); - self->search_caseSensitive = elm_check_state_get(self->m_caseSensitive); - - if (self->search_caseSensitive) - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT); - else - self->textChanged(entry, EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE); -} - - -} - -} - diff --git a/services/SimpleUI/SearchBox.h b/services/SimpleUI/SearchBox.h deleted file mode 100644 index b754536..0000000 --- a/services/SimpleUI/SearchBox.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _SEARCHBOX_H -#define _SEARCHBOX_H - -#include -#include -#include - -namespace tizen_browser -{ -namespace base_ui -{ - -enum Ewk_Find_Options { - EWK_FIND_OPTIONS_NONE, /**< no search flags, this means a case sensitive, no wrap, forward only search. */ - EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< case insensitive search. */ - EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< search text only at the beginning of the words. */ - EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, /**< treat capital letters in the middle of words as word start. */ - EWK_FIND_OPTIONS_BACKWARDS = 1 << 3, /**< search backwards. */ - EWK_FIND_OPTIONS_WRAP_AROUND = 1 << 4, /**< if not present search will stop at the end of the document. */ - EWK_FIND_OPTIONS_SHOW_OVERLAY = 1 << 5, /**< show overlay */ - EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< show indicator */ - EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< show highlight */ -}; - -class SearchBox{ - -public: - SearchBox(Evas_Object *parent); - Evas_Object* getContent(); - void hide(); - void show(); - bool is_visible(); - boost::signals2::signal textChanged; - -private: - Evas_Object* m_webSearchEntry; - Evas_Object* m_entry_layout; - Evas_Object* m_searchPrev; - Evas_Object* m_searchNext; - Evas_Object* m_caseSensitive; - - bool search_caseSensitive; - bool visible; - - static void searchNext(void *data, Evas_Object */*obj*/, void */*event_info*/); - static void searchPrev(void *data, Evas_Object */*obj*/, void */*event_info*/); - static void caseSensitiveChanged(void *data, Evas_Object */*obj*/, void */*event_info*/); -}; - -} - -} - -#endif //_SEARCHBOX_H diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 17f89da..3b6ee0d 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -281,12 +281,6 @@ int SimpleUI::exec(const std::string& _url) m_netErrorHandler->networkError.connect(boost::bind(&SimpleUI::onNetworkError, this)); m_netErrorHandler->networkConnected.connect(boost::bind(&SimpleUI::onNetworkConnected, this)); - - - //m_searchBox = std::make_shared(m_window.get()); - //m_searchBox->textChanged.connect(boost::bind(&SimpleUI::searchWebPage, this, _1, _2)); - //elm_object_part_content_set(m_mainLayout, "search_box", m_searchBox->getContent()); - m_sessionService = std::dynamic_pointer_cast < tizen_browser::services::SessionStorage, @@ -332,7 +326,6 @@ void SimpleUI::loadThemes() elm_theme_extension_add(NULL, edjePath("SimpleUI/ZoomItem.edj").c_str()); elm_theme_extension_add(NULL, edjePath("SimpleUI/TabItem.edj").c_str()); elm_theme_extension_add(NULL, edjePath("SimpleUI/ErrorMessage.edj").c_str()); - elm_theme_extension_add(NULL, edjePath("SimpleUI/SearchBox.edj").c_str()); elm_theme_overlay_add(0, edjePath("SimpleUI/ScrollerDefault.edj").c_str()); elm_theme_overlay_add(0, edjePath("SimpleUI/Tooltip.edj").c_str()); @@ -508,10 +501,7 @@ void SimpleUI::switchViewToHomePage() forwardEnable(false); backEnable(false); - m_simpleURI->setSearchIcon(); webTitleBar->hide(); - hideSearchBox(); - hideProgressBar(); } @@ -755,19 +745,6 @@ void SimpleUI::setErrorButtons() evas_object_hide(m_progressBar); } - -void SimpleUI::showSearchBox() -{ - if (m_searchBox.get()) - m_searchBox->show(); -} - -void SimpleUI::hideSearchBox() -{ - if (m_searchBox.get()) - m_searchBox->hide(); -} - void SimpleUI::filterURL(const std::string& url) { BROWSER_LOGD("[%s] url=%s", __func__, url.c_str()); @@ -1195,12 +1172,9 @@ void SimpleUI::favicon_clicked(void *data, Evas_Object */*obj*/, const char */*e { BROWSER_LOGD("[%s],", __func__); SimpleUI *self = reinterpret_cast(data); - if (self->m_searchBox->is_visible()) - self->m_searchBox->hide(); - else if (!self->isHomePageActive() && !self->isErrorPageActive()) + if (!self->isHomePageActive() && !self->isErrorPageActive()) { self->m_simpleURI->clearFocus(); - self->m_searchBox->show(); } } diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index fd0bc5d..793f87e 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -55,7 +55,6 @@ #include "TabList.h" #include "Settings.h" #include "HistoryList.h" -#include "SearchBox.h" #include "NetworkErrorHandler.h" #include "CustomPopup.h" #include "Config.h" @@ -207,9 +206,6 @@ private: void showSettingsMenu(); void hideSettingsMenu(); - void showSearchBox(); - void hideSearchBox(); - void showProgressBar(); void hideProgressBar(); @@ -259,7 +255,6 @@ private: std::shared_ptr m_bookmarksUI; std::shared_ptr m_zoomList; std::shared_ptr m_tabList; - std::shared_ptr m_searchBox; std::shared_ptr m_platformInputManager; std::shared_ptr m_sessionService; tizen_browser::Session::Session m_currentSession; diff --git a/services/SimpleUI/edc/MainLayout.edc b/services/SimpleUI/edc/MainLayout.edc index aa34c1e..3e70303 100644 --- a/services/SimpleUI/edc/MainLayout.edc +++ b/services/SimpleUI/edc/MainLayout.edc @@ -1,5 +1,4 @@ #include "Spacer.edc" -#include "SearchBox.edc" #define DEBUG_RECT_OVER(over_part, r, g, b) \ part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ \ @@ -198,20 +197,6 @@ collections { rel2 { to: "web_view"; relative: 1.0 1.0; } } } - part { name: "search_box"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - min: SEARCH_WIDTH SEARCH_HEIGHT; - max: SEARCH_WIDTH SEARCH_HEIGHT; - align: 1.0 0.0; - rel1 {relative: 0.0 0.0; to: "web_view";} - rel2 {relative: 1.0 1.0; to: "web_view";} - } - } - part {name: "popup_bg"; type: RECT; diff --git a/services/SimpleUI/edc/SearchBox.edc b/services/SimpleUI/edc/SearchBox.edc deleted file mode 100644 index 8903f67..0000000 --- a/services/SimpleUI/edc/SearchBox.edc +++ /dev/null @@ -1,570 +0,0 @@ -#define SEARCH_ENTRY_WIDTH 200 -#define SEARCH_HEIGHT 60 -#define SEARCH_WIDTH 800 -#define OPT_BUTTON_WIDTH 160 -#define TRANSITION_VALUE 0.1 -collections { - group { name: "elm/entry/selection/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 0 0 128 64; - } - } - } - } - group { name: "elm/entry/cursor/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 69 149 255 255; - min: 2 36; - max: 2 36; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } - } - group { - name: "elm/entry/base-single/search_entry"; - styles { - style { - name: "browser-entry-uri-style-unselected"; - base: "font=Tizen:style=SVD_Medium font_size="32" wrap=none color=#CCCCCC"; - } - style { - name: "browser-entry-uri-style-selected"; - base: "font=Tizen:style=SVD_Medium font_size="32" wrap=none color=#3D3D3D"; - } - } - data { - item: focus_highlight "off"; - } - parts { - part { - name: "elm.guide"; - scale:1; - type: TEXTBLOCK; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "label.text.clip"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - } - } - part { - name: "elm.text"; - scale:1; - multiline: 0; - entry_mode: EDITABLE; - select_mode: DEFAULT; - cursor_mode: BEFORE; - type: TEXTBLOCK; - clip_to: "label.text.clip"; - source: "elm/entry/selection/browser_entry"; - source4: "elm/entry/cursor/browser_entry"; - description { state: "default" 0.0; - visible: 0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-selected"; - min: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "gdisabled"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genabled"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - program { - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "elm.guide"; - target: "elm.text"; - } - program { - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "elm.guide"; - target: "elm.text"; - } - } - }//group - group{ name: "search_box"; - images { - image: "search_searchbar_bg_foc.png" COMP; - image: "search_searchbar_bg_nor.png" COMP; - image: "ico_search.png" COMP; - image: "ico_url.png" COMP; - } - parts{ - part { name: "bg_clipper"; - type: RECT; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - color: 18 22 34 0; - min: SEARCH_WIDTH SEARCH_HEIGHT; - max: SEARCH_WIDTH SEARCH_HEIGHT; - } - description{ - state: "visible" 0.0; - inherit: "default" 0.0; - min: SEARCH_WIDTH SEARCH_HEIGHT; - max: SEARCH_WIDTH SEARCH_HEIGHT; - color: 18 22 34 245; - visible: 1; - } - } - part { name: "bg"; - type: IMAGE; - scale: 1; - clip_to: "bg_clipper"; - description{ - state: "default" 0.0; - visible: 1; - align: 0.0 1.0; - color: 18 22 34 0; - min: SEARCH_WIDTH SEARCH_HEIGHT*2; - max: SEARCH_WIDTH SEARCH_HEIGHT*2; - image.normal: "search_searchbar_bg_nor.png"; - image.border: 5 5 5 5; - rel1 { relative: 0 0; to: "bg_clipper"; } - rel2 { relative: 1 1; to: "bg_clipper"; } - fill { - type: SCALE; - smooth: 0; - origin { - relative: 0 0; - offset: 0 0; - } - size { - relative: 1 1; - offset: 0 0; - } - } - } - description{ - state: "visible" 0.0; - inherit: "default" 0.0; - min: SEARCH_WIDTH SEARCH_HEIGHT*2; - max: SEARCH_WIDTH SEARCH_HEIGHT*2; - color: 18 22 34 245; - visible: 1; - } - } - part { name: "search_swallow"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.85; - min: SEARCH_ENTRY_WIDTH 40; - max: SEARCH_ENTRY_WIDTH 40; - rel1 { relative: 0 0; to: "bg"; offset: 30 0;} - rel2 { relative: 1 1; to: "bg"; } - fixed: 1 1; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "bg_search_over"; - type : RECT; - scale: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - align: 0.0 0.5; - rel1 { relative: 0 0; to: "search_swallow"; offset: 0 -5; } - rel2 { relative: 1 1; to: "search_swallow"; } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "bg_search"; - mouse_events: 1; - scale:1; - type: IMAGE; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - min: SEARCH_ENTRY_WIDTH 40; - max: SEARCH_ENTRY_WIDTH 40; - fixed: 1 1; - rel1 { relative: 0 0; to: "search_swallow"; offset: 0 -8; } - rel2 { relative: 1 1; to: "search_swallow"; } - image.normal: "search_searchbar_bg_nor.png"; - image.border: 5 5 5 5; - fill { - type: SCALE; - smooth: 0; - origin { - relative: 0 0; - offset: 0 0; - } - size { - relative: 1 1; - offset: 0 0; - } - } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "search_over"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - color: 0 0 0 0; - rel1 { relative: 0 0; to: "search_entry_swallow"; } - rel2 { relative: 1 1; to: "search_entry_swallow"; } - } - } - part { name: "search_entry_swallow"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - min: SEARCH_ENTRY_WIDTH-10 40; - max: SEARCH_ENTRY_WIDTH-10 40; - fixed: 1 1; - rel1 { relative: 0 0; to: "search_swallow"; offset: 4 -4;} - rel2 { relative: 1 1; to: "search_swallow";} - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "search_opts_prev"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - color: 100 200 100 150; - visible: 0; - min: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - max: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - align: 0.0 0.0; - rel1 { relative: 1 0; to: "search_entry_swallow"; offset: 15 -9; } - rel2 { relative: 1 1; } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "search_opts_next"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - color: 100 100 200 150; - visible: 0; - min: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - max: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - align: 0.0 0.0; - rel1 { relative: 1 0; to: "search_opts_prev"; } - rel2 { relative: 1 1; } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "search_opts_case"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - min: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - max: OPT_BUTTON_WIDTH SEARCH_HEIGHT; - align: 0.0 0.0; - rel1 { relative: 1 0; to: "search_opts_next"; } - rel2 { relative: 1 1; } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "bg"; - target: "bg_clipper"; - target: "search_entry_swallow"; - target: "bg_search"; - target: "search_opts_case"; - target: "search_opts_next"; - target: "search_opts_prev"; - } - program { - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "bg"; - target: "bg_clipper"; - target: "search_entry_swallow"; - target: "bg_search"; - target: "search_opts_case"; - target: "search_opts_next"; - target: "search_opts_prev"; - } - } - } - group { - name: "elm/button/base/default_button"; - parts { - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - min: 150 40; - max: 150 40; - align: 0.5 0.5; - fixed: 1 1; - color: 225 225 225 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 225 225 225 255; - } - description { state: "focus" 0.0; - inherit: "visible" 0.0; - color: 69 143 255 255; - } - description { state: "dim" 0.0; - inherit: "visible" 0.0; - color: 225 225 225 102; - } - } - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.5; - min: 90 40; - max: 90 40; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 30 0;} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 89 89 89 0; - text { - text: "Next"; - font: "font_name"; - size: 30; - align: 0.5 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 89 89 89 255; - } - description { state: "focus" 0.0; - inherit: "visible" 0.0; - color: 255 255 255 255; - text.font: "Tizen:style=Bold"; - } - description { state: "dim" 0.0; - inherit: "visible" 0.0; - color: 89 89 89 102; - } - } - part { - name: "over"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 0 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over"; - action: STATE_SET "focus" 0.0; - target: "elm.text"; - target: "bg"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(!strcmp(st, "visible")) { - set_state(PART:"bg", "focus", 0.0); - set_state(PART:"elm.text", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "bg"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(!strcmp(st, "focus")) { - set_state(PART:"bg", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); - } - } - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "dim" 0.0; - target: "elm.text"; - target: "bg"; - } - program { - name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "bg"; - } - program { - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "bg"; - target: "elm.text"; - target: "over"; - } - program { - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR TRANSITION_VALUE; - target: "bg"; - target: "elm.text"; - target: "over"; - } - } - } -} \ No newline at end of file -- 2.7.4 From 42a0048dfdab872071171f6f92e6cb1e8742e61b Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Tue, 16 Jun 2015 09:49:48 +0900 Subject: [PATCH 03/16] Script files to build the reference browser Change-Id: Ib50f1c53f94c92d44b4e4531d1ef997a08562df7 Signed-off-by: sungwon2.han --- .gbs.conf | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ build.sh | 2 +- 2 files changed, 165 insertions(+), 1 deletion(-) create mode 100755 .gbs.conf diff --git a/.gbs.conf b/.gbs.conf new file mode 100755 index 0000000..6313a06 --- /dev/null +++ b/.gbs.conf @@ -0,0 +1,164 @@ +############################################### +# +# Tizen v3.0 for TV (arm-x11) +# +[obs.tizen] +url = https://api.tizen.org + +[profile.tztv_v3.0] +obs = obs.tizen +repos = repo.tv_arm-x11 +buildroot = ~/GBS-ROOT-3.0-TV + +[repo.tv_arm-x11] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/arm-x11/packages/ + +############################################### +# +# Tizen v3.0 for tv (emulator32-x11) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_emulator] +obs = obs.tizentv +repos = repo.tztv_v3.0_emul +buildroot = ~/GBS-ROOT-3.0-TV-EMUL + +[repo.tztv_v3.0_emul] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/emulator32-x11/packages/ + +############################################### +# +# Tizen v3.0 for tv (arm64-x11) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_arm64-x11] +obs = obs.tizentv +repos = repo.tztv_v3.0_arm64-x11 +buildroot = ~/GBS-ROOT-3.0-TV-arm64-x11 + +[repo.tztv_v3.0_arm64-x11] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/arm64-x11/packages/ + +############################################### +# +# Tizen v3.0 for tv (ia32-x11) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_ia32-x11] +obs = obs.tizentv +repos = repo.tztv_v3.0_ia32-x11 +buildroot = ~/GBS-ROOT-3.0-TV-ia32-x11 + +[repo.tztv_v3.0_ia32-x11] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/ia32-x11/packages/ + +############################################### +# +# Tizen v3.0 for tv (x86_64-x11) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_x86_64-x11] +obs = obs.tizentv +repos = repo.tztv_v3.0_x86_64-x11 +buildroot = ~/GBS-ROOT-3.0-TV-x86_64-x11 + +[repo.tztv_v3.0_x86_64-x11] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/x86_64-x11/packages/ + +############################################### +# +# Tizen v3.0 for TV (arm-wayland) +# +[obs.tizen] +url = https://api.tizen.org + +[profile.tztv_v3.0-wayland] +obs = obs.tizen +repos = repo.tv_arm-wayland +buildroot = ~/GBS-ROOT-3.0-TV-wayland + +[repo.tv_arm-wayland] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/arm-wayland/packages/ + +############################################### +# +# Tizen v3.0 for tv (emulator32-wayland) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_emulator-wayland] +obs = obs.tizentv +repos = repo.tztv_v3.0_emul-wayland +buildroot = ~/GBS-ROOT-3.0-TV-EMUL-wayland + +[repo.tztv_v3.0_emul-wayland] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/emulator32-wayland/packages/ + +############################################### +# +# Tizen v3.0 for tv (arm64-wayland) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_arm64-wayland] +obs = obs.tizentv +repos = repo.tztv_v3.0_arm64-wayland +buildroot = ~/GBS-ROOT-3.0-TV-arm64-wayland + +[repo.tztv_v3.0_arm64-wayland] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/arm64-wayland/packages/ + +############################################### +# +# Tizen v3.0 for mobile (arm64-wayland) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tzmo_v3.0_arm64-wayland] +obs = obs.tizentv +repos = repo.tzmo_v3.0_arm64-wayland +buildroot = ~/GBS-ROOT-3.0-MOBILE-arm64-wayland + +[repo.tzmo_v3.0_arm64-wayland] +url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/ + +############################################### +# +# Tizen v3.0 for tv (ia32-wayland) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_ia32-wayland] +obs = obs.tizentv +repos = repo.tztv_v3.0_ia32-wayland +buildroot = ~/GBS-ROOT-3.0-TV-ia32-wayland + +[repo.tztv_v3.0_ia32-wayland] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/ia32-wayland/packages/ + +############################################### +# +# Tizen v3.0 for tv (x86_64-wayland) +# +[obs.tizentv] +url = https://api.tizen.org + +[profile.tztv_v3.0_x86_64-wayland] +obs = obs.tizentv +repos = repo.tztv_v3.0_x86_64-wayland +buildroot = ~/GBS-ROOT-3.0-TV-x86_64-wayland + +[repo.tztv_v3.0_x86_64-wayland] +url = http://download.tizen.org/snapshots/tizen/tv/latest/repos/x86_64-wayland/packages/ diff --git a/build.sh b/build.sh index 4478e3a..b61fe4f 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -gbs -c .gbs.conf build -P tztv_v3.0 -A armv7l --include-all $@ +gbs -c .gbs.conf build -P tztv_v3.0-wayland -A armv7l --include-all $@ -- 2.7.4 From aa8269d97a8f9eca52623023a6b982680c7860da Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Mon, 22 Jun 2015 16:45:15 +0900 Subject: [PATCH 04/16] Modifying path for db files Browser crashes due to the error below. >> Error while starting transaction >> UNHANDLED EXCEPTION attempt to write a readonly database Platform only allows following path to access db files. >> /home/{ACCOUNT}/.applications/dbspace/ This patch supports multi-user mode and fixes the crash. However, this should be reverted later once multi-user db is supported via browser-provider. Change-Id: I2a2cf7d3956dbba37653b773b203706f866e96a9 Signed-off-by: Youngsoo Choi --- CMakeLists.txt | 1 - core/Config/Config.cpp | 14 +++++++++----- core/Config/ConfigValues.h.in | 1 - packaging/org.tizen.browser.spec | 16 ++-------------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cde5451..94aed0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 2.8) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(BINDIR "${PREFIX}/bin") SET(RESDIR "${PREFIX}/res" CACHE STRING "The path of resources") -SET(RESDBDIR "/opt${PREFIX}/res") SET(WEBKITDIR "/opt/usr/data/webkit" CACHE STRING "The path of web engine") SET(EDJE_DIR "${RESDIR}/edje/") SET(CERTS_DIR "${RESDIR}/certs/") diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index 3e274ea..2665734 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -16,6 +16,7 @@ #include "browser_config.h" #include "Config.h" +#include namespace tizen_browser { @@ -24,13 +25,16 @@ namespace config void DefaultConfig::load(const std::string &) { + const char *db_path = NULL; + db_path = tzplatform_getenv(TZ_USER_DB); + m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); m_data["favorite_service_name"] = std::string("org.tizen.browser.favoriteservice"); - m_data["DB_BOOKMARK"] = std::string("bookmark.db"); - m_data["DB_SETTINGS"] = std::string("settings.db"); - m_data["DB_HISTORY"] = std::string("history.db"); - m_data["DB_SESSION"] = std::string("session.db"); + m_data["DB_BOOKMARK"] = std::string(".browser.bookmark.db"); + m_data["DB_SETTINGS"] = std::string(".browser.settings.db"); + m_data["DB_HISTORY"] = std::string(".browser.history.db"); + m_data["DB_SESSION"] = std::string(".browser.session.db"); m_data["TOOLTIP_DELAY"] = 0.05; // time from mouse in to tooltip show m_data["TOOLTIP_HIDE_TIMEOUT"] = 2.0; // time from tooltip show to tooltip hide @@ -39,7 +43,7 @@ void DefaultConfig::load(const std::string &) # include "ConfigValues.h" - + m_data["resourcedb/dir"] = std::string(db_path)+"/"; } void DefaultConfig::store(const std::string & ) diff --git a/core/Config/ConfigValues.h.in b/core/Config/ConfigValues.h.in index ae28002..53fce72 100644 --- a/core/Config/ConfigValues.h.in +++ b/core/Config/ConfigValues.h.in @@ -1,5 +1,4 @@ //This is template file for configuration variables. m_data["services/dir"] = std::string("@CMAKE_INSTALL_PREFIX@/services"); m_data["resource/dir"] = std::string("@RESDIR@"); -m_data["resourcedb/dir"] = std::string("@RESDBDIR@/db/"); m_data["webkit/dir"] = std::string("@WEBKITDIR@"); diff --git a/packaging/org.tizen.browser.spec b/packaging/org.tizen.browser.spec index ffbba3b..66ddef9 100644 --- a/packaging/org.tizen.browser.spec +++ b/packaging/org.tizen.browser.spec @@ -35,7 +35,8 @@ BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(capi-network-connection) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libcurl) -BuildRequires: browser-provider-devel +BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: browser-provider-devel BuildRequires: cmake BuildRequires: edje-tools @@ -56,7 +57,6 @@ BuildRequires: pkgconfig(dlog) %define _appdir /usr/apps/%{name} %define _bindir %{_appdir}/bin -%define _appdatadir /opt/usr/apps/%{name} %define COVERAGE_STATS %{?coverage_stats:ON}%{!?coverage_stats:OFF} %define _manifestdir /usr/share/packages @@ -98,23 +98,11 @@ cd %{_build_dir} %post -#Prepare files -if [ ! -f %{_appdatadir}/res/db/bookmark.db ]; -then - mkdir -p %{_appdatadir}/res/db - chsmack -a "dtv-org.tizen.browser" %{_appdatadir}/res/db - sqlite3 %{_appdatadir}/res/db/bookmark.db '' - chsmack -a "dtv-org.tizen.browser" %{_appdatadir}/res/db/bookmark.db -fi - mkdir -p /opt/usr/data/webkit/storage mkdir -p /opt/usr/data/webkit/favicon #Change ownership and privileges -chown -R 5000:5000 %{_appdatadir}/res/db chown -R 5000:5000 /opt/usr/data/webkit -chmod -R 777 %{_appdatadir}/res/db -chmod 777 %{_appdatadir}/res/db/bookmark.db chmod -R 660 /opt/usr/data/webkit %files -- 2.7.4 From c3d5d61f316279c6b1aed481337368ca588628d4 Mon Sep 17 00:00:00 2001 From: Gajendra N Date: Fri, 26 Jun 2015 14:13:58 +0530 Subject: [PATCH 05/16] fixup! Unable to delete all history items. 1) Fixes popup button not disabled on deleting last item. 2) Shows proper date and time. Change-Id: I323fdd6a6e7871f153c68f7c10d8587638a1de28 --- services/HistoryService/HistoryService.h | 1 + services/HistoryService/src/HistoryService.cpp | 66 ++++++++++++++++++++++---- services/SimpleUI/SimpleUI.cpp | 1 + 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/services/HistoryService/HistoryService.h b/services/HistoryService/HistoryService.h index e92cf5d..0e09cab 100644 --- a/services/HistoryService/HistoryService.h +++ b/services/HistoryService/HistoryService.h @@ -43,6 +43,7 @@ public: virtual ~HistoryService(); virtual std::string getName(); + int getHistoryId(const std::string & url); /** * @throws HistoryException on error */ diff --git a/services/HistoryService/src/HistoryService.cpp b/services/HistoryService/src/HistoryService.cpp index a377bf1..5aff218 100644 --- a/services/HistoryService/src/HistoryService.cpp +++ b/services/HistoryService/src/HistoryService.cpp @@ -17,12 +17,16 @@ #include #include #include +#include +#include +#include #include "ServiceManager.h" #include "HistoryService.h" #include "HistoryItem.h" #include "AbstractWebEngine.h" #include "EflTools.h" + namespace tizen_browser { namespace services @@ -60,8 +64,7 @@ void HistoryService::setStorageServiceTestMode(bool testmode) { } int HistoryService::getHistoryItemsCount(){ - return 1; - //return getStorageManager()->getHistoryItemsCount(); + return history_list.size(); } static int __get_duplicated_ids_p(int **ids, int *count, const int limit, const int offset, @@ -122,11 +125,12 @@ void HistoryService::addHistoryItem(std::shared_ptr his){ bp_history_adaptor_set_url(id, (his->getUrl()).c_str()); bp_history_adaptor_set_title(id, (his->getTitle()).c_str()); - + bp_history_adaptor_set_date_visited(id,-1); std::unique_ptr favicon_blob = tizen_browser::tools::EflTools::getBlobPNG(favicon); unsigned char * fav = std::move((unsigned char*)favicon_blob->getData()); bp_history_adaptor_set_icon(id, favicon->width, favicon->height, fav, favicon_blob->getLength()); + history_list.push_back(his); BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); } @@ -141,7 +145,28 @@ void HistoryService::insertOrRefresh(std::shared_ptr hi) { */ void HistoryService::clearAllHistory() { - getStorageManager()->deleteHistory(); + bp_history_adaptor_reset(); + history_list.clear(); +} + +int HistoryService::getHistoryId(const std::string & url) +{ + bp_history_rows_cond_fmt conds; + conds.limit = -1; + conds.offset = 0; + conds.order_offset = BP_HISTORY_O_DATE_CREATED; + conds.ordering = 0; + conds.period_offset = BP_HISTORY_O_DATE_CREATED; + conds.period_type = BP_HISTORY_DATE_ALL; + int *ids = 0; + int ids_count = 0; + int ret = bp_history_adaptor_get_cond_ids_p(&ids ,&ids_count, &conds, BP_HISTORY_O_URL, url.c_str(), 0); + if (ids_count!=0){ + int i = *ids; + free(ids); + return i; + } + return 0; } /** @@ -149,9 +174,12 @@ void HistoryService::clearAllHistory() */ void HistoryService::clearURLHistory(const std::string & url) { - getStorageManager()->deleteHistory(url); - if(0 == getHistoryItemsCount()){ - historyEmpty(true); + int id = getHistoryId(url); + if (id != 0) + bp_history_adaptor_delete(id); + if (0 == (getHistoryItemsCount() - 1)) { + historyEmpty(true); + history_list.clear(); } } @@ -182,13 +210,35 @@ HistoryItemVector& HistoryService::getHistoryItems(int historyDepthInDays, int m BROWSER_LOGD("Error! Could not get ids!"); } - bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON); + bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_CREATED); for(int i = 0; i< (*count1); i++){ bp_history_info_fmt history_info; bp_history_adaptor_get_info(ids[i],offset,&history_info); + int date; + bp_history_adaptor_get_date_created(ids[i], &date); + + struct tm *item_time_info; + time_t item_time = (time_t)date; + item_time_info = localtime(&item_time); + + int m_year = item_time_info->tm_year; + int m_month = item_time_info->tm_mon + 1; + int m_day = item_time_info->tm_yday; + int m_month_day = item_time_info->tm_mday; + int m_date = date; + int min = item_time_info->tm_min; + int hour= item_time_info->tm_hour; + int sec = item_time_info->tm_sec; + m_year = 2000 + m_year % 100; + std::shared_ptr history = std::make_shared(std::string(history_info.url)); + boost::gregorian::date d(m_year,m_month,m_month_day); + boost::posix_time::ptime t(d,boost::posix_time::time_duration(hour,min,sec)); + history->setLastVisit(t); + history->setUrl(std::string(history_info.url ? history_info.url : "")); + history->setTitle(std::string(history_info.title ? history_info.title : "")); history_list.push_back(history); } ids = NULL; diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 3b6ee0d..a25ef5d 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -978,6 +978,7 @@ void SimpleUI::disableHistoryButton(bool flag) { BROWSER_LOGD("[%s:%d] flag:%d ", __PRETTY_FUNCTION__, __LINE__, flag); m_history->setEnabled(!flag); + m_settingDeleteHistory->setEnabled(m_historyService->getHistoryItemsCount()); hidePopup(); } -- 2.7.4 From d1cea92b3c285b651f1ea525acc8c62317f5a449 Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Tue, 30 Jun 2015 21:37:15 +0900 Subject: [PATCH 06/16] 1) Fixed a crash of adding bookmark. (Added null checking) 2) Added privilege for using browser-provider Change-Id: I2c9c8b4208e9d1ff7b951419fad15ed404a170bb Signed-off-by: Jung Ick Guack --- manifest.xml.in | 4 ++++ services/BookmarkService/BookmarkService.cpp | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/manifest.xml.in b/manifest.xml.in index b8756da..8c4c7f1 100644 --- a/manifest.xml.in +++ b/manifest.xml.in @@ -73,4 +73,8 @@ + + http://tizen.org/privilege/bookmark.admin + http://tizen.org/privilege/history.admin + diff --git a/services/BookmarkService/BookmarkService.cpp b/services/BookmarkService/BookmarkService.cpp index 2fd0bf7..99b14e2 100644 --- a/services/BookmarkService/BookmarkService.cpp +++ b/services/BookmarkService/BookmarkService.cpp @@ -97,14 +97,16 @@ std::shared_ptr BookmarkService::addToBookmarks( bp_bookmark_adaptor_set_url(bookmark_id, address.c_str()); bp_bookmark_adaptor_set_title(bookmark_id, tittle.c_str()); - - std::unique_ptr thumb_blob = tizen_browser::tools::EflTools::getBlobPNG(thumbnail); - unsigned char * thumb = std::move((unsigned char*)thumb_blob->getData()); - bp_bookmark_adaptor_set_snapshot(bookmark_id, thumbnail->width, thumbnail->height, thumb, thumb_blob->getLength()); - - std::unique_ptr favicon_blob = tizen_browser::tools::EflTools::getBlobPNG(favicon); - unsigned char * fav = std::move((unsigned char*)favicon_blob->getData()); - bp_bookmark_adaptor_set_icon(bookmark_id, favicon->width, favicon->height, fav, favicon_blob->getLength()); + if (thumbnail) { + std::unique_ptr thumb_blob = tizen_browser::tools::EflTools::getBlobPNG(thumbnail); + unsigned char * thumb = std::move((unsigned char*)thumb_blob->getData()); + bp_bookmark_adaptor_set_snapshot(bookmark_id, thumbnail->width, thumbnail->height, thumb, thumb_blob->getLength()); + } + if (favicon) { + std::unique_ptr favicon_blob = tizen_browser::tools::EflTools::getBlobPNG(favicon); + unsigned char * fav = std::move((unsigned char*)favicon_blob->getData()); + bp_bookmark_adaptor_set_icon(bookmark_id, favicon->width, favicon->height, fav, favicon_blob->getLength()); + } m_bookmarks.push_back(bookmark); BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -- 2.7.4 From 8d99569cc11767afa8c7fd7cda7289bb5c32d3cc Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Thu, 2 Jul 2015 09:43:32 +0900 Subject: [PATCH 07/16] Changed "opengl" to "3d" on elm_config_accel_preference_set Change-Id: I227e313d22ffaf5b5294da53bbf232d1943cd4f7 Signed-off-by: Jung Ick Guack --- core/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 core/main.cpp diff --git a/core/main.cpp b/core/main.cpp old mode 100644 new mode 100755 index f435d7e..9342b05 --- a/core/main.cpp +++ b/core/main.cpp @@ -38,7 +38,8 @@ const std::string DEFAULT_URL = ""; static bool app_create(void * /*app_data*/) { - elm_config_accel_preference_set("opengl"); +// elm_config_accel_preference_set("opengl"); + elm_config_accel_preference_set("3d"); elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK); // Enabling focus -- 2.7.4 From c55051a1a252e538fd50bdc07fcf17713464a3a1 Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Thu, 2 Jul 2015 09:44:48 +0900 Subject: [PATCH 08/16] Fixed app service is not working during runtime. Change-Id: Ie0ed329ba8449debae7e5d81372097b15c62957e Signed-off-by: Jung Ick Guack --- services/SimpleUI/SimpleUI.cpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index a25ef5d..f2567ba 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -294,26 +294,27 @@ int SimpleUI::exec(const std::string& _url) } m_initialised = true; - // only when first run - if (url.empty()) { - BROWSER_LOGD("[%s]: changing to homeUrl", __func__); - switchViewToHomePage(); - filterURL(HomePageURL); - if(lastSession.items().size() >= 1){ - for(auto iter=lastSession.items().begin(), - end=lastSession.items().end(); - iter != end; - iter++ - ){ - openNewTab(iter->second); - } - m_sessionService->getStorage()->deleteSession(lastSession); - } - } - else - openNewTab(url); } + // only when first run + if (url.empty()) { + BROWSER_LOGD("[%s]: changing to homeUrl", __func__); + switchViewToHomePage(); + filterURL(HomePageURL); + if(lastSession.items().size() >= 1){ + for(auto iter=lastSession.items().begin(), + end=lastSession.items().end(); + iter != end; + iter++ + ){ + openNewTab(iter->second); + } + m_sessionService->getStorage()->deleteSession(lastSession); + } + } + else + openNewTab(url); + BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str()); m_simpleURI->setFocus(); -- 2.7.4 From bf8072a5a99133eea135c87d65559ed750dfde72 Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Thu, 2 Jul 2015 22:08:01 +0900 Subject: [PATCH 09/16] 1) Getting favicon by proper API. 2) Enabling create new tab by tag target attribute. - Removed smart class, Using smart callback 3) Changed toast text when delete data from setting 4) Not set user agent by full string, just set applicatino name for UA 5) Disabled function of private browsing Change-Id: I712044d64b791f28cd9608e876ba9472e8a08300 Signed-off-by: Jung Ick Guack --- services/SimpleUI/SimpleUI.cpp | 4 +-- services/WebKitEngineService/WebView.cpp | 58 ++++++++++++++++++++++++++------ services/WebKitEngineService/WebView.h | 1 + 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index f2567ba..7e514cc 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -422,7 +422,7 @@ void SimpleUI::connectActions() m_showSettingsPopup->triggered.connect(boost::bind(&SimpleUI::showSettingsMenu, this)); // m_settingPointerMode->toggled.connect(boost::bind(&tizen_browser::services::PlatformInputManager::setPointerModeEnabled, m_platformInputManager.get(), _1)); - m_settingPrivateBrowsing->toggled.connect(boost::bind(&SimpleUI::settingsPrivateModeSwitch, this, _1)); +// m_settingPrivateBrowsing->toggled.connect(boost::bind(&SimpleUI::settingsPrivateModeSwitch, this, _1)); m_settingDeleteHistory->triggered.connect(boost::bind(&SimpleUI::settingsDeleteHistory, this)); m_settingDeleteData->triggered.connect(boost::bind(&SimpleUI::settingsDeleteData, this));; m_settingDeleteFavorite->triggered.connect(boost::bind(&SimpleUI::settingsDeleteFavorite, this));; @@ -1061,7 +1061,7 @@ void SimpleUI::onDeleteDataButton(PopupButtons button, std::shared_ptr< PopupDat BROWSER_LOGD("[%s]: OK", __func__); m_webEngine->clearPrivateData(); webTitleBar->removeFavIcon(); - webTitleBar->show("Data deleted"); + webTitleBar->show("All cookies and cache are deleted"); hidePopup(); } } diff --git a/services/WebKitEngineService/WebView.cpp b/services/WebKitEngineService/WebView.cpp index 963e192..75ea343 100644 --- a/services/WebKitEngineService/WebView.cpp +++ b/services/WebKitEngineService/WebView.cpp @@ -46,6 +46,7 @@ #include "ServiceManager.h" #define certificate_crt_path CERTS_DIR +#define APPLICATION_NAME_FOR_USER_AGENT "SamsungBrowser/1.0" using namespace tizen_browser::tools; @@ -75,6 +76,8 @@ WebView::~WebView() void WebView::init(Evas_Object * opener) { #if defined(USE_EWEBKIT) + +#if 0 //not using smart class static Ewk_View_Smart_Class *clasz = NULL; Ewk_Context *context = ewk_context_default_get(); if (!clasz) { @@ -84,13 +87,11 @@ void WebView::init(Evas_Object * opener) // clasz->run_javascript_alert = onJavascriptAlert; // clasz->run_javascript_confirm = onJavascriptConfirm; // clasz->run_javascript_prompt = onJavascriptPrompt; -// clasz->window_create = onWindowCreate; -// clasz->window_close = onWindowClose; - + clasz->window_create = onWindowCreate; + clasz->window_close = onWindowClose; ewk_context_cache_model_set(context, EWK_CACHE_MODEL_PRIMARY_WEBBROWSER); ewk_context_certificate_file_set(context, certificate_crt_path); - } Evas_Smart *smart = evas_smart_class_new(&clasz->sc); @@ -98,8 +99,12 @@ void WebView::init(Evas_Object * opener) /// \todo: Consider process model. Now, One UIProcess / One WebProcess. // if (opener) // m_ewkView = ewk_view_smart_add(evas_object_evas_get(m_parent), smart, context, ewk_view_page_group_get(opener)); -// else + else m_ewkView = ewk_view_smart_add(evas_object_evas_get(m_parent), smart, context, ewk_page_group_create(NULL)); +#else + m_ewkView = ewk_view_add(evas_object_evas_get(m_parent)); +// Ewk_Context *context = ewk_view_context_get(m_ewkView); +#endif evas_object_data_set(m_ewkView, "_container", this); BROWSER_LOGD("%s:%d %s self=%p", __FILE__, __LINE__, __func__, this); @@ -107,14 +112,14 @@ void WebView::init(Evas_Object * opener) evas_object_color_set(m_ewkView, 255, 255, 255, 255); evas_object_size_hint_weight_set(m_ewkView, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_ewkView, EVAS_HINT_FILL, EVAS_HINT_FILL); - ewk_view_user_agent_set(m_ewkView, "Mozilla/5.0 (X11; SMART-TV; Linux) AppleWebkit/538.1 (KHTML, like Gecko) Safari/538.1"); + ewk_view_application_name_for_user_agent_set(m_ewkView, APPLICATION_NAME_FOR_USER_AGENT); //\todo: when value is other than 1.0, scroller is located improperly // ewk_view_device_pixel_ratio_set(m_ewkView, 1.0f); #if PLATFORM(TIZEN) ewk_view_resume(m_ewkView); #endif - +#if 0 // set local storage, favion, cookies std::string webkit_path = boost::any_cast (config.get("webkit/dir")); // ewk_context_web_storage_path_set(context, (webkit_path + std::string("/storage")).c_str()); @@ -127,7 +132,7 @@ void WebView::init(Evas_Object * opener) // ewk_cookie_manager_widget_cookie_directory_set(ewk_context_cookie_manager_get(context), webkit_path.c_str()); ewk_favicon_database_icon_change_callback_add(ewk_context_favicon_database_get(context), __faviconChanged, this); - +#endif setupEwkSettings(); registerCallbacks(); #else @@ -149,6 +154,8 @@ void WebView::registerCallbacks() evas_object_smart_callback_add(m_ewkView, "back,forward,list,changed", __backForwardListChanged, this); + evas_object_smart_callback_add(m_ewkView, "create,window", __OnNewWindowRequest, this); + evas_object_smart_callback_add(m_ewkView, "geolocation,permission,request", __geolocationPermissionRequest, this); evas_object_smart_callback_add(m_ewkView, "usermedia,permission,request", __usermediaPermissionRequest, this); evas_object_smart_callback_add(m_ewkView, "notification,permission,request", __notificationPermissionRequest, this); @@ -177,6 +184,8 @@ void WebView::unregisterCallbacks() evas_object_smart_callback_del_full(m_ewkView, "back,forward,list,changed", __backForwardListChanged, this); + evas_object_smart_callback_del_full(m_ewkView, "create,window", __OnNewWindowRequest, this); + evas_object_smart_callback_del_full(m_ewkView, "geolocation,permission,request", __geolocationPermissionRequest, this); evas_object_smart_callback_del_full(m_ewkView, "usermedia,permission,request", __usermediaPermissionRequest, this); evas_object_smart_callback_del_full(m_ewkView, "notification,permission,request", __notificationPermissionRequest, this); @@ -712,6 +721,30 @@ void WebView::__backForwardListChanged(void * data, Evas_Object * /* obj */, voi self->forwardEnableChanged(self->isForwardEnabled()); } +void WebView::__OnNewWindowRequest(void *data, Evas_Object*, void* out) +{ + BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); + + WebView * self = reinterpret_cast(data); + BROWSER_LOGD("Window creating in tab: %s", self->getTabId().toString().c_str()); + + std::shared_ptr> m_webEngine; + m_webEngine = std::dynamic_pointer_cast + < + basic_webengine::AbstractWebEngine,tizen_browser::core::AbstractService + > + (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.webkitengineservice")); + M_ASSERT(m_webEngine); + + /// \todo: Choose newly created tab. + TabId id = m_webEngine->addTab(std::string(), &self->getTabId()); + BROWSER_LOGD("Created tab: %s", id.toString().c_str()); + + Evas_Object* tab_ewk_view = m_webEngine->getTabView(id); + *static_cast(out) = tab_ewk_view; +} + + #if PLATFORM(TIZEN) void WebView::__faviconChanged(const char * uri, void * data) #else @@ -965,12 +998,15 @@ std::shared_ptr WebView::getFavicon() { #if defined(USE_EWEBKIT) if (faviconImage.get() == NULL) { -//#if PLATFORM(TIZEN) + +#if PLATFORM(TIZEN) // Evas_Object * favicon = ewk_view_favicon_get(m_ewkView); -//#else + Evas_Object * favicon = ewk_context_icon_database_icon_object_add(ewk_view_context_get(m_ewkView), ewk_view_url_get(m_ewkView),evas_object_evas_get(m_ewkView)); +#else Ewk_Favicon_Database * database = ewk_context_favicon_database_get(ewk_view_context_get(m_ewkView)); Evas_Object * favicon = ewk_favicon_database_icon_get(database, ewk_view_url_get(m_ewkView), evas_object_evas_get(m_ewkView)); -//#endif +#endif + #ifndef NDEBUG int w = 0, h = 0; evas_object_image_size_get(favicon, &w, &h); diff --git a/services/WebKitEngineService/WebView.h b/services/WebKitEngineService/WebView.h index 0b6b504..ce6233d 100644 --- a/services/WebKitEngineService/WebView.h +++ b/services/WebKitEngineService/WebView.h @@ -165,6 +165,7 @@ private: static void __urlChanged(void * data, Evas_Object * obj, void * event_info); static void __backForwardListChanged(void * data, Evas_Object * obj, void * event_info); + static void __OnNewWindowRequest(void *data, Evas_Object*, void* out); // Favicon - from database #if defined(USE_EWEBKIT) -- 2.7.4 From a16dfb0bd899bd791f1aff1eebc501b2a3153a45 Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Thu, 2 Jul 2015 22:23:14 +0900 Subject: [PATCH 10/16] Release 0.0.9 Change-Id: I8d0ec64259ef4e777885a88cbb589a810d0a52c4 Signed-off-by: Jung Ick Guack --- packaging/org.tizen.browser.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.browser.spec b/packaging/org.tizen.browser.spec index 66ddef9..44c7454 100644 --- a/packaging/org.tizen.browser.spec +++ b/packaging/org.tizen.browser.spec @@ -1,6 +1,6 @@ Name: org.tizen.browser Summary: Tizen TV Open Browser -Version: 0.0.8 +Version: 0.0.9 Release: 0 Group: Applications/Web License: Apache-2.0 -- 2.7.4 From efd182a79d7c101a9a673a27c02f1d4331fdd373 Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Mon, 6 Jul 2015 15:37:14 +0900 Subject: [PATCH 11/16] Change to use wayland functions instead of x functions ecore_x_window_size_get --> ecore_wl_screen_size_get Change-Id: Ib72381ba8e5e515126afe3db2c83d964c0ccd563 Signed-off-by: sungwon2.han --- services/SimpleUI/SimpleUI.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 7e514cc..25e1648 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include "Config.h" @@ -115,11 +116,12 @@ int SimpleUI::exec(const std::string& _url) elm_win_alpha_set(m_window.get(), EINA_FALSE); // creatin main window - //int width = 1920; - //int height = 1080; + int width = 0; + int height = 0; //ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height); - //evas_object_move(m_window.get(), 0, 0); - //evas_object_resize(m_window.get(), width, height); + ecore_wl_screen_size_get(&width, &height); + evas_object_move(m_window.get(), 0, 0); + evas_object_resize(m_window.get(), width, height); // create main layout m_mainLayout = elm_layout_add(m_window.get()); -- 2.7.4 From fcd845fabd9482713d888d0303b221a7428a0ee0 Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Mon, 6 Jul 2015 17:59:07 +0900 Subject: [PATCH 12/16] Temporarily comment out "Back key" process routine Change-Id: I29a9b4ba24a02d78e33c7fc88447187eed59e89c Signed-off-by: sungwon2.han --- services/PlatformInputManager/PlatformInputManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/PlatformInputManager/PlatformInputManager.cpp b/services/PlatformInputManager/PlatformInputManager.cpp index b4c6925..e7cc333 100644 --- a/services/PlatformInputManager/PlatformInputManager.cpp +++ b/services/PlatformInputManager/PlatformInputManager.cpp @@ -170,8 +170,8 @@ Eina_Bool PlatformInputManager::__filter(void *data, void */*loop_data*/, int ty self->rightPressed(); else if(!keyName.compare("KEY_ENTER")) self->enterPressed(); - else if(!keyName.compare("BackSpace")) - self->backPressed(); +// else if(!keyName.compare("BackSpace")) +// self->backPressed(); } else if(type == ECORE_EVENT_KEY_UP) { M_ASSERT(event); Ecore_Event_Key *ev = static_cast(event); -- 2.7.4 From 9dff14d6598e027d47bc2d8de39eccbd88d90c89 Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Tue, 7 Jul 2015 13:50:54 +0900 Subject: [PATCH 13/16] Delete "Private Browsing" menu item from "Settings" Change-Id: Ifb7a23d1bbc618469f055054188e5bc51f0bcc59 Signed-off-by: sungwon2.han --- services/SimpleUI/SimpleUI.cpp | 4 +++- services/SimpleUI/SimpleUI.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 25e1648..11dd807 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -388,11 +388,13 @@ void SimpleUI::createActions() m_settingPointerMode->setChecked(m_platformInputManager->getPointerModeEnabled()); m_settingPointerMode->setEnabled(true); */ +/* m_settingPrivateBrowsing = sharedAction(new Action("Private browsing")); m_settingPrivateBrowsing->setToolTip("On exit from private mode all cookies, history, and stored data will be deleted"); m_settingPrivateBrowsing->setCheckable(true); m_settingPrivateBrowsing->setChecked(m_webEngine->isPrivateMode()); m_settingPrivateBrowsing->setEnabled(true); +*/ m_settingDeleteHistory = sharedAction(new Action("Delete history")); m_settingDeleteHistory->setToolTip("Delete History"); @@ -943,7 +945,7 @@ void SimpleUI::showSettingsMenu() m_settings = std::make_shared(m_window, rightButtonBar->getButton("setting_button")); //m_settings->addAction( m_settingPointerMode); - m_settings->addAction( m_settingPrivateBrowsing); + //m_settings->addAction( m_settingPrivateBrowsing); m_settings->addAction( m_settingDeleteHistory); m_settings->addAction( m_settingDeleteData); m_settings->addAction( m_settingDeleteFavorite); diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 793f87e..5c5f736 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -146,7 +146,7 @@ private: sharedAction m_zoom_in; sharedAction m_showSettingsPopup; sharedAction m_settingPointerMode; - sharedAction m_settingPrivateBrowsing; +// sharedAction m_settingPrivateBrowsing; sharedAction m_settingDeleteHistory; sharedAction m_settingDeleteData; sharedAction m_settingDeleteFavorite; -- 2.7.4 From 62504c62a996bff27364d3647ced0a2ea022ac15 Mon Sep 17 00:00:00 2001 From: "sungwon2.han" Date: Tue, 7 Jul 2015 14:23:30 +0900 Subject: [PATCH 14/16] Change text wrap type of popup object from CHAR to WORD Change-Id: Ib47aa1c143aca49c0fe079383efc77e0aaaacf68 Signed-off-by: sungwon2.han --- services/SimpleUI/SimplePopup.cpp | 2 +- services/SimpleUI/SimpleUI.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/SimpleUI/SimplePopup.cpp b/services/SimpleUI/SimplePopup.cpp index f732b78..363e905 100644 --- a/services/SimpleUI/SimplePopup.cpp +++ b/services/SimpleUI/SimplePopup.cpp @@ -48,7 +48,7 @@ namespace base_ui else elm_object_text_set(popup, message.c_str()); - elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_CHAR); + elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_WORD); elm_object_part_text_set(popup, "title,text", title.c_str()); int buttonsCounter = 1; diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 11dd807..ef0d403 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -1054,7 +1054,7 @@ void SimpleUI::onDeleteHistoryButton(PopupButtons button, std::shared_ptr< Popup m_historyService->clearAllHistory(); m_history->setEnabled(false); webTitleBar->removeFavIcon(); - webTitleBar->show("History deleted"); + webTitleBar->show("All histories are deleted"); hidePopup(); } } -- 2.7.4 From 5a46456b251233e8cb1e9bbbe2582ec93ecd7150 Mon Sep 17 00:00:00 2001 From: Jung Ick Guack Date: Thu, 9 Jul 2015 10:18:46 +0900 Subject: [PATCH 15/16] Fixed privilege for web-history.admin Change-Id: I3c3c35421d7bb229af00e283e4686eafde7268a4 Signed-off-by: Jung Ick Guack --- manifest.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.xml.in b/manifest.xml.in index 8c4c7f1..830ea63 100644 --- a/manifest.xml.in +++ b/manifest.xml.in @@ -75,6 +75,6 @@ http://tizen.org/privilege/bookmark.admin - http://tizen.org/privilege/history.admin + http://tizen.org/privilege/web-history.admin -- 2.7.4 From 9cb571cfab95739c8ae6413e32b62558d499ad00 Mon Sep 17 00:00:00 2001 From: "t.dakowicz" Date: Thu, 30 Jul 2015 11:24:24 +0200 Subject: [PATCH 16/16] Bug TT-81 Changed URL validation regex [Issue#] https://bugs.tizen.org/jira/browse/TT-81 [Problem] Browser tries to navigate to malformed URLs instead of putting them into search engine query [Solution] Corrected the regex [Verify] Check if URLs with spaces are put into Google's search query Change-Id: Ic49cfa498194cf878bab70007a7dae8ada53708e --- services/SimpleURI/SimpleURI.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/services/SimpleURI/SimpleURI.cpp b/services/SimpleURI/SimpleURI.cpp index 104cfc2..d92c64e 100644 --- a/services/SimpleURI/SimpleURI.cpp +++ b/services/SimpleURI/SimpleURI.cpp @@ -254,25 +254,21 @@ void SimpleURI::editingCompleted() std::string SimpleURI::rewriteURI(const std::string& url) { - BROWSER_LOGD("%s: %s", __PRETTY_FUNCTION__, url.c_str()); - - //regx form site http://code.tutsplus.com/tutorials/8-regular-expressions-you-should-know--net-6149 - //it matches urls with https? sufix or without it - boost::regex urlRegex(R"(^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$)"); - boost::regex protocolRegex(R"(^https?:\/\/)"); - + boost::regex urlRegex(R"(^(https?|ftp)://[^\s/$.?#].[^\s]*$)"); if(!url.empty()) { - if(url != "about:blank" && url != "about:home" && !boost::regex_search(url, protocolRegex)) { - if(!boost::regex_match(url, urlRegex)) { - std::string searchString("https://www.google.pl/search?q="); /* this seems to work better than https://www.google.pl/#q= on current WebKit engine */ + if(url != "about:blank" && url != "about:home") { + if(boost::regex_match(url, urlRegex)) { + return url; + } else if(boost::regex_match( std::string("http://") + url, urlRegex) && url.find(".") != std::string::npos) { + return std::string("http://") + url; + } else { + std::string searchString("http://www.google.com/#q="); searchString += url; std::replace( searchString.begin(), searchString.end(), ' ', '+'); - BROWSER_LOGD("[%s:%d] Rewrited search string: %s", __PRETTY_FUNCTION__, __LINE__, searchString.c_str()); - return searchString; - } else { - return std::string("http://") + url; + BROWSER_LOGD("[%s:%d] Search string: %s", __PRETTY_FUNCTION__, __LINE__, searchString.c_str()); + return searchString; } } } -- 2.7.4