Ewk_Autofill_Profile_Data_Type name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(profile, 0);
- return (profile->getData(DataType(name)).empty()) ?
- NULL : profile->getData(DataType(name)).c_str();
+ std::string retVal = profile->getData(DataType(name));
+ return (retVal.empty()) ?
+ NULL : strdup(retVal.c_str());
}
#include <../impl/browser_context_efl.h>
#include <../impl/http_user_agent_settings_efl.h>
#include <../impl/API/ewk_cookie_manager_private.h>
-#if !defined(EWK_BRINGUP)
#include <../impl/API/ewk_context_form_autofill_profile_private.h>
-#endif
#include <tizen_webview/public/tw_security_origin.h>
#include <tizen_webview/public/tw_web_context.h>
if (NULL == context) {
return NULL;
}
-#if !defined(EWK_BRINGUP)
return EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get_all(context);
-#else
- LOG_EWK_API_MOCKUP();
- return NULL;
-#endif
}
Ewk_Autofill_Profile* ewk_context_form_autofill_profile_get(Ewk_Context* context, unsigned id)
if (NULL == context) {
return NULL;
}
-#if !defined(EWK_BRINGUP)
return EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get(context, id);
-#else
- LOG_EWK_API_MOCKUP();
- return NULL;
-#endif
}
Eina_Bool ewk_context_form_autofill_profile_set(Ewk_Context* context, unsigned id, Ewk_Autofill_Profile* profile)
if (NULL == context || NULL == profile) {
return EINA_FALSE;
}
-#if !defined(EWK_BRINGUP)
return EwkContextFormAutofillProfileManager::priv_form_autofill_profile_set(context, id, profile);
-#else
- LOG_EWK_API_MOCKUP();
- return NULL;
-#endif
}
Eina_Bool ewk_context_form_autofill_profile_add(Ewk_Context* context, Ewk_Autofill_Profile* profile)
if (NULL == context || NULL == profile) {
return EINA_FALSE;
}
-#if !defined(EWK_BRINGUP)
return EwkContextFormAutofillProfileManager::priv_form_autofill_profile_add(context, profile);
-#else
- LOG_EWK_API_MOCKUP();
- return NULL;
-#endif
}
Eina_Bool ewk_context_form_autofill_profile_remove(Ewk_Context* context, unsigned id)
if (NULL == context) {
return EINA_FALSE;
}
-#if !defined(EWK_BRINGUP)
return EwkContextFormAutofillProfileManager::priv_form_autofill_profile_remove(context, id);
-#else
- LOG_EWK_API_MOCKUP();
- return NULL;
-#endif
}
void ewk_context_vibration_client_callbacks_set(Ewk_Context* context,
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ewk_autofill_profile_private.h"
+#include <sstream>
-unsigned _Ewk_Autofill_Profile::s_currentID = 0;
+#include "ewk_autofill_profile_private.h"
_Ewk_Autofill_Profile::_Ewk_Autofill_Profile() {
- m_profileID = s_currentID;
- ++s_currentID;
+ m_profileID_ = 0;
+ m_data[PROFILE_ID] = "0";
}
_Ewk_Autofill_Profile::~_Ewk_Autofill_Profile() {
}
unsigned _Ewk_Autofill_Profile::getProfileID() const {
- return m_profileID;
+ return m_profileID_;
}
std::string _Ewk_Autofill_Profile::getData(
DataType name) const {
- const AutofillDataMap::const_iterator it = m_data.find(name);
+ AutofillDataMap::const_iterator it = m_data.find(name);
+ if (it != m_data.end())
+ return (*it).second;
+ return "";
+}
- return (it != m_data.end()) ? (*it).second : std::string();
+base::string16 _Ewk_Autofill_Profile::get16Data(
+ DataType name) const {
+ std::string value = getData(name);
+ return base::string16(value.begin(), value.end());
}
void _Ewk_Autofill_Profile::setData(DataType name,
const std::string& value) {
+ if (PROFILE_ID == name) {
+ std::stringstream stream;
+ stream << value;
+ stream >> m_profileID_;
+ }
m_data[name] = value;
}
#ifndef EWK_AUTOFILL_PROFILE_PRIVATE_H_
#define EWK_AUTOFILL_PROFILE_PRIVATE_H_
-#include <string>
#include <map>
+#include <string>
+
+#include "base/strings/utf_string_conversions.h"
enum DataType {
PROFILE_ID = 0,
};
class _Ewk_Autofill_Profile {
-public:
+ public:
_Ewk_Autofill_Profile();
~_Ewk_Autofill_Profile();
unsigned getProfileID() const;
std::string getData(DataType name) const;
+ base::string16 get16Data(DataType name) const;
void setData(DataType name, const std::string& value);
-private:
- static unsigned s_currentID;
- unsigned m_profileID;
+ private:
+ unsigned m_profileID_;
AutofillDataMap m_data;
};
--- /dev/null
+// Copyright 2014 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ewk_context_form_autofill_profile_private.h"
+
+#include <vector>
+#include <string>
+#include <sstream>
+#include <Eina.h>
+
+#include "browser/autofill/personal_data_manager_factory.h"
+#include "components/autofill/core/browser/personal_data_manager.h"
+#include "eweb_view.h"
+#include "ewk_autofill_profile_private.h"
+
+template <class T>
+std::string to_string(T value) {
+ std::stringstream out;
+ out << value;
+ return out.str();
+};
+
+namespace autofill {
+class PersonalDataManagerFactory;
+std::string hash_string(const char *str) {
+ unsigned val = 0;
+ for (unsigned i = 0; str[i]; i++)
+ val = (val << 3) + static_cast<unsigned>(str[i]);
+ return to_string(val);
+}
+
+std::string generate_hash(Ewk_Autofill_Profile* profile) {
+ std::string hash_str;
+ for (int i = PROFILE_NAME; i < MAX_AUTOFILL; ++i)
+ hash_str.append(profile->getData(static_cast<DataType>(i)));
+ return hash_string(hash_str.c_str());
+}
+
+}
+
+static std::map<DataType, autofill::ServerFieldType> create_EWK_to_Autofill_profile_map() {
+ std::map<DataType, autofill::ServerFieldType> profile_map;
+ profile_map[PROFILE_COMPANY] = autofill::COMPANY_NAME;
+ profile_map[PROFILE_ADDRESS1] = autofill::ADDRESS_HOME_LINE1;
+ profile_map[PROFILE_ADDRESS2] = autofill::ADDRESS_HOME_LINE2;
+ profile_map[PROFILE_CITY_TOWN] = autofill::ADDRESS_HOME_CITY;
+ profile_map[PROFILE_STATE_PROVINCE_REGION] = autofill::ADDRESS_HOME_STATE;
+ profile_map[PROFILE_ZIPCODE] = autofill::ADDRESS_HOME_ZIP;
+ profile_map[PROFILE_COUNTRY] = autofill::ADDRESS_HOME_COUNTRY;
+ profile_map[PROFILE_PHONE] = autofill::PHONE_HOME_WHOLE_NUMBER;
+ profile_map[PROFILE_EMAIL] = autofill::EMAIL_ADDRESS;
+ profile_map[MAX_AUTOFILL] = autofill::NAME_MIDDLE;
+ return profile_map;
+}
+
+void to_Autofill_Profile_set_data(const Ewk_Autofill_Profile* oldStyleProfile,
+ DataType DataName,
+ std::string locale,
+ autofill::AutofillProfile &ret) {
+ base::string16 value;
+ static map<DataType, autofill::ServerFieldType> profile_map =
+ create_EWK_to_Autofill_profile_map();
+ if (0 < (value = oldStyleProfile->get16Data(DataName)).length()) {
+ ret.SetInfo(autofill::AutofillType(profile_map.find(DataName)->second),
+ value, locale);
+ }
+}
+
+autofill::AutofillProfile to_Autofill_Profile(const Ewk_Autofill_Profile* oldStyleProfile) {
+ autofill::AutofillProfile ret("0", "");
+ std::string locale = EWebView::GetPlatformLocale();
+ if (oldStyleProfile) {
+ std::string temp = to_string(0);
+ ret.SetInfo(autofill::AutofillType(autofill::ADDRESS_HOME_SORTING_CODE),
+ base::string16(temp.begin(), temp.end()), locale);
+ return ret;
+ }
+ std::string value;
+ // store id
+ if (0 < (value = oldStyleProfile->getData(PROFILE_ID)).length()) {
+ ret = autofill::AutofillProfile(value, "");
+ ret.SetInfo(autofill::AutofillType(autofill::ADDRESS_HOME_SORTING_CODE),
+ base::string16(value.begin(), value.end()), locale);
+ }
+ // store name
+ if (0 < (value = oldStyleProfile->getData(PROFILE_NAME)).length()) {
+ ret.SetInfo(autofill::AutofillType(autofill::NAME_FULL),
+ base::string16(value.begin(), value.end()), locale);
+
+ if (value.find(" ") != std::string::npos) {
+ unsigned found_first = value.find_first_of(" ");
+ unsigned found_last = value.find_last_of(" ");
+ ret.SetInfo(autofill::AutofillType(autofill::NAME_FIRST),
+ base::string16(value.begin(), value.begin() + found_first), locale);
+
+ if (found_first < found_last)
+ ret.SetInfo(autofill::AutofillType(autofill::NAME_MIDDLE),
+ base::string16(value.begin() + found_first + 1,
+ value.begin()+found_last), locale);
+
+ ret.SetInfo(autofill::AutofillType(autofill::NAME_LAST),
+ base::string16(value.begin() + found_last + 1, value.end()), locale);
+ }
+ }
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_COMPANY,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_ADDRESS1,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_ADDRESS2,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_CITY_TOWN,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_STATE_PROVINCE_REGION,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_ZIPCODE,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_COUNTRY,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_PHONE,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, PROFILE_EMAIL,
+ locale, ret);
+ to_Autofill_Profile_set_data(oldStyleProfile, MAX_AUTOFILL,
+ locale, ret);
+ return ret;
+}
+
+static std::map<autofill::ServerFieldType, DataType> create_Autofill_to_EWK_profile_map() {
+ std::map<autofill::ServerFieldType, DataType> profile_map;
+ std::map<DataType, autofill::ServerFieldType> autofill_map =
+ create_EWK_to_Autofill_profile_map();
+ for (std::map<DataType, autofill::ServerFieldType>::iterator it =
+ autofill_map.begin(); it!=autofill_map.end(); ++it)
+ profile_map[it->second] = it->first;
+ profile_map[autofill::NAME_FULL] = PROFILE_NAME;
+ return profile_map;
+}
+
+void to_EWK_Profile_set_data(const autofill::AutofillProfile& newStyleProfile,
+ autofill::ServerFieldType DataName,
+ std::string locale,
+ Ewk_Autofill_Profile *ret) {
+ base::string16 value;
+ static map<autofill::ServerFieldType, DataType> profile_map =
+ create_Autofill_to_EWK_profile_map();
+ if (0 < (value = newStyleProfile.GetInfo(autofill::AutofillType(
+ DataName), locale)).length()) {
+ ret->setData(profile_map.find(DataName)->second,
+ std::string(value.begin(), value.end()));
+ }
+}
+
+Ewk_Autofill_Profile* to_Ewk_Autofill_Profile(
+ const autofill::AutofillProfile& newStyleProfile) {
+ Ewk_Autofill_Profile *ret = new Ewk_Autofill_Profile();
+ std::string locale = EWebView::GetPlatformLocale();
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_SORTING_CODE, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::NAME_FULL, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::COMPANY_NAME, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_LINE1, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_LINE2, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_CITY, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_STATE, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_ZIP, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::ADDRESS_HOME_COUNTRY, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::PHONE_HOME_WHOLE_NUMBER, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::EMAIL_ADDRESS, locale, ret);
+ to_EWK_Profile_set_data(newStyleProfile,
+ autofill::NAME_MIDDLE, locale, ret);
+ return ret;
+}
+
+
+Eina_List* EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get_all(
+ Ewk_Context* /*context*/) {
+ autofill::PersonalDataManager *dataManager =
+ autofill::PersonalDataManagerFactory::GetInstance()->GetDataManager();
+ std::vector<autofill::AutofillProfile*> dataVector = dataManager->GetProfiles();
+ Eina_List *ret = NULL;
+ Eina_List *work = NULL;
+ for (unsigned i = 0; i < dataVector.size(); ++i) {
+ autofill::AutofillProfile *profile = dataVector[i];
+ if (profile) {
+ work = eina_list_append(work, to_Ewk_Autofill_Profile(*profile));
+ if (ret)
+ ret = work;
+ }
+ }
+ return ret;
+}
+
+Ewk_Autofill_Profile* EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get(
+ Ewk_Context* /*context*/, unsigned id) {
+ autofill::PersonalDataManagerFactory *dataManager =
+ autofill::PersonalDataManagerFactory::GetInstance();
+ autofill::AutofillProfile *profile =
+ dataManager->GetProfileByGUID(to_string(id));
+ Ewk_Autofill_Profile *ret = NULL;
+ if (profile)
+ ret = to_Ewk_Autofill_Profile(*profile);
+ return ret;
+}
+
+Eina_Bool EwkContextFormAutofillProfileManager::priv_form_autofill_profile_set(
+ Ewk_Context* /*context*/, unsigned id, Ewk_Autofill_Profile* profile) {
+ autofill::PersonalDataManagerFactory *personalDataManagerFactory =
+ autofill::PersonalDataManagerFactory::GetInstance();
+ // set proper member of profile to id
+ profile->setData(PROFILE_ID, autofill::generate_hash(profile));
+ // check if such profile already exists??
+ if (personalDataManagerFactory->GetProfileByGUID(to_string(id))) {
+ personalDataManagerFactory->AddProfile(to_Autofill_Profile(profile));
+ } else {
+ personalDataManagerFactory->RemoveByGUID(to_string(id));
+ personalDataManagerFactory->AddProfile(to_Autofill_Profile(profile));
+ }
+ return EINA_TRUE;
+}
+
+Eina_Bool EwkContextFormAutofillProfileManager::priv_form_autofill_profile_add(
+ Ewk_Context* /*context*/, Ewk_Autofill_Profile* profile) {
+ autofill::PersonalDataManagerFactory *personalDataManagerFactory =
+ autofill::PersonalDataManagerFactory::GetInstance();
+ profile->setData(PROFILE_ID, autofill::generate_hash(profile));
+ personalDataManagerFactory->AddProfile(to_Autofill_Profile(profile));
+ return EINA_TRUE;
+}
+
+Eina_Bool EwkContextFormAutofillProfileManager::priv_form_autofill_profile_remove(
+ Ewk_Context* /*context*/, unsigned id) {
+ autofill::PersonalDataManagerFactory *personalDataManagerFactory =
+ autofill::PersonalDataManagerFactory::GetInstance();
+ personalDataManagerFactory->RemoveByGUID(to_string(id));
+ return EINA_TRUE;
+}
--- /dev/null
+// Copyright 2014 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ewk_context_form_autofill_profile_private_h
+#define ewk_context_form_autofill_profile_private_h
+
+#include <Evas.h>
+
+class Ewk_Context;
+
+typedef struct _Ewk_Autofill_Profile Ewk_Autofill_Profile;
+
+class EwkContextFormAutofillProfileManager
+{
+ public:
+ /**
+ * Gets a list of all existing profiles
+ *
+ * The obtained profile must be deleted by ewk_autofill_profile_delete.
+ * @param context context object
+ *
+ * @return @c Eina_List of Ewk_Autofill_Profile @c NULL otherwise
+ * @see ewk_autofill_profile_delete
+ */
+ static Eina_List* priv_form_autofill_profile_get_all(Ewk_Context* context);
+
+ /**
+ * Gets the existing profile for given index
+ *
+ * The obtained profile must be deleted by ewk_autofill_profile_delete.
+ *
+ * @param context context object
+ * @param profile id
+ *
+ * @return @c Ewk_Autofill_Profile if profile exists, @c NULL otherwise
+ * @see ewk_autofill_profile_delete
+ */
+ static Ewk_Autofill_Profile* priv_form_autofill_profile_get(Ewk_Context* context,
+ unsigned id);
+
+ /**
+ * Sets the given profile for the given id
+ *
+ * Data can be added to the created profile by ewk_autofill_profile_data_set.
+ *
+ * @param context context object
+ * @param profile id
+ * @param profile Ewk_Autofill_Profile
+ *
+ * @return @c EINA_TRUE if the profile data is set successfully, @c EINA_FALSE otherwise
+ * @see ewk_autofill_profile_new
+ * @see ewk_context_form_autofill_profile_add
+ */
+ static Eina_Bool priv_form_autofill_profile_set(Ewk_Context* context,
+ unsigned id, Ewk_Autofill_Profile* profile);
+
+ /**
+ * Saves the created profile into permenant storage
+ *
+ * The profile used to save must be created by ewk_autofill_profile_new.
+ * Data can be added to the created profile by ewk_autofill_profile_data_set.
+ *
+ * @param context context object
+ * @param profile Ewk_Autofill_Profile
+ *
+ * @return @c EINA_TRUE if the profile data is saved successfully, @c EINA_FALSE otherwise
+ * @see ewk_autofill_profile_new
+ */
+ static Eina_Bool priv_form_autofill_profile_add(Ewk_Context* context,
+ Ewk_Autofill_Profile* profile);
+
+ /**
+ * Removes Autofill Form profile completely
+ *
+ * @param context context object
+ * @param index profile id
+ *
+ * @return @c EINA_TRUE if the profile data is removed successfully, @c EINA_FALSE otherwise
+ * @see ewk_context_form_autofill_profile_get_all
+ */
+ static EAPI Eina_Bool priv_form_autofill_profile_remove(Ewk_Context* context,
+ unsigned id);
+};
+
+#endif // ewk_context_form_autofill_profile_private_h
#define AUTOFILL_POPUP_LABEL_COUNT 6 // Autofill component send 6 at max
#define AUTOFILL_POPUP_LABEL_LEN 100
+using namespace password_manager;
+
namespace autofill {
namespace {
// const values taken from webkit2-efl
, autofill_list_(NULL)
, password_popup_(NULL)
, form_manager_(NULL) {
- Evas_Object* widgetWin_ = elm_object_top_widget_get(elm_object_parent_widget_get(view->evas_object()));
- if (!widgetWin_) {
+ Evas_Object* widgetWin_ = elm_object_top_widget_get(
+ elm_object_parent_widget_get(view->evas_object()));
+ if (!widgetWin_)
widgetWin_ = view->evas_object();
- }
autofill_popup_ = elm_layout_add(widgetWin_);
- if (!autofill_popup_) {
+ if (!autofill_popup_)
return;
- }
base::FilePath edj_dir;
base::FilePath autofill_edj;
PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir);
autofill_edj = edj_dir.Append(FILE_PATH_LITERAL("AutofillPopup.edj"));
- elm_layout_file_set(autofill_popup_, autofill_edj.AsUTF8Unsafe().c_str(), "formdata_list");
+ elm_layout_file_set(autofill_popup_,
+ autofill_edj.AsUTF8Unsafe().c_str(),
+ "formdata_list");
autofill_list_ = elm_genlist_add(autofill_popup_);
}
AutofillPopupViewEfl::~AutofillPopupViewEfl()
{
- if (autofill_popup_) {
+ if (autofill_popup_)
evas_object_del(autofill_popup_);
- }
- if (password_popup_) {
+ if (password_popup_)
evas_object_del(password_popup_);
- }
}
void AutofillPopupViewEfl::Show()
{
- if (autofill_popup_) {
+ if (autofill_popup_)
evas_object_show(autofill_popup_);
- }
- if (delegate_) {
+ if (delegate_)
delegate_->OnPopupShown();
- }
}
void AutofillPopupViewEfl::Hide()
{
- if (autofill_popup_) {
+ if (autofill_popup_)
evas_object_hide(autofill_popup_);
- }
- if (delegate_) {
+ if (delegate_)
delegate_->OnPopupHidden();
- }
}
-void AutofillPopupViewEfl::ShowSavePasswordPopup(PasswordFormManager * form_to_save)
+void AutofillPopupViewEfl::ShowSavePasswordPopup(PasswordFormManager* form_to_save)
{
if (password_popup_) {
evas_object_del(password_popup_);
Evas_Object *btn_never = elm_button_add(password_popup_);
elm_object_text_set(btn_never, "Never");
elm_object_part_content_set(password_popup_, "button1", btn_never);
- evas_object_smart_callback_add(btn_never, "clicked", savePasswordNeverCb, (void*)this);
+ evas_object_smart_callback_add(btn_never,
+ "clicked",
+ savePasswordNeverCb,
+ static_cast<void*>(this));
Evas_Object *btn_yes = elm_button_add(password_popup_);
elm_object_text_set(btn_yes, "Yes");
elm_object_part_content_set(password_popup_, "button2", btn_yes);
- evas_object_smart_callback_add(btn_yes, "clicked", savePasswordYesCb, (void*)this);
+ evas_object_smart_callback_add(btn_yes,
+ "clicked",
+ savePasswordYesCb,
+ static_cast<void*>(this));
Evas_Object *btn_not_now = elm_button_add(password_popup_);
elm_object_text_set(btn_not_now, "Not Now");
elm_object_part_content_set(password_popup_, "button3", btn_not_now);
- evas_object_smart_callback_add(btn_not_now, "clicked", savePasswordNotNowCb, (void*)this);
+ evas_object_smart_callback_add(btn_not_now,
+ "clicked",
+ savePasswordNotNowCb,
+ static_cast<void*>(this));
}
void AutofillPopupViewEfl::UpdateFormDataPopup(const gfx::RectF& bounds)
{
Elm_Genlist_Item_Class* list_Items = NULL;
double scale_factor = 1.0;
- if (!autofill_list_) {
+ if (!autofill_list_)
return;
- }
Evas_Object* border_up = elm_bg_add(autofill_popup_);
Evas_Object* border_down = elm_bg_add(autofill_popup_);
Evas_Object* border_left = elm_bg_add(autofill_popup_);
list_Items->func.state_get = NULL;
list_Items->func.del = NULL;
for (size_t i = 0; i < values_.size(); ++i) {
- elm_genlist_item_append(autofill_list_, list_Items, (void*)(long)i, NULL, ELM_GENLIST_ITEM_NONE, itemSelectCb, (void*)this);
+ elm_genlist_item_append(autofill_list_,
+ list_Items,
+ reinterpret_cast<void*>(static_cast<long>(i)),
+ NULL,
+ ELM_GENLIST_ITEM_NONE,
+ itemSelectCb,
+ static_cast<void*>(this));
}
#if defined(OS_TIZEN_MOBILE)
- scale_factor = (double)gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
+ scale_factor = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().
+ device_scale_factor();
#elif defined(OS_TIZEN_TV)
scale_factor = webview_->GetScale();
#endif
void AutofillPopupViewEfl::AcceptSuggestion(size_t index)
{
if (delegate_) {
- if (index < values_.size()) {
+ if (index < values_.size())
delegate_->DidAcceptSuggestion(values_[index], identifiers_[index]);
- }
}
}
evas_object_del(password_popup_);
password_popup_ = NULL;
}
- if (!form_manager_) {
+ if (!form_manager_)
return;
- }
switch (static_cast<AutofillSavePassword>(option)) {
case AUTOFILL_SAVE_PASS_NEVER: {
form_manager_->PermanentlyBlacklist();
void AutofillPopupViewEfl::SetSelectedLine(size_t selected_line)
{
- if (selected_line_ == selected_line) {
+ if (selected_line_ == selected_line)
return;
- }
selected_line_ = selected_line;
if(delegate_) {
if (selected_line_ < values_.size()) {
- delegate_->DidSelectSuggestion(identifiers_[selected_line_]);
+ delegate_->DidSelectSuggestion(values_[selected_line],
+ identifiers_[selected_line_]);
}
else {
delegate_->ClearPreviewedForm();
{
size_t index = (size_t)elm_object_item_data_get(static_cast<Elm_Object_Item*>(event_info));
AutofillPopupViewEfl* autofill_popup = static_cast<AutofillPopupViewEfl*>(data);
- if (autofill_popup) {
+ if (autofill_popup)
autofill_popup->AcceptSuggestion(index);
- }
}
void AutofillPopupViewEfl::savePasswordNeverCb(void *data, Evas_Object *obj, void *event_info)
{
AutofillPopupViewEfl * autofill_popup = static_cast<AutofillPopupViewEfl*>(data);
- if (autofill_popup) {
+ if (autofill_popup)
autofill_popup->AcceptPasswordSuggestion(AUTOFILL_SAVE_PASS_NEVER);
- }
}
void AutofillPopupViewEfl::savePasswordYesCb(void *data, Evas_Object *obj, void *event_info)
{
AutofillPopupViewEfl * autofill_popup = static_cast<AutofillPopupViewEfl*>(data);
- if (autofill_popup) {
+ if (autofill_popup)
autofill_popup->AcceptPasswordSuggestion(AUTOFILL_SAVE_PASS_YES);
- }
}
void AutofillPopupViewEfl::savePasswordNotNowCb(void *data, Evas_Object *obj, void *event_info)
{
AutofillPopupViewEfl * autofill_popup = static_cast<AutofillPopupViewEfl*>(data);
- if (autofill_popup) {
+ if (autofill_popup)
autofill_popup->AcceptPasswordSuggestion(AUTOFILL_SAVE_PASS_NOTNOW);
- }
}
} // namespace autofill
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/point.h"
+using namespace password_manager;
class EWebView;
namespace autofill {
#ifdef TIZEN_AUTOFILL_SUPPORT
+#include "browser/autofill/autofill_manager_delegate_efl.h"
+
#include "browser/autofill/personal_data_manager_factory.h"
#include "browser/webdata/web_data_service_factory.h"
#include "browser/password_manager/password_manager_client_efl.h"
#include "browser/password_manager/password_generation_manager.h"
-
#include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
-#include "components/autofill/content/browser/autofill_driver_impl.h"
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
+#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents_view.h"
#include "content/public/browser/browser_thread.h"
#include "ui/gfx/rect.h"
#include <Elementary.h>
-#include "browser/autofill/autofill_manager_delegate_efl.h"
+#include "tizen_webview/public/tw_web_context.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::AutofillManagerDelegateEfl);
+using namespace password_manager;
+
namespace autofill {
AutofillManagerDelegateEfl::AutofillManagerDelegateEfl(content::WebContents* web_contents)
, webview_(NULL)
, web_contents_(web_contents)
, database_(WebDataServiceFactory::GetInstance()->GetAutofillWebDataForProfile())
- , is_autofill_enabled_(true)
, popup_controller_(NULL) {
DCHECK(web_contents);
}
}
PrefService* AutofillManagerDelegateEfl::GetPrefs() {
- //TODO: Need to implement using Ewk_Settings
- return prefs_.get();
+ if(webview_)
+ return webview_->context()->GetImpl()->browser_context()->GetUserPrefService();
}
void AutofillManagerDelegateEfl::ShowAutofillSettings() {
NOTIMPLEMENTED();
}
-void AutofillManagerDelegateEfl::ShowRequestAutocompleteDialog(const FormData& form, const GURL& source_url, const base::Callback<void(const FormStructure*)>& callback) {
+void AutofillManagerDelegateEfl::ShowRequestAutocompleteDialog(
+ const autofill::FormData& form,
+ const GURL& source_url,
+ const ResultCallback& callback) {
HideRequestAutocompleteDialog();
NOTIMPLEMENTED();
}
base::WeakPtr<AutofillPopupDelegate> delegate) {
DCHECK(web_contents_);
#if defined(OS_TIZEN)
- gfx::Rect client_area;
- web_contents_->GetView()->GetContainerBounds(&client_area);
- gfx::RectF element_bounds_in_screen_space = element_bounds + client_area.OffsetFromOrigin();
+ gfx::Rect client_area = web_contents_->GetContainerBounds();
+ gfx::RectF element_bounds_in_screen_space = element_bounds +
+ client_area.OffsetFromOrigin();
#endif
if (GetOrCreatePopupController()) {
DCHECK(web_contents_);
if (popup_controller_) {
popup_controller_->Hide();
- PasswordGenerationManager * manager = PasswordManagerClientEfl::GetGenerationManagerFromWebContents(web_contents_);
+ PasswordGenerationManager* manager =
+ PasswordManagerClientEfl::GetGenerationManagerFromWebContents(
+ web_contents_);
if (manager)
manager->HidePopup();
}
}
bool AutofillManagerDelegateEfl::IsAutocompleteEnabled() {
- return is_autofill_enabled_;
-}
-
-void AutofillManagerDelegateEfl::SetAutocompleteEnabled(bool enable) {
- PersonalDataManager * data_manager = GetPersonalDataManager();
- if(data_manager)
- data_manager->SetAutofillEnabled(enable);
- is_autofill_enabled_ = enable;
+ return GetPrefs()->GetBoolean(autofill::prefs::kAutofillEnabled);
}
bool AutofillManagerDelegateEfl::IsAutocompleteSavingEnabled() {
- return webview_->GetSettings()->formCandidateData();
+ if(webview_)
+ return webview_->GetSettings()->formCandidateData();
}
void AutofillManagerDelegateEfl::HideRequestAutocompleteDialog() {
NOTIMPLEMENTED();
}
-void AutofillManagerDelegateEfl::WasShown() {
- content::RenderViewHost* host = web_contents()->GetRenderViewHost();
- if (host)
- host->Send(new AutofillMsg_PageShown(host->GetRoutingID()));
-}
-
void AutofillManagerDelegateEfl::DidNavigateMainFrame(const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) {
HideRequestAutocompleteDialog();
}
popup_controller_->ShowSavePasswordPopup(form_to_save);
}
-void AutofillManagerDelegateEfl::WebContentsDestroyed(content::WebContents* web_contents) {
+void AutofillManagerDelegateEfl::WebContentsDestroyed() {
HideAutofillPopup();
}
void AutofillManagerDelegateEfl::DetectAccountCreationForms(const std::vector<autofill::FormStructure*>& forms) {
DCHECK(web_contents_);
- PasswordGenerationManager * manager = PasswordManagerClientEfl::GetGenerationManagerFromWebContents(web_contents_);
+ PasswordGenerationManager* manager =
+ PasswordManagerClientEfl::GetGenerationManagerFromWebContents(
+ web_contents_);
if (manager)
manager->DetectAccountCreationForms(forms);
}
return popup_controller_;
}
+void AutofillManagerDelegateEfl::DidFillOrPreviewField(
+ const base::string16& autofilled_value,
+ const base::string16& profile_full_name) {
+ NOTIMPLEMENTED();
+}
+
} // namespace autofill
#endif // TIZEN_AUTOFILL_SUPPORT
#include "base/compiler_specific.h"
#include "base/i18n/rtl.h"
#include "base/memory/weak_ptr.h"
-#include "components/autofill/core/browser/autofill_manager_delegate.h"
+#include "components/autofill/core/browser/autofill_client.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
#include "browser/password_manager/password_form_manager.h"
// Chrome implementation of AutofillManagerDelegate.
class AutofillManagerDelegateEfl
: public content::WebContentsUserData<AutofillManagerDelegateEfl>,
- public AutofillManagerDelegate,
+ public autofill::AutofillClient,
public content::WebContentsObserver {
public:
virtual ~AutofillManagerDelegateEfl();
// Called when the tab corresponding to |this| instance is activated.
void TabActivated();
// AutofillManagerDelegate implementation.
- virtual PersonalDataManager* GetPersonalDataManager() override;
- virtual scoped_refptr<AutofillWebDataService> GetDatabase() override;
- virtual PrefService* GetPrefs() override;
- virtual void HideRequestAutocompleteDialog() override;
- virtual void ShowAutofillSettings() override;
- virtual void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger, const base::Closure& save_card_callback) override;
- virtual void ShowRequestAutocompleteDialog(const FormData& form, const GURL& source_url, const base::Callback<void(const FormStructure*)>& callback) override;
- virtual void ShowAutofillPopup(
+ PersonalDataManager* GetPersonalDataManager() override;
+ scoped_refptr<AutofillWebDataService> GetDatabase() override;
+ PrefService* GetPrefs() override;
+ void HideRequestAutocompleteDialog() override;
+ void ShowAutofillSettings() override;
+ void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger,
+ const base::Closure& save_card_callback) override;
+ void ShowRequestAutocompleteDialog(
+ const autofill::FormData& form,
+ const GURL& source_url,
+ const ResultCallback& callback) override;
+ void ShowAutofillPopup(
const gfx::RectF& element_bounds,
base::i18n::TextDirection text_direction,
const std::vector<base::string16>& values,
const std::vector<base::string16>& icons,
const std::vector<int>& identifiers,
base::WeakPtr<AutofillPopupDelegate> delegate) override;
- virtual void UpdateAutofillPopupDataListValues(const std::vector<base::string16>& values, const std::vector<base::string16>& labels) override;
- virtual void HideAutofillPopup() override;
- virtual bool IsAutocompleteEnabled() override;
- virtual bool IsAutocompleteSavingEnabled() override;
- virtual void DetectAccountCreationForms(const std::vector<autofill::FormStructure*>& forms) override;
+ void UpdateAutofillPopupDataListValues(
+ const std::vector<base::string16>& values,
+ const std::vector<base::string16>& labels) override;
+ void HideAutofillPopup() override;
+ bool IsAutocompleteEnabled() override;
+ bool IsAutocompleteSavingEnabled() override;
+ void DetectAccountCreationForms(
+ const std::vector<autofill::FormStructure*>& forms) override;
// content::WebContentsObserver implementation.
- virtual void DidNavigateMainFrame(const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) override;
- virtual void WebContentsDestroyed(content::WebContents* web_contents) override;
- virtual void WasShown() override;
- void SetAutocompleteEnabled(bool enable);
- void ShowSavePasswordPopup(PasswordFormManager * form_to_save);
- void SetEWebView(EWebView * view) { webview_ = view; }
- AutofillPopupViewEfl * GetOrCreatePopupController();
+ void DidNavigateMainFrame(const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) override;
+ void WebContentsDestroyed() override;
+ void ShowSavePasswordPopup(password_manager::PasswordFormManager* form_to_save);
+ void SetEWebView(EWebView* view) { webview_ = view; }
+ AutofillPopupViewEfl* GetOrCreatePopupController();
+ void DidFillOrPreviewField(
+ const base::string16& autofilled_value,
+ const base::string16& profile_full_name) override;
private:
explicit AutofillManagerDelegateEfl(content::WebContents* web_contents);
friend class content::WebContentsUserData<AutofillManagerDelegateEfl>;
- private:
content::WebContents* const web_contents_;
- EWebView * webview_;
+ EWebView* webview_;
scoped_refptr<AutofillWebDataService> database_;
- scoped_ptr<PrefService> prefs_;
- bool is_autofill_enabled_;
- AutofillPopupViewEfl * popup_controller_;
+ AutofillPopupViewEfl* popup_controller_;
DISALLOW_COPY_AND_ASSIGN(AutofillManagerDelegateEfl);
};
--- /dev/null
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "autofill_pref_store_efl.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+
+AutofillPrefStore::AutofillPrefStore() {}
+
+AutofillPrefStore::~AutofillPrefStore() {}
+
+bool AutofillPrefStore::GetValue(const std::string& key,
+ const base::Value** value) const {
+ return prefs_.GetValue(key, value);
+}
+
+bool AutofillPrefStore::GetMutableValue(const std::string& key,
+ base::Value** value) {
+ return prefs_.GetValue(key, value);
+}
+
+void AutofillPrefStore::AddObserver(PrefStore::Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AutofillPrefStore::RemoveObserver(PrefStore::Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+bool AutofillPrefStore::HasObservers() const {
+ return observers_.might_have_observers();
+}
+
+bool AutofillPrefStore::IsInitializationComplete() const {
+ return true;
+}
+
+void AutofillPrefStore::SetValue(const std::string& key, base::Value* value) {
+ DCHECK(value);
+ if (prefs_.SetValue(key, value))
+ ReportValueChanged(key);
+}
+
+void AutofillPrefStore::SetValueSilently(const std::string& key, base::Value* value) {
+ prefs_.SetValue(key, value);
+}
+
+void AutofillPrefStore::RemoveValue(const std::string& key) {
+ if (prefs_.RemoveValue(key))
+ ReportValueChanged(key);
+}
+
+bool AutofillPrefStore::ReadOnly() const {
+ return false;
+}
+
+PersistentPrefStore::PrefReadError AutofillPrefStore::GetReadError() const {
+ return PersistentPrefStore::PREF_READ_ERROR_NONE;
+}
+
+PersistentPrefStore::PrefReadError AutofillPrefStore::ReadPrefs() {
+ return PersistentPrefStore::PREF_READ_ERROR_NONE;
+}
+
+void AutofillPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate_raw) {
+}
+
+void AutofillPrefStore::ReportValueChanged(const std::string& key) {
+ FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
+}
--- /dev/null
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AUTOFILL_PREF_STORE_H_
+#define AUTOFILL_PREF_STORE_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/observer_list.h"
+#include "base/prefs/persistent_pref_store.h"
+#include "base/prefs/pref_value_map.h"
+
+// A light-weight prefstore implementation that keeps preferences
+// in a memory backed store. This is not a persistent prefstore -- we
+// subclass the PersistentPrefStore here since it is needed by the
+// PrefService, which in turn is needed by the Autofill component.
+class AutofillPrefStore : public PersistentPrefStore {
+ public:
+ AutofillPrefStore();
+
+ // Overriden from PrefStore.
+ bool GetValue(const std::string& key,
+ const base::Value** result) const override;
+ void AddObserver(PrefStore::Observer* observer) override;
+ void RemoveObserver(PrefStore::Observer* observer) override;
+ bool HasObservers() const override;
+ bool IsInitializationComplete() const override;
+
+ // PersistentPrefStore overrides:
+ bool GetMutableValue(const std::string& key,
+ base::Value** result) override;
+ void ReportValueChanged(const std::string& key) override;
+ void SetValue(const std::string& key, base::Value* value) override;
+ void SetValueSilently(const std::string& key,
+ base::Value* value) override;
+ void RemoveValue(const std::string& key) override;
+ bool ReadOnly() const override;
+ PrefReadError GetReadError() const override;
+ PersistentPrefStore::PrefReadError ReadPrefs() override;
+ void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override;
+ void CommitPendingWrite() override {}
+
+ protected:
+ virtual ~AutofillPrefStore();
+
+ private:
+ // Stores the preference values.
+ PrefValueMap prefs_;
+
+ ObserverList<PrefStore::Observer, true> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutofillPrefStore);
+};
+
+#endif // AUTOFILL_PREF_STORE_H_
#include "browser/webdata/web_data_service_factory.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
+#include "tizen_webview/public/tw_web_context.h"
namespace autofill {
namespace {
+ using tizen_webview::WebContext;
class PersonalDataManagerServiceImpl : public PersonalDataManagerService {
- public:
+public:
explicit PersonalDataManagerServiceImpl();
virtual ~PersonalDataManagerServiceImpl();
// PersonalDataManagerService:
- virtual void Shutdown() override;
- virtual PersonalDataManager* GetPersonalDataManager() override;
+ PersonalDataManager* GetPersonalDataManager() override;
static PersonalDataManagerServiceImpl* GetInstance() {
return Singleton<PersonalDataManagerServiceImpl>::get();
}
- private:
+private:
friend struct DefaultSingletonTraits<PersonalDataManagerServiceImpl>;
scoped_ptr<PersonalDataManager> personal_data_manager_;
DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerServiceImpl);
PersonalDataManagerServiceImpl::PersonalDataManagerServiceImpl() {
personal_data_manager_.reset(new PersonalDataManager(EWebView::GetPlatformLocale()));
- personal_data_manager_->Init(WebDataServiceFactory::GetAutofillWebDataForProfile(), false);
+ content::BrowserContextEfl* default_context =
+ WebContext::DefaultContext()->browser_context();
+ personal_data_manager_->Init(
+ WebDataServiceFactory::GetAutofillWebDataForProfile(),
+ default_context->GetUserPrefService(),
+ false);
}
PersonalDataManagerServiceImpl::~PersonalDataManagerServiceImpl() {
}
-void PersonalDataManagerServiceImpl::Shutdown() {
- personal_data_manager_.reset();
-}
-
PersonalDataManager* PersonalDataManagerServiceImpl::GetPersonalDataManager() {
return personal_data_manager_.get();
}
#include "browser/password_manager/content_password_manager_driver.h"
-#include "components/autofill/content/browser/autofill_driver_impl.h"
+#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/content/common/autofill_messages.h"
+#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/common/password_form.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/page_transition_types.h"
#include "content/public/common/ssl_status.h"
#include "ipc/ipc_message_macros.h"
#include "net/cert/cert_status_flags.h"
+namespace password_manager {
ContentPasswordManagerDriver::ContentPasswordManagerDriver(
content::WebContents* web_contents,
PasswordManagerClient* client)
: WebContentsObserver(web_contents),
password_manager_(client),
- password_generation_manager_(web_contents, client) {
+ password_generation_manager_(web_contents, client),
+ next_free_key_(0) {
DCHECK(web_contents);
}
void ContentPasswordManagerDriver::FillPasswordForm(
const autofill::PasswordFormFillData& form_data) {
DCHECK(web_contents());
+ const int key = next_free_key_++;
web_contents()->GetRenderViewHost()->Send(new AutofillMsg_FillPasswordForm(
- web_contents()->GetRenderViewHost()->GetRoutingID(), form_data));
+ web_contents()->GetRenderViewHost()->GetRoutingID(), key, form_data));
}
bool ContentPasswordManagerDriver::DidLastPageLoadEncounterSSLErrors() {
}
autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() {
- autofill::AutofillDriverImpl* driver =
- autofill::AutofillDriverImpl::FromWebContents(web_contents());
+ autofill::ContentAutofillDriver* driver =
+ autofill::ContentAutofillDriver::FromWebContents(web_contents());
return driver ? driver->autofill_manager() : NULL;
}
content::RenderViewHost* host = web_contents()->GetRenderViewHost();
host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(), *form));
}
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "browser/password_manager/password_generation_manager.h"
#include "browser/password_manager/password_manager.h"
#include "browser/password_manager/password_manager_driver.h"
+#include "browser/password_manager/password_manager_client.h"
#include "content/public/browser/web_contents_observer.h"
namespace autofill {
class WebContents;
}
+namespace password_manager {
class ContentPasswordManagerDriver : public PasswordManagerDriver,
public content::WebContentsObserver {
public:
PasswordManager password_manager_;
PasswordGenerationManager password_generation_manager_;
+ int next_free_key_;
DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriver);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
using autofill::PasswordFormMap;
using base::Time;
+namespace password_manager {
PasswordFormManager::PasswordFormManager(PasswordManager* password_manager,
PasswordManagerClient* client,
PasswordManagerDriver* driver,
SaveAsNewLogin(false);
}
-void PasswordFormManager::SetUseAdditionalPasswordAuthentication(
- bool use_additional_authentication) {
- pending_credentials_.use_additional_authentication =
- use_additional_authentication;
-}
-
bool PasswordFormManager::IsNewLogin() {
DCHECK_EQ(state_, POST_MATCHING_PHASE);
return is_new_login_;
// We're done matching now.
state_ = POST_MATCHING_PHASE;
- if (best_score <= 0) {
+ if (best_score <= 0)
return;
- }
for (std::vector<PasswordForm>::const_iterator it =
credentials_to_keep.begin();
bool PasswordFormManager::IgnoreResult(const PasswordForm& form) const {
// Ignore change password forms until we have some change password
// functionality
- if (observed_form_.old_password_element.length() != 0) {
+ if (observed_form_.password_element.length() != 0)
return true;
- }
// Don't match an invalid SSL form with one saved under secure
// circumstances.
- if (form.ssl_valid && !observed_form_.ssl_valid) {
+ if (form.ssl_valid && !observed_form_.ssl_valid)
return true;
- }
return false;
}
SanitizePossibleUsernames(&pending_credentials_);
password_store->AddLogin(pending_credentials_);
- if (reset_preferred_login) {
+ if (reset_preferred_login)
UpdatePreferredLoginState(password_store);
- }
}
void PasswordFormManager::SanitizePossibleUsernames(PasswordForm* form) {
// Note that this doesn't guarantee that the upload succeeded, only that
// |pending.form_data| is considered uploadable.
bool success =
- autofill_manager->UploadPasswordGenerationForm(pending.form_data);
+ autofill_manager->UploadPasswordForm(
+ pending.form_data,autofill::ACCOUNT_CREATION_PASSWORD);
UMA_HISTOGRAM_BOOLEAN("PasswordGeneration.UploadStarted", success);
}
}
void PasswordFormManager::SubmitFailed() {
submit_result_ = kSubmitResultFailed;
}
+}
#endif // TIZEN_AUTOFILL_SUPPORT
class WebContents;
} // namespace content
+namespace password_manager {
class PasswordManager;
class PasswordManagerClient;
// TODO: Make this private once we switch to the new UI.
void PermanentlyBlacklist();
- // Sets whether the password form should use additional password
- // authentication if available before being used for autofill.
- void SetUseAdditionalPasswordAuthentication(
- bool use_additional_authentication);
-
// If the user has submitted observed_form_, provisionally hold on to
// the submitted credentials until we are told by PasswordManager whether
// or not the login was successful. |action| describes how we deal with
DISALLOW_COPY_AND_ASSIGN(PasswordFormManager);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "components/autofill/core/common/password_form.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_view.h"
#include "ui/gfx/rect.h"
+namespace password_manager {
PasswordGenerationManager::PasswordGenerationManager(
content::WebContents* contents,
PasswordManagerClient* client)
host->GetRoutingID(), forms));
}
-gfx::RectF PasswordGenerationManager::GetBoundsInScreenSpace(
- const gfx::RectF& bounds) {
- gfx::Rect client_area;
- web_contents_->GetView()->GetContainerBounds(&client_area);
- return bounds + client_area.OffsetFromOrigin();
-}
-
void PasswordGenerationManager::OnShowPasswordGenerationPopup(
const gfx::RectF& bounds,
int max_length,
{
// TODO: Call Popup Hide
}
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "base/memory/weak_ptr.h"
#include "ui/gfx/rect.h"
-class PasswordManager;
-class PasswordManagerClient;
-class PasswordManagerDriver;
namespace autofill {
struct FormData;
class PrefRegistrySyncable;
}
+namespace password_manager {
// Per-tab manager for password generation. Will enable this feature only if
//
// - Password manager is enabled
// This class is used to determine what forms we should offer to generate
// passwords for and manages the popup which is created if the user chooses to
// generate a password.
+class PasswordManager;
+class PasswordManagerClient;
+class PasswordManagerDriver;
class PasswordGenerationManager {
public:
PasswordGenerationManager(content::WebContents* contents,
content::RenderViewHost* host,
const std::vector<autofill::FormData>& forms);
- // Given |bounds| in the renderers coordinate system, return the same bounds
- // in the screens coordinate system.
- gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds);
-
// The WebContents instance associated with this instance. Scoped to the
// lifetime of this class, as this class is indirectly a WCUD via
// ChromePasswordManagerClient.
DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "browser/password_manager/password_form_manager.h"
#include "browser/password_manager/password_manager_client.h"
#include "browser/password_manager/password_manager_driver.h"
-#include "components/autofill/core/common/password_autofill_util.h"
+#include "components/password_manager/core/browser/password_autofill_manager.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
-#include "components/user_prefs/pref_registry_syncable.h"
+#include "components/pref_registry/pref_registry_syncable.h"
using autofill::PasswordForm;
using autofill::PasswordFormMap;
+namespace password_manager {
namespace {
const char kSpdyProxyRealm[] = "/SpdyProxy";
// Always save generated passwords, as the user expresses explicit intent for
// Chrome to manage such passwords. For other passwords, respect the
// autocomplete attribute if autocomplete='off' is not ignored.
- if (!autofill::ShouldIgnoreAutocompleteOffForPasswordFields() &&
- !manager->HasGeneratedPassword() &&
+ if (!manager->HasGeneratedPassword() &&
!form.password_autocomplete_set) {
RecordFailure(AUTOCOMPLETE_OFF, form.origin.host());
return;
void PasswordManager::OnPasswordFormsParsed(
const std::vector<PasswordForm>& forms) {
- if(!IsPasswordManagerFillingEnabled()) {
+ if (!IsPasswordManagerFillingEnabled()) {
return;
}
// Ask the SSLManager for current security.
}
void PasswordManager::OnPasswordFormsRendered(
- const std::vector<PasswordForm>& visible_forms) {
+ const std::vector<PasswordForm>& visible_forms,
+ bool did_stop_loading) {
if(!IsPasswordManagerFillingEnabled()) {
return;
}
// TODO(tedchoc): Switch to only requesting authentication if the user is
// acting on the autofilled forms (crbug.com/342594) instead
// of on page load.
- bool authentication_required = preferred_match.use_additional_authentication;
- for (autofill::PasswordFormMap::const_iterator it = best_matches.begin();
- !authentication_required && it != best_matches.end(); ++it) {
- if (it->second->use_additional_authentication)
- authentication_required = true;
- }
switch (form_for_autofill.scheme) {
case PasswordForm::SCHEME_HTML: {
wait_for_username,
OtherPossibleUsernamesEnabled(),
fill_data.get());
- if (authentication_required)
- client_->AuthenticateAutofillAndFillForm(fill_data.Pass());
- else
driver_->FillPasswordForm(*fill_data.get());
break;
}
client_->PasswordWasAutofilled(best_matches);
}
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "components/autofill/core/common/password_form_fill_data.h"
#include "components/password_manager/core/browser/login_model.h"
-class PasswordManagerClient;
-class PasswordManagerDriver;
-class PasswordManagerTest;
-class PasswordFormManager;
class PrefRegistrySimple;
namespace content {
// receiving password form data from the renderer and managing the password
// database through the PasswordStore. The PasswordManager is a LoginModel
// for purposes of supporting HTTP authentication dialogs.
+namespace password_manager {
class PasswordManager : public LoginModel {
- public:
+public:
static const char kOtherPossibleUsernamesExperiment[];
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// Handles password forms being rendered.
void OnPasswordFormsRendered(
- const std::vector<autofill::PasswordForm>& visible_forms);
+ const std::vector<autofill::PasswordForm>& visible_forms,
+ bool did_stop_loading);
// Handles a password form being submitted.
virtual void OnPasswordFormSubmitted(
const autofill::PasswordForm& password_form);
- private:
+private:
enum ProvisionalSaveFailure {
SAVING_DISABLED,
EMPTY_PASSWORD,
DISALLOW_COPY_AND_ASSIGN(PasswordManager);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "browser/password_manager/password_manager_client.h"
+namespace password_manager {
base::FieldTrial::Probability
-PasswordManagerClient::GetProbabilityForExperiment(
- const std::string& experiment_name) {
- return 0;
+ PasswordManagerClient::GetProbabilityForExperiment(
+ const std::string& experiment_name) {
+ return 0;
}
+
bool PasswordManagerClient::IsPasswordSyncEnabled() { return false; }
+}
#endif // TIZEN_AUTOFILL_SUPPORT
\ No newline at end of file
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_form_fill_data.h"
+namespace password_manager {
class PasswordFormManager;
class PasswordManagerDriver;
class PasswordStore;
-class PrefService;
// An abstraction of operations that depend on the embedders (e.g. Chrome)
// environment.
private:
DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "content/public/browser/web_contents.h"
+namespace password_manager {
DEFINE_WEB_CONTENTS_USER_DATA_KEY(PasswordManagerClientEfl);
PasswordManagerClientEfl::PasswordManagerClientEfl(content::WebContents* web_contents)
{
driver_.FillPasswordForm(*data);
}
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "browser/password_manager/password_manager_client.h"
#include "content/public/browser/web_contents_user_data.h"
-class PasswordGenerationManager;
class PasswordManager;
class Profile;
}
// PasswordManagerClientEfl implements the PasswordManagerClient interface.
+namespace password_manager {
class PasswordManagerClientEfl
: public PasswordManagerClient,
public content::WebContentsUserData<PasswordManagerClientEfl> {
- public:
+public:
virtual ~PasswordManagerClientEfl();
// PasswordManagerClient implementation.
- virtual void PromptUserToSavePassword(PasswordFormManager* form_to_save) override;
- virtual void PasswordWasAutofilled(const autofill::PasswordFormMap& best_matches) const override;
- virtual void AuthenticateAutofillAndFillForm(scoped_ptr<autofill::PasswordFormFillData> fill_data) override;
- virtual PasswordStore* GetPasswordStore() override;
- virtual PasswordManagerDriver* GetDriver() override;
- virtual base::FieldTrial::Probability GetProbabilityForExperiment(const std::string& experiment_name) override;
- virtual bool IsPasswordSyncEnabled() override;
+ void PromptUserToSavePassword(
+ PasswordFormManager* form_to_save) override;
+ void PasswordWasAutofilled(
+ const autofill::PasswordFormMap& best_matches) const override;
+ void AuthenticateAutofillAndFillForm(
+ scoped_ptr<autofill::PasswordFormFillData> fill_data) override;
+ PasswordStore* GetPasswordStore() override;
+ PasswordManagerDriver* GetDriver() override;
+ base::FieldTrial::Probability GetProbabilityForExperiment(
+ const std::string& experiment_name) override;
+ bool IsPasswordSyncEnabled() override;
bool IsPasswordManagerSavingEnabled();
void SetPasswordManagerSavingEnabled(bool enabled);
// Convenience method to allow //chrome code easy access to a
// PasswordGenerationManager from a WebContents instance.
- static PasswordGenerationManager* GetGenerationManagerFromWebContents(content::WebContents* contents);
+ static PasswordGenerationManager* GetGenerationManagerFromWebContents(
+ content::WebContents* contents);
- private:
+private:
explicit PasswordManagerClientEfl(content::WebContents* web_contents);
friend class content::WebContentsUserData<PasswordManagerClientEfl>;
DISALLOW_COPY_AND_ASSIGN(PasswordManagerClientEfl);
};
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#ifdef TIZEN_AUTOFILL_SUPPORT
-class PasswordGenerationManager;
-class PasswordManager;
-
namespace autofill {
class AutofillManager;
struct PasswordForm;
struct PasswordFormFillData;
} // namespace autofill
+namespace password_manager {
// Interface that allows PasswordManager core code to interact with its driver
// (i.e., obtain information from it and give information to it).
+class PasswordGenerationManager;
+class PasswordManager;
class PasswordManagerDriver {
public:
PasswordManagerDriver() {}
private:
DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver);
};
-
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#endif // PASSWORD_MANAGER_DRIVER_H
#include "paths_efl.h"
#include "browser/webdata/web_data_service.h"
#include "browser/webdata/web_data_service_factory.h"
-#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
#include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/browser/password_store_default.h"
-#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
+using namespace password_manager;
+using password_manager::PasswordStore;
+
PasswordStoreService::PasswordStoreService(
scoped_refptr<PasswordStore> password_store)
: password_store_(password_store)
return password_store_;
}
-void PasswordStoreService::Shutdown()
-{
- if (password_store_)
- password_store_->Shutdown();
-}
-
// static
scoped_refptr<PasswordStore> PasswordStoreFactory::GetPasswordStore()
{
ps = new PasswordStoreDefault(
main_thread_runner, db_thread_runner, login_db.release());
-
- if (!ps || !ps->Init()) {
+ if (!ps.get() || !ps->Init(syncer::SyncableService::StartSyncFlare())) {
NOTREACHED() << "Could not initialize password manager.";
return;
}
service_ = new PasswordStoreService(ps);
}
-bool PasswordStoreFactory::ServiceIsNULLWhileTesting() const
-{
- return true;
-}
#endif // TIZEN_AUTOFILL_SUPPORT
#include "base/basictypes.h"
#include "base/memory/singleton.h"
+#include "browser/password_manager/password_manager_driver.h"
+namespace password_manager {
class PasswordStore;
// A wrapper of PasswordStore so we can use it as a profiled keyed service.
scoped_refptr<PasswordStore> GetPasswordStore();
- virtual void Shutdown() override;
-
private:
scoped_refptr<PasswordStore> password_store_;
DISALLOW_COPY_AND_ASSIGN(PasswordStoreService);
PasswordStoreFactory();
virtual ~PasswordStoreFactory();
- virtual bool ServiceIsNULLWhileTesting() const override;
- PasswordStoreService * service_;
+ PasswordStoreService* service_;
DISALLOW_COPY_AND_ASSIGN(PasswordStoreFactory);
};
-
+}
#endif // TIZEN_AUTOFILL_SUPPORT
#endif // PASSWORD_STORE_FACTORY_H
#include "base/path_service.h"
#include "base/files/file_path.h"
#include "paths_efl.h"
-#include "browser/webdata/web_data_service.h"
#include "components/autofill/core/browser/autofill_country.h"
#include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
// Callback to show error dialog on profile load error.
void ProfileErrorCallback(int type, sql::InitStatus status) {
//TODO:Need to check what type of error to show
+ NOTIMPLEMENTED();
}
void InitSyncableServicesOnDBThread(
WebDataServiceWrapper::~WebDataServiceWrapper() {
}
-void WebDataServiceWrapper::Shutdown() {
- autofill_web_data_->ShutdownOnUIThread();
- web_data_->ShutdownOnUIThread();
- web_database_->ShutdownDatabase();
-}
-
scoped_refptr<AutofillWebDataService>
WebDataServiceWrapper::GetAutofillWebData() {
return autofill_web_data_.get();
WebDataServiceFactory::~WebDataServiceFactory() {}
// static
-
WebDataServiceWrapper* WebDataServiceFactory::GetDataService() {
return WebDataServiceWrapper::GetInstance();
}
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "components/webdata/common/web_database_service.h"
+#include "web_data_service.h"
class WebDataService;
virtual ~WebDataServiceWrapper();
- virtual void Shutdown() override;
-
virtual scoped_refptr<autofill::AutofillWebDataService> GetAutofillWebData();
virtual scoped_refptr<WebDataService> GetWebData();
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
+#include "base/prefs/pref_registry_simple.h"
+#include "base/prefs/pref_service.h"
+#include "base/prefs/pref_service_factory.h"
+#include "browser/autofill/autofill_pref_store_efl.h"
#include "browser/geolocation/geolocation_permission_context_efl.h"
+#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/user_prefs/user_prefs.h"
#include "components/visitedlink/browser/visitedlink_master.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "eweb_context.h"
#include "paths_efl.h"
+using namespace autofill::prefs;
using std::pair;
namespace content {
}
#endif
+PrefService* BrowserContextEfl::GetUserPrefService() const {
+ return user_pref_service_.get();
+}
+
BrowserContextEfl::BrowserContextEfl(EWebContext* web_context, bool incognito)
: resource_context_(NULL),
web_context_(web_context),
return *(geolocation_permission_context_.get());
}
+// Shows notifications which correspond to PersistentPrefStore's reading errors.
+void HandleReadError(PersistentPrefStore::PrefReadError error) {
+ NOTIMPLEMENTED();
+}
+
+// Create user pref service for autofill functionality.
+void BrowserContextEfl::CreateUserPrefServiceIfNecessary() {
+ if (user_pref_service_)
+ return;
+
+ PrefRegistrySimple* pref_registry = new PrefRegistrySimple();
+
+ pref_registry->RegisterBooleanPref(kAutofillEnabled, true);
+ pref_registry->RegisterBooleanPref(kAutofillAuxiliaryProfilesEnabled, true);
+ pref_registry->RegisterDoublePref(kAutofillPositiveUploadRate, 0.0);
+ pref_registry->RegisterDoublePref(kAutofillNegativeUploadRate, 0.0);
+
+ base::PrefServiceFactory pref_service_factory;
+ pref_service_factory.set_user_prefs(make_scoped_refptr(new AutofillPrefStore()));
+ pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError));
+ user_pref_service_ = pref_service_factory.Create(pref_registry).Pass();
+
+ user_prefs::UserPrefs::Set(this, user_pref_service_.get());
+}
+
}
#include "net/url_request/url_request_context.h"
class CookieManager;
+class PrefService;
class EWebContext;
namespace visitedlink {
scoped_refptr<content::NotificationControllerEfl>
GetNotificationController() const;
#endif
+ PrefService* GetUserPrefService() const;
+
+ void CreateUserPrefServiceIfNecessary();
private:
static void ReadCertificateAndAdd(base::FilePath* file_path);
mutable scoped_ptr<GeolocationPermissionContextEfl>
geolocation_permission_context_;
scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
+
ResourceContextEfl* resource_context_;
scoped_refptr<URLRequestContextGetterEfl> request_context_getter_;
EWebContext* web_context_;
DownloadManagerDelegateEfl download_manager_delegate_;
base::ScopedTempDir temp_dir_;
bool temp_dir_creation_attempted_;
+ scoped_ptr<PrefService> user_pref_service_;
const bool incognito_;
DISALLOW_COPY_AND_ASSIGN(BrowserContextEfl);
'<(chrome_src_dir)/components/components.gyp:visitedlink_renderer',
'<(chrome_src_dir)/third_party/icu/icu.gyp:icuuc',
'<(chrome_src_dir)/components/components.gyp:sessions_content',
-# [M37] TODO:Autofill related code chagned. Need to enable after Fixing.
- #'<(chrome_src_dir)/components/components.gyp:autofill_content_renderer',
- #'<(chrome_src_dir)/components/components.gyp:autofill_content_browser',
- #'<(chrome_src_dir)/components/components.gyp:password_manager_core_common',
- #'<(chrome_src_dir)/components/components.gyp:password_manager_core_browser',
+ '<(chrome_src_dir)/components/components.gyp:autofill_content_renderer',
+ '<(chrome_src_dir)/components/components.gyp:autofill_content_browser',
+ '<(chrome_src_dir)/components/components.gyp:password_manager_core_common',
+ '<(chrome_src_dir)/components/components.gyp:password_manager_core_browser',
],
'defines': [
'CHROMIUMCORE_IMPLEMENTATION=1',
'API/ewk_web_application_icon_data_private.h',
'API/ewk_web_application_icon_data_private.cc',
'API/ewk_window_features_private.h',
+ 'API/ewk_context_form_autofill_profile_private.h',
+ 'API/ewk_context_form_autofill_profile_private.cc',
'EdgeEffect.cpp',
'EdgeEffect.h',
'browser/autofill/autofill_manager_delegate_efl.cc',
'browser/autofill/autofill_manager_delegate_efl.h',
'browser/autofill/personal_data_manager_factory.cc',
'browser/autofill/personal_data_manager_factory.h',
+ 'browser/autofill/autofill_pref_store_efl.cc',
+ 'browser/autofill/autofill_pref_store_efl.h',
'browser/device_sensors/data_fetcher_impl_tizen.cc',
'browser/device_sensors/data_fetcher_impl_tizen.h',
'browser/device_sensors/data_fetcher_shared_memory_tizen.cc',
'BUILDING_V8_SHARED=1',
'V8_SHARED=1',
'USE_DL_PREFIX=1',
-# [M37] TODO:Autofill related code chagned. Need to enable after Fixing.
- #'TIZEN_AUTOFILL_SUPPORT=1',
+ 'TIZEN_AUTOFILL_SUPPORT=1',
],
# use_aura is enabled but clipboard_efl.cc implements clipboard.
'sources/': [
['exclude', 'browser/web_contents/web_contents_view_aura\\.cc$'],
['exclude', 'clipboard/clipboard_aurax11\\.cc$'],
['exclude', 'gl_context_egl\\.cc$'],
+ ['exclude', 'password_manager/core/browser/password_autofill_manager.(h|cc)$'],
+ ['exclude', 'password_manager/core/browser/password_form_manager.(h|cc)$'],
+ ['exclude', 'password_manager/core/browser/password_generation_manager.(h|cc)$'],
+ ['exclude', 'password_manager/core/browser/password_manager.(h|cc)$'],
+ ['exclude', 'password_manager/core/browser/password_manager_client.(h|cc)$'],
+ ['exclude', 'password_manager/core/browser/password_manager_driver.h'],
+ ['exclude', 'password_manager/core/browser/password_manager_internals_service.(h|cc)$'],
['exclude', 'x11_event_source_glib\\.cc$'],
['exclude', 'x11_event_source_libevent\\.cc$'],
['exclude', 'x11_types\\.cc$'],
CHECK(EwkGlobalData::GetInstance());
browser_context_.reset(new BrowserContextEfl(this));
+ browser_context_.get()->CreateUserPrefServiceIfNecessary();
// Notification Service gets init in BrowserMainRunner init,
// so cache manager can register for notifications only after that.
web_cache_manager_.reset(new WebCacheManagerEfl(browser_context_.get()));
}
void EWebContext::ClearWebkitCache() {
- web_cache_manager_->ClearCache();
+ if (web_cache_manager_)
+ web_cache_manager_->ClearCache();
}
void EWebContext::SetCacheModel(Cache_Model model) {
- web_cache_manager_->SetCacheModel(model);
+ if (web_cache_manager_)
+ web_cache_manager_->SetCacheModel(model);
}
Cache_Model EWebContext::GetCacheModel() const {
void EWebContext::ClearCandidateData() {
#ifdef TIZEN_AUTOFILL_SUPPORT
- WebDataServiceFactory* webDataServiceInstance = WebDataServiceFactory::GetInstance();
- scoped_refptr<autofill::AutofillWebDataService> autofillWebDataService = webDataServiceInstance->GetAutofillWebDataForProfile();
- if(autofillWebDataService) {
- //RemoveFormElementsAddedBetween will schedule task on proper thread, it is done in WebDatabaseService::ScheduleDBTask
- autofillWebDataService->RemoveFormElementsAddedBetween(base::Time(), base::Time::Max());
+ WebDataServiceFactory* webDataServiceInstance =
+ WebDataServiceFactory::GetInstance();
+ scoped_refptr<autofill::AutofillWebDataService> autofillWebDataService =
+ webDataServiceInstance->GetAutofillWebDataForProfile();
+ if (autofillWebDataService.get()) {
+ // RemoveFormElementsAddedBetween will schedule task on proper thread,
+ // it is done in WebDatabaseService::ScheduleDBTask
+ autofillWebDataService->RemoveFormElementsAddedBetween(
+ base::Time(),
+ base::Time::Max());
} else {
DLOG(WARNING) << "AutofillWebDataService is NULL";
}
void EWebContext::ClearPasswordData() {
#if defined(TIZEN_AUTOFILL_SUPPORT)
- PasswordStore* store = PasswordStoreFactory::GetPasswordStore();
- if (store)
+ scoped_refptr<password_manager::PasswordStore> store =
+ password_manager::PasswordStoreFactory::GetPasswordStore();
+ if (store.get())
store->RemoveLoginsCreatedBetween(base::Time(), base::Time::Max());
#else
DLOG(WARNING) << "TIZEN_AUTOFILL_SUPPORT is not enabled";
#ifdef TIZEN_AUTOFILL_SUPPORT
#include "browser/autofill/autofill_manager_delegate_efl.h"
#include "browser/password_manager/password_manager_client_efl.h"
-#include "components/autofill/content/browser/autofill_driver_impl.h"
+#include "components/autofill/content/browser/content_autofill_driver.h"
+#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
-using autofill::AutofillDriverImpl;
using autofill::AutofillManager;
using autofill::AutofillManagerDelegateEfl;
+using autofill::ContentAutofillDriver;
+using password_manager::PasswordManagerClientEfl;
#endif
-
using base::string16;
using namespace tizen_webview;
using namespace ui;
, weak_ptr_factory_(this) {
#ifdef TIZEN_AUTOFILL_SUPPORT
AutofillManagerDelegateEfl::CreateForWebContents(&web_contents_);
- AutofillManagerDelegateEfl * autofill_manager =
- AutofillManagerDelegateEfl::FromWebContents(&web_contents_);
+ AutofillManagerDelegateEfl* autofill_manager =
+ AutofillManagerDelegateEfl::FromWebContents(&web_contents_);
autofill_manager->SetEWebView(view);
- AutofillDriverImpl::CreateForWebContentsAndDelegate(&web_contents_,
- autofill_manager, EWebView::GetPlatformLocale(), AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
+ ContentAutofillDriver::CreateForWebContentsAndDelegate(&web_contents_,
+ autofill_manager,
+ EWebView::GetPlatformLocale(),
+ AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
PasswordManagerClientEfl::CreateForWebContents(&web_contents_);
#endif
}