[Rebase][dev/m42_2311] Autofill bringup
authorMichał Obrembski <m.obrembski@samsung.com>
Tue, 5 May 2015 09:19:05 +0000 (11:19 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This commit adds missing Autofill support from m40.

Tested on org.tizen.browser on gmail registration page
(http://accounts.google.com/SignUp)

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=12547
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=12730
Reviewed by: Antonio Gomes, Piotr Tworek, SeungSeop Park

Change-Id: I63d2f633ab8c672695e8de4b8bd3f60515177c71
Signed-off-by: Michał Obrembski <m.obrembski@samsung.com>
33 files changed:
tizen_src/ewk/efl_integration/autofill_popup_view_efl.cc
tizen_src/ewk/efl_integration/autofill_popup_view_efl.h
tizen_src/ewk/efl_integration/browser/autofill/autofill_manager_delegate_efl.cc
tizen_src/ewk/efl_integration/browser/autofill/autofill_manager_delegate_efl.h
tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc
tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.h
tizen_src/ewk/efl_integration/browser/password_manager/content_password_manager_driver.cc
tizen_src/ewk/efl_integration/browser/password_manager/content_password_manager_driver.h
tizen_src/ewk/efl_integration/browser/password_manager/password_form_manager.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_form_manager.h
tizen_src/ewk/efl_integration/browser/password_manager/password_generation_manager.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_generation_manager.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_manager.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_driver.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_util.h
tizen_src/ewk/efl_integration/browser/password_manager/password_manager_util_efl.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.cc
tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.h
tizen_src/ewk/efl_integration/browser/webdata/web_data_service.cc
tizen_src/ewk/efl_integration/browser/webdata/web_data_service.h
tizen_src/ewk/efl_integration/browser/webdata/web_data_service_factory.cc
tizen_src/ewk/efl_integration/browser/webdata/web_data_service_factory.h
tizen_src/ewk/efl_integration/efl_integration.gypi
tizen_src/ewk/efl_integration/eweb_context.cc
tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc
tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.h
tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc
tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc

index 5dcbbb2..25acda8 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "autofill_popup_view_efl.h"
 #include "base/path_service.h"
@@ -194,24 +194,30 @@ void AutofillPopupViewEfl::UpdateFormDataPopup(const gfx::RectF& bounds)
   evas_object_propagate_events_set(autofill_popup_, false);
 }
 
+bool isAutofillSpecial(autofill::Suggestion suggestion) {
+  return suggestion.frontend_id < 0;
+}
+
 void AutofillPopupViewEfl::InitFormData(
-          const std::vector<base::string16>& values,
-          const std::vector<base::string16>& labels,
-          const std::vector<base::string16>& icons,
-          const std::vector<int>& identifiers,
+          const std::vector<autofill::Suggestion>& suggestions,
           base::WeakPtr<AutofillPopupDelegate> delegate){
-  values_ = values;
+  values_ = suggestions;
+  // m42 adds some "special" autofill sugesstions.
+  // This suggestions, like list separator is not useful for us
+  // so, let's delete them.
+  values_.erase(
+    std::remove_if(values_.begin(), values_.end(), isAutofillSpecial),
+    values_.end());
+
   for (size_t i = 0; i < values_.size(); ++i) {
-    std::string value = UTF16ToUTF8(values_[i]);
-    std::string label = UTF16ToUTF8(labels[i]);
+    std::string value = UTF16ToUTF8(suggestions[i].value);
+    std::string label = UTF16ToUTF8(suggestions[i].label);
     if(!label.empty())
       snprintf(labels_[i], sizeof(labels_[i]), "%s (%s)", value.c_str(),
           label.c_str());
     else
       snprintf(labels_[i], sizeof(labels_[i]), "%s", value.c_str());
   }
-  icons_ = icons;
-  identifiers_ = identifiers;
   delegate_ = delegate;
   selected_line_ = -1;
 }
@@ -220,7 +226,7 @@ void AutofillPopupViewEfl::AcceptSuggestion(size_t index)
 {
   if (delegate_) {
     if (index < values_.size())
-      delegate_->DidAcceptSuggestion(values_[index], identifiers_[index]);
+      delegate_->DidAcceptSuggestion(values_[index].value, index);
   }
 }
 
@@ -255,8 +261,8 @@ void AutofillPopupViewEfl::SetSelectedLine(size_t selected_line)
   selected_line_ = selected_line;
   if(delegate_) {
     if (selected_line_ < values_.size()) {
-      delegate_->DidSelectSuggestion(values_[selected_line],
-          identifiers_[selected_line_]);
+      delegate_->DidSelectSuggestion(values_[selected_line].value,
+          selected_line);
     }
     else {
       delegate_->ClearPreviewedForm();
index 83f434b..c0eecda 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef AUTOFILL_POPUP_EFL_H
 #define AUTOFILL_POPUP_EFL_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <Ecore.h>
 #include <Ecore_X.h>
 
 #include "browser/password_manager/password_form_manager.h"
 #include "components/autofill/core/browser/autofill_popup_delegate.h"
+#include "components/autofill/core/browser/suggestion.h"
 #include "ui/gfx/geometry/point.h"
+#include "ui/gfx/screen.h"
 
 using namespace password_manager;
 class EWebView;
 
+namespace gfx {
+class RectF;
+}
+
 namespace autofill {
 
 class AutofillPopupViewEfl {
@@ -32,11 +38,8 @@ public:
   void ShowSavePasswordPopup(PasswordFormManager * form_to_save);
   void UpdateFormDataPopup(const gfx::RectF& bounds);
   void InitFormData(
-        const std::vector<base::string16>& values,
-        const std::vector<base::string16>& labels,
-        const std::vector<base::string16>& icons,
-        const std::vector<int>& identifiers,
-        base::WeakPtr<AutofillPopupDelegate> delegate);
+      const std::vector<autofill::Suggestion>& suggestions,
+      base::WeakPtr<AutofillPopupDelegate> delegate);
   void AcceptSuggestion(size_t index);
   void AcceptPasswordSuggestion(int option);
   void SetSelectedLine(size_t index);
@@ -50,9 +53,7 @@ private:
   Evas_Object* autofill_popup_;
   Evas_Object* autofill_list_;
   Evas_Object* password_popup_;
-  std::vector<base::string16> values_;
-  std::vector<base::string16> icons_;
-  std::vector<int> identifiers_;
+  std::vector<autofill::Suggestion> values_;
   size_t selected_line_;
   base::WeakPtr<AutofillPopupDelegate> delegate_;
   PasswordFormManager * form_manager_;
index c2deea5..f86bebc 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/autofill/autofill_manager_delegate_efl.h"
 
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/browser_thread.h"
 #include "ui/gfx/geometry/rect.h"
+#include "private/ewk_context_private.h"
 
 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::AutofillManagerDelegateEfl);
 
-using namespace password_manager;
 
 namespace autofill {
 
@@ -85,7 +85,7 @@ void AutofillManagerDelegateEfl::ConfirmSaveCreditCard(const base::Closure& save
 
 void AutofillManagerDelegateEfl::ShowRequestAutocompleteDialog(
     const autofill::FormData& form,
-    const GURL& source_url,
+    content::RenderFrameHost* rfh,
     const ResultCallback& callback) {
   HideRequestAutocompleteDialog();
   NOTIMPLEMENTED();
@@ -94,11 +94,8 @@ void AutofillManagerDelegateEfl::ShowRequestAutocompleteDialog(
 void AutofillManagerDelegateEfl::ShowAutofillPopup(
     const gfx::RectF& element_bounds,
     base::i18n::TextDirection text_direction,
-    const std::vector<base::string16>& values,
-    const std::vector<base::string16>& labels,
-    const std::vector<base::string16>& icons,
-    const std::vector<int>& identifiers,
-    base::WeakPtr<AutofillPopupDelegate> delegate) {
+    const std::vector<autofill::Suggestion>& suggestions,
+    base::WeakPtr<autofill::AutofillPopupDelegate> delegate) {
   DCHECK(web_contents_);
   // Do not show sugestions when Remember form data is disabled
   if (!IsAutocompleteSavingEnabled())
@@ -110,7 +107,7 @@ void AutofillManagerDelegateEfl::ShowAutofillPopup(
 #endif
 
   if (GetOrCreatePopupController()) {
-    popup_controller_->InitFormData(values,labels,icons,identifiers,delegate);
+    popup_controller_->InitFormData(suggestions, delegate);
 #if defined(OS_TIZEN)
     popup_controller_->UpdateFormDataPopup(element_bounds_in_screen_space);
 #else
@@ -120,10 +117,45 @@ void AutofillManagerDelegateEfl::ShowAutofillPopup(
   }
 }
 
-void AutofillManagerDelegateEfl::UpdateAutofillPopupDataListValues(const std::vector<base::string16>& values, const std::vector<base::string16>& labels) {
+void AutofillManagerDelegateEfl::ShowUnmaskPrompt(
+    const autofill::CreditCard& card,
+    base::WeakPtr<autofill::CardUnmaskDelegate> delegate) {
+  NOTIMPLEMENTED();
+}
+
+void AutofillManagerDelegateEfl::UpdateAutofillPopupDataListValues(
+    const std::vector<base::string16>& values,
+    const std::vector<base::string16>& labels) {
+  NOTIMPLEMENTED();
+}
+
+void AutofillManagerDelegateEfl::OnUnmaskVerificationResult(bool success) {
+  NOTIMPLEMENTED();
+}
+
+bool AutofillManagerDelegateEfl::HasCreditCardScanFeature() {
+  return false;
+}
+
+void AutofillManagerDelegateEfl::ScanCreditCard(
+    const CreditCardScanCallback& callback) {
+  NOTIMPLEMENTED();
+}
+
+void AutofillManagerDelegateEfl::OnFirstUserGestureObserved() {
   NOTIMPLEMENTED();
 }
 
+void AutofillManagerDelegateEfl::LinkClicked(
+    const GURL& url,
+    WindowOpenDisposition disposition) {
+  NOTIMPLEMENTED();
+}
+
+IdentityProvider* AutofillManagerDelegateEfl::GetIdentityProvider() {
+  return nullptr;
+}
+
 void AutofillManagerDelegateEfl::HideAutofillPopup() {
   DCHECK(web_contents_);
   if (popup_controller_) {
@@ -137,13 +169,13 @@ void AutofillManagerDelegateEfl::HideAutofillPopup() {
 }
 
 bool AutofillManagerDelegateEfl::IsAutocompleteEnabled() {
-  if(webview_)
+  if (webview_)
     return webview_->GetSettings()->autofillProfileForm();
   return false;
 }
 
 bool AutofillManagerDelegateEfl::IsAutocompleteSavingEnabled() {
-  if(webview_)
+  if (webview_)
     return webview_->GetSettings()->formCandidateData();
   return false;
 }
@@ -165,7 +197,9 @@ void AutofillManagerDelegateEfl::WebContentsDestroyed() {
   HideAutofillPopup();
 }
 
-void AutofillManagerDelegateEfl::DetectAccountCreationForms(const std::vector<autofill::FormStructure*>& forms) {
+void AutofillManagerDelegateEfl::DetectAccountCreationForms(
+    content::RenderFrameHost* rfh,
+    const std::vector<autofill::FormStructure*>& forms) {
   DCHECK(web_contents_);
   PasswordGenerationManager* manager =
       PasswordManagerClientEfl::GetGenerationManagerFromWebContents(
index 06ce4ad..3a1c184 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef AUTOFILL_MANAGER_DELEGATE_EFL_H
 #define AUTOFILL_MANAGER_DELEGATE_EFL_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "eweb_view.h"
 #include "base/callback.h"
@@ -47,23 +47,30 @@ class AutofillManagerDelegateEfl
       const base::Closure& save_card_callback) override;
   void ShowRequestAutocompleteDialog(
       const autofill::FormData& form,
-      const GURL& source_url,
+      content::RenderFrameHost* rfh,
       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>& labels,
-      const std::vector<base::string16>& icons,
-      const std::vector<int>& identifiers,
-      base::WeakPtr<AutofillPopupDelegate> delegate) override;
+      const std::vector<autofill::Suggestion>& suggestions,
+      base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override;
+  void ShowUnmaskPrompt(
+      const autofill::CreditCard& card,
+      base::WeakPtr<autofill::CardUnmaskDelegate> delegate) override;
   void UpdateAutofillPopupDataListValues(
       const std::vector<base::string16>& values,
       const std::vector<base::string16>& labels) override;
+  void OnUnmaskVerificationResult(bool success) override;
+  bool HasCreditCardScanFeature() override;
+  void ScanCreditCard(const CreditCardScanCallback& callback) override;
+  void OnFirstUserGestureObserved() override;
+  void LinkClicked(const GURL& url, WindowOpenDisposition disposition) override;
+  IdentityProvider* GetIdentityProvider() override;
   void HideAutofillPopup() override;
   bool IsAutocompleteEnabled() override;
-  bool IsAutocompleteSavingEnabled() override;
+  bool IsAutocompleteSavingEnabled();
   void DetectAccountCreationForms(
+      content::RenderFrameHost* rfh,
       const std::vector<autofill::FormStructure*>& forms) override;
   // content::WebContentsObserver implementation.
   void DidNavigateMainFrame(const content::LoadCommittedDetails& details,
index 83239b7..528276e 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/autofill/personal_data_manager_factory.h"
 
index 497413b..4d89975 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef PERSONAL_DATA_MANAGER_FACTORY_H
 #define PERSONAL_DATA_MANAGER_FACTORY_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 #include "base/id_map.h"
 #include "base/strings/string16.h"
 #include "base/compiler_specific.h"
index cc0b970..db80408 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/content_password_manager_driver.h"
 
@@ -103,9 +103,12 @@ bool ContentPasswordManagerDriver::OnMessageReceived(
 }
 
 autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() {
-  autofill::ContentAutofillDriver* driver =
+  autofill::ContentAutofillDriverFactory* factory =
       autofill::ContentAutofillDriverFactory::FromWebContents(web_contents());
-  return driver ? driver->autofill_manager() : NULL;
+  return factory
+         ? factory->DriverForFrame(web_contents()->GetMainFrame())
+               ->autofill_manager()
+         : nullptr;
 }
 
 void ContentPasswordManagerDriver::AllowPasswordGenerationForForm(
index b36aeca..6a0b63c 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef CONTENT_PASSWORD_MANAGER_DRIVER_H
 #define CONTENT_PASSWORD_MANAGER_DRIVER_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
index 4b1910f..13987ee 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_form_manager.h"
 
@@ -270,7 +270,7 @@ bool PasswordFormManager::HasCompletedMatching() {
 }
 
 void PasswordFormManager::OnRequestDone(
-    const std::vector<PasswordForm*>& logins_result) {
+    ScopedVector<autofill::PasswordForm> logins_result) {
   // Note that the result gets deleted after this call completes, but we own
   // the PasswordForm objects pointed to by the result vector, thus we keep
   // copies to a minimum here.
@@ -397,7 +397,7 @@ void PasswordFormManager::OnGetPasswordStoreResults(
     driver_->AllowPasswordGenerationForForm(&observed_form_);
     return;
   }
-  OnRequestDone(results);
+  OnRequestDone(results.Pass());
 }
 
 bool PasswordFormManager::IgnoreResult(const PasswordForm& form) const {
index 01bdfaa..1c89428 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_FORM_MANAGER_H
 #define PASSWORD_FORM_MANAGER_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <string>
 #include <vector>
@@ -102,7 +102,7 @@ class PasswordFormManager : public PasswordStoreConsumer {
 
   // Determines if we need to autofill given the results of the query.
   // Takes ownership of the elements in |result|.
-  void OnRequestDone(const std::vector<autofill::PasswordForm*>& result);
+  void OnRequestDone(ScopedVector<autofill::PasswordForm> result);
 
   void OnGetPasswordStoreResults(
       ScopedVector<autofill::PasswordForm> results) override;
index aec76a8..b69753e 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_generation_manager.h"
 
index 28ef9a0..63f95ee 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_manager.h"
 
index 533b38c..fd46aab 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_MANAGER_H
 #define PASSWORD_MANAGER_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <vector>
 
index ec7a3e9..46cf7f3 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_manager_client.h"
 
index 345ef27..a53cdbc 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_MANAGER_CLIENT_H
 #define PASSWORD_MANAGER_CLIENT_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/metrics/field_trial.h"
 #include "components/autofill/core/common/password_form.h"
index 6dfdea2..a3c4cee 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_manager_client_efl.h"
 #include "browser/autofill/autofill_manager_delegate_efl.h"
index 0b2dc27..1899d51 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_MANAGER_CLIENT_EFL_H
 #define PASSWORD_MANAGER_CLIENT_EFL_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
index e48deab..de161b9 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_MANAGER_DRIVER_H
 #define PASSWORD_MANAGER_DRIVER_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 namespace autofill {
 class AutofillManager;
index 6724c8b..b833030 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_MANAGER_UTIL_H
 #define PASSWORD_MANAGER_UTIL_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/basictypes.h"
 #include "ui/gfx/native_widget_types.h"
index ea1c1e7..b329d2e 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_manager_util.h"
 
index f763ec1..0cb7e69 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/password_manager/password_store_factory.h"
 
@@ -73,10 +73,10 @@ void PasswordStoreFactory::Init()
 
   base::FilePath login_db_file_path = db_path.Append(FILE_PATH_LITERAL(".LoginData.db"));
 
-  scoped_ptr<LoginDatabase> login_db(new LoginDatabase());
+  scoped_ptr<LoginDatabase> login_db(new LoginDatabase(login_db_file_path));
   {
     base::ThreadRestrictions::ScopedAllowIO allow_io;
-    if (!login_db->Init(login_db_file_path)) {
+    if (!login_db->Init()) {
       LOG(ERROR) << "Could not initialize login database.";
       return;
     }
@@ -91,7 +91,7 @@ void PasswordStoreFactory::Init()
   scoped_refptr<PasswordStore> ps;
 
   ps = new PasswordStoreDefault(
-      main_thread_runner, db_thread_runner, login_db.release());
+      main_thread_runner, db_thread_runner, login_db.Pass());
   if (!ps.get() || !ps->Init(syncer::SyncableService::StartSyncFlare())) {
     NOTREACHED() << "Could not initialize password manager.";
     return;
index a60cce8..c9e4a01 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef PASSWORD_STORE_FACTORY_H
 #define PASSWORD_STORE_FACTORY_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/basictypes.h"
 #include "base/memory/singleton.h"
index ad32a4c..d659aed 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/webdata/web_data_service.h"
 
index 9499ac9..61d2670 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef WEB_DATA_SERVICE_H
 #define WEB_DATA_SERVICE_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <map>
 #include <string>
index ee44682..b09e564 100644 (file)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "browser/webdata/web_data_service_factory.h"
 
index e307dbd..009532c 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef WEB_DATA_SERVICE_FACTORY_H
 #define WEB_DATA_SERVICE_FACTORY_H
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include "base/basictypes.h"
 #include "base/memory/ref_counted.h"
index 2059370..5580d36 100644 (file)
@@ -5,6 +5,7 @@
 {
   'variables': {
     'edje_compiler%': 'edje_cc',
+    'tizen_autofill_support%': 1,
 
     # Components used to auto generate CHROMIUM_VERSION preprocessor define.
     'version_file'   : '<(DEPTH)/chrome/VERSION',
@@ -59,9 +60,6 @@
 
     'defines': [
       'HAVE_ECORE_X=<!(if pkg-config ecore-x; then echo 1; fi)',
-      # TODO: Autofill has changed significantly in M42 compared to
-      #       M40. Disable it until it is fixed.
-      #'TIZEN_AUTOFILL_SUPPORT=1',
       'CHROMIUM_VERSION=\"<!(python <(version_script) -f <(version_file) -t "<(version_pattern)")\"',
     ],
     'link_settings': {
         ],
       }],
 
+      ['tizen_autofill_support==1', {
+        'defines': [
+          'TIZEN_AUTOFILL_SUPPORT=1',
+        ],
+      }],
+
       ['use_allocator=="tcmalloc"', {
         'dependencies': [
           '<(DEPTH)/base/allocator/allocator.gyp:allocator',
index 68b515c..17566b4 100644 (file)
@@ -505,7 +505,7 @@ Evas_Object *EWebContext::AddFaviconObject(const char* uri, Evas* canvas) const
 }
 
 void EWebContext::ClearCandidateData() {
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
   if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
     BrowserThread::PostTask(
         BrowserThread::UI, FROM_HERE,
index 012f5c7..474d241 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "ewk_context_form_autofill_profile_private.h"
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <vector>
 #include <string>
@@ -17,6 +17,7 @@
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "eweb_view.h"
 #include "ewk_autofill_profile_private.h"
+#include "private/ewk_context_private.h"
 
 namespace autofill {
 class PersonalDataManagerFactory;
index c68428e..e6f0fb1 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef ewk_context_form_autofill_profile_private_h
 #define ewk_context_form_autofill_profile_private_h
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 
 #include <Evas.h>
 
index a2cd539..232c812 100644 (file)
@@ -32,7 +32,7 @@
 #include "content/renderer/tts_dispatcher_efl.h"
 #endif
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 #include "components/autofill/content/renderer/autofill_agent.h"
 #include "components/autofill/content/renderer/password_autofill_agent.h"
 #include "components/autofill/content/renderer/password_generation_agent.h"
@@ -44,7 +44,7 @@
 #include "content/common/wrt/wrt_url_parse.h"
 #include "wrt/wrtwidget.h"
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 using autofill::AutofillAgent;
 using autofill::PasswordAutofillAgent;
 using autofill::PasswordGenerationAgent;
@@ -89,22 +89,22 @@ void ContentRendererClientEfl::RenderThreadStarted()
 
 void ContentRendererClientEfl::RenderFrameCreated(content::RenderFrame* render_frame) {
   new content::RenderFrameObserverEfl(render_frame);
-}
-
-void ContentRendererClientEfl::RenderViewCreated(content::RenderView* render_view) {
-  // Deletes itself when render_view is destroyed.
-  new RenderViewObserverEfl(render_view, this);
-  new editing::EditorClientAgent(render_view);
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
   PasswordGenerationAgent* password_generation_agent =
-      new PasswordGenerationAgent(render_view);
+      new PasswordGenerationAgent(render_frame);
   PasswordAutofillAgent* password_autofill_agent =
-      new PasswordAutofillAgent(render_view);
-  new AutofillAgent(render_view,
+      new PasswordAutofillAgent(render_frame);
+  new AutofillAgent(render_frame,
                     password_autofill_agent,
                     password_generation_agent);
 #endif
+}
+
+void ContentRendererClientEfl::RenderViewCreated(content::RenderView* render_view) {
+  // Deletes itself when render_view is destroyed.
+  new RenderViewObserverEfl(render_view, this);
+  new editing::EditorClientAgent(render_view);
 
 #if !defined(EWK_BRINGUP)
   render_view->SetWrtUrlParser(wrt_url_parser_.get());
index eded89a..e708c29 100644 (file)
 #include "media/video/capture/tizen/video_capture_device_tizen.h"
 #endif
 
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
 #include "browser/autofill/autofill_manager_delegate_efl.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
 #include "browser/password_manager/password_manager_client_efl.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::AutofillManager;
 using autofill::AutofillManagerDelegateEfl;
-using autofill::ContentAutofillDriver;
+using autofill::ContentAutofillDriverFactory;
 using password_manager::PasswordManagerClientEfl;
 #endif
 using base::string16;
@@ -86,16 +86,16 @@ WebContentsDelegateEfl::WebContentsDelegateEfl(EWebView* view)
     , document_created_(false)
     , dialog_manager_(NULL)
     , weak_ptr_factory_(this) {
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
   AutofillManagerDelegateEfl::CreateForWebContents(&web_contents_);
   AutofillManagerDelegateEfl* autofill_manager =
       AutofillManagerDelegateEfl::FromWebContents(&web_contents_);
   autofill_manager->SetEWebView(view);
-  ContentAutofillDriver::CreateForWebContentsAndDelegate(&web_contents_,
-      autofill_manager,
-      EWebView::GetPlatformLocale(),
-      AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
   PasswordManagerClientEfl::CreateForWebContents(&web_contents_);
+  ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(&web_contents_,
+    autofill_manager,
+    EWebView::GetPlatformLocale(),
+    AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
 #endif
 }
 
@@ -449,7 +449,7 @@ JavaScriptDialogManager* WebContentsDelegateEfl::GetJavaScriptDialogManager(
 }
 
 void WebContentsDelegateEfl::OnUpdateSettings(const Ewk_Settings *settings) {
-#ifdef TIZEN_AUTOFILL_SUPPORT
+#if defined(TIZEN_AUTOFILL_SUPPORT)
   PasswordManagerClientEfl *client =
       PasswordManagerClientEfl::FromWebContents(&web_contents_);
   if(client) {