| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" | 10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual base::FieldTrial::Probability GetProbabilityForExperiment( | 53 virtual base::FieldTrial::Probability GetProbabilityForExperiment( |
| 54 const std::string& experiment_name) OVERRIDE; | 54 const std::string& experiment_name) OVERRIDE; |
| 55 virtual bool IsPasswordSyncEnabled() OVERRIDE; | 55 virtual bool IsPasswordSyncEnabled() OVERRIDE; |
| 56 virtual void OnLogRouterAvailabilityChanged(bool router_can_be_used) OVERRIDE; | 56 virtual void OnLogRouterAvailabilityChanged(bool router_can_be_used) OVERRIDE; |
| 57 virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE; | 57 virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE; |
| 58 virtual bool IsLoggingActive() const OVERRIDE; | 58 virtual bool IsLoggingActive() const OVERRIDE; |
| 59 | 59 |
| 60 // Hides any visible generation UI. | 60 // Hides any visible generation UI. |
| 61 void HidePasswordGenerationPopup(); | 61 void HidePasswordGenerationPopup(); |
| 62 | 62 |
| 63 static void CreateForWebContentsWithAutofillManagerDelegate( | 63 static void CreateForWebContentsWithAutofillClient( |
| 64 content::WebContents* contents, | 64 content::WebContents* contents, |
| 65 autofill::AutofillManagerDelegate* delegate); | 65 autofill::AutofillClient* autofill_client); |
| 66 | 66 |
| 67 // Convenience method to allow //chrome code easy access to a PasswordManager | 67 // Convenience method to allow //chrome code easy access to a PasswordManager |
| 68 // from a WebContents instance. | 68 // from a WebContents instance. |
| 69 static password_manager::PasswordManager* GetManagerFromWebContents( | 69 static password_manager::PasswordManager* GetManagerFromWebContents( |
| 70 content::WebContents* contents); | 70 content::WebContents* contents); |
| 71 | 71 |
| 72 // Convenience method to allow //chrome code easy access to a | 72 // Convenience method to allow //chrome code easy access to a |
| 73 // PasswordGenerationManager from a WebContents instance. | 73 // PasswordGenerationManager from a WebContents instance. |
| 74 static password_manager::PasswordGenerationManager* | 74 static password_manager::PasswordGenerationManager* |
| 75 GetGenerationManagerFromWebContents(content::WebContents* contents); | 75 GetGenerationManagerFromWebContents(content::WebContents* contents); |
| 76 | 76 |
| 77 // Observer for PasswordGenerationPopup events. Used for testing. | 77 // Observer for PasswordGenerationPopup events. Used for testing. |
| 78 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); | 78 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 ChromePasswordManagerClient( | 81 ChromePasswordManagerClient(content::WebContents* web_contents, |
| 82 content::WebContents* web_contents, | 82 autofill::AutofillClient* autofill_client); |
| 83 autofill::AutofillManagerDelegate* autofill_manager_delegate); | |
| 84 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 83 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
| 85 | 84 |
| 86 // content::WebContentsObserver overrides. | 85 // content::WebContentsObserver overrides. |
| 87 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 86 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 88 | 87 |
| 89 // Callback method to be triggered when authentication is successful for a | 88 // Callback method to be triggered when authentication is successful for a |
| 90 // given password authentication request. If authentication is disabled or | 89 // given password authentication request. If authentication is disabled or |
| 91 // not supported, this will be triggered directly. | 90 // not supported, this will be triggered directly. |
| 92 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); | 91 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); |
| 93 | 92 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 120 // Allows authentication callbacks to be destroyed when this client is gone. | 119 // Allows authentication callbacks to be destroyed when this client is gone. |
| 121 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; | 120 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; |
| 122 | 121 |
| 123 // True if |this| is registered with some LogRouter which can accept logs. | 122 // True if |this| is registered with some LogRouter which can accept logs. |
| 124 bool can_use_log_router_; | 123 bool can_use_log_router_; |
| 125 | 124 |
| 126 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 125 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
| 127 }; | 126 }; |
| 128 | 127 |
| 129 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 128 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| OLD | NEW |