Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / password_manager / chrome_password_manager_client.h
index f41cf73..f57fc3b 100644 (file)
@@ -13,8 +13,6 @@
 #include "content/public/browser/web_contents_user_data.h"
 #include "ui/gfx/rect.h"
 
-class PasswordGenerationManager;
-class PasswordManager;
 class Profile;
 
 namespace autofill {
@@ -26,48 +24,64 @@ namespace content {
 class WebContents;
 }
 
+namespace password_manager {
+class PasswordGenerationManager;
+class PasswordManager;
+}
+
 // ChromePasswordManagerClient implements the PasswordManagerClient interface.
 class ChromePasswordManagerClient
-    : public PasswordManagerClient,
+    : public password_manager::PasswordManagerClient,
       public content::WebContentsObserver,
       public content::WebContentsUserData<ChromePasswordManagerClient> {
  public:
   virtual ~ChromePasswordManagerClient();
 
   // PasswordManagerClient implementation.
-  virtual void PromptUserToSavePassword(PasswordFormManager* form_to_save)
-      OVERRIDE;
+  virtual bool IsAutomaticPasswordSavingEnabled() const OVERRIDE;
+  virtual void PromptUserToSavePassword(
+      password_manager::PasswordFormManager* form_to_save) OVERRIDE;
   virtual void PasswordWasAutofilled(
       const autofill::PasswordFormMap& best_matches) const OVERRIDE;
+  virtual void PasswordAutofillWasBlocked(
+      const autofill::PasswordFormMap& best_matches) const OVERRIDE;
   virtual void AuthenticateAutofillAndFillForm(
       scoped_ptr<autofill::PasswordFormFillData> fill_data) OVERRIDE;
   virtual PrefService* GetPrefs() OVERRIDE;
-  virtual PasswordStore* GetPasswordStore() OVERRIDE;
-  virtual PasswordManagerDriver* GetDriver() OVERRIDE;
+  virtual password_manager::PasswordStore* GetPasswordStore() OVERRIDE;
+  virtual password_manager::PasswordManagerDriver* GetDriver() OVERRIDE;
   virtual base::FieldTrial::Probability GetProbabilityForExperiment(
       const std::string& experiment_name) OVERRIDE;
   virtual bool IsPasswordSyncEnabled() OVERRIDE;
-  virtual void SetLogger(PasswordManagerLogger* logger) OVERRIDE;
+  virtual void SetLogger(password_manager::PasswordManagerLogger* logger)
+      OVERRIDE;
   virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE;
+  virtual bool IsLoggingActive() const OVERRIDE;
 
   // Hides any visible generation UI.
   void HidePasswordGenerationPopup();
 
+  static void CreateForWebContentsWithAutofillManagerDelegate(
+      content::WebContents* contents,
+      autofill::AutofillManagerDelegate* delegate);
+
   // Convenience method to allow //chrome code easy access to a PasswordManager
   // from a WebContents instance.
-  static PasswordManager* GetManagerFromWebContents(
+  static password_manager::PasswordManager* GetManagerFromWebContents(
       content::WebContents* contents);
 
   // Convenience method to allow //chrome code easy access to a
   // PasswordGenerationManager from a WebContents instance.
-  static PasswordGenerationManager* GetGenerationManagerFromWebContents(
-      content::WebContents* contents);
+  static password_manager::PasswordGenerationManager*
+      GetGenerationManagerFromWebContents(content::WebContents* contents);
 
   // Observer for PasswordGenerationPopup events. Used for testing.
   void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
 
  private:
-  explicit ChromePasswordManagerClient(content::WebContents* web_contents);
+  ChromePasswordManagerClient(
+      content::WebContents* web_contents,
+      autofill::AutofillManagerDelegate* autofill_manager_delegate);
   friend class content::WebContentsUserData<ChromePasswordManagerClient>;
 
   // content::WebContentsObserver overrides.
@@ -95,7 +109,7 @@ class ChromePasswordManagerClient
 
   Profile* GetProfile();
 
-  ContentPasswordManagerDriver driver_;
+  password_manager::ContentPasswordManagerDriver driver_;
 
   // Observer for password generation popup.
   autofill::PasswordGenerationPopupObserver* observer_;
@@ -110,7 +124,7 @@ class ChromePasswordManagerClient
   // Points to an active logger instance to use for, e.g., reporting progress on
   // saving passwords. If there is no active logger (most of the time), the
   // pointer will be NULL.
-  PasswordManagerLogger* logger_;
+  password_manager::PasswordManagerLogger* logger_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
 };