| Index: chrome/browser/password_manager/password_generation_manager.h
|
| diff --git a/chrome/browser/password_manager/password_generation_manager.h b/chrome/browser/password_manager/password_generation_manager.h
|
| index 6d0a7ffd1fe86953737c2b29d24b36d98b00842c..10432636c71a5d40d9da9e6c1251d966c40cc08a 100644
|
| --- a/chrome/browser/password_manager/password_generation_manager.h
|
| +++ b/chrome/browser/password_manager/password_generation_manager.h
|
| @@ -7,13 +7,18 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "components/autofill/core/common/password_form.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/browser/web_contents_user_data.h"
|
| +#include "ui/gfx/rect.h"
|
|
|
| namespace autofill {
|
| struct FormData;
|
| class FormStructure;
|
| class PasswordGenerator;
|
| +class PasswordGenerationPopupControllerImpl;
|
| +class PasswordGenerationPopupObserver;
|
| struct PasswordForm;
|
| }
|
|
|
| @@ -46,6 +51,12 @@ class PasswordGenerationManager
|
| void DetectAccountCreationForms(
|
| const std::vector<autofill::FormStructure*>& forms);
|
|
|
| + // Hide any visible password generation related popups.
|
| + void HidePopup();
|
| +
|
| + // Observer for PasswordGenerationPopup events. Used for testing.
|
| + void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer);
|
| +
|
| protected:
|
| explicit PasswordGenerationManager(content::WebContents* contents);
|
|
|
| @@ -65,16 +76,36 @@ class PasswordGenerationManager
|
| content::RenderViewHost* host,
|
| const std::vector<autofill::FormData>& forms);
|
|
|
| - // Causes the password generation bubble UI to be shown for the specified
|
| - // form. The popup will be anchored at |icon_bounds|. The generated
|
| - // password will be no longer than |max_length|.
|
| - void OnShowPasswordGenerationPopup(const gfx::Rect& icon_bounds,
|
| + // Given |bounds| in the renderers coordinate system, return the same bounds
|
| + // in the screens coordinate system.
|
| + gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds);
|
| +
|
| + // Causes the password generation UI to be shown for the specified form.
|
| + // The popup will be anchored at |element_bounds|. The generated password
|
| + // will be no longer than |max_length|.
|
| + void OnShowPasswordGenerationPopup(const gfx::RectF& element_bounds,
|
| int max_length,
|
| const autofill::PasswordForm& form);
|
|
|
| + // Causes the password editing UI to be shown anchored at |element_bounds|.
|
| + void OnShowPasswordEditingPopup(const gfx::RectF& element_bounds);
|
| +
|
| + // Hide any visible UI.
|
| + void OnHidePasswordGenerationPopup();
|
| +
|
| + // Observer for password generation popup.
|
| + autofill::PasswordGenerationPopupObserver* observer_;
|
| +
|
| // Controls how passwords are generated.
|
| scoped_ptr<autofill::PasswordGenerator> password_generator_;
|
|
|
| + // Form that password generation is being offered for.
|
| + autofill::PasswordForm form_;
|
| +
|
| + // Controls the popup
|
| + base::WeakPtr<
|
| + autofill::PasswordGenerationPopupControllerImpl> popup_controller_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);
|
| };
|
|
|
|
|