password_generation_popup_controller.h revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/strings/string16.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace gfx { 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class Range; 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace autofill { 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class PasswordGenerationPopupController : public AutofillPopupViewDelegate { 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Space above and below help section. 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static const int kHelpVerticalPadding = 15; 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Spacing between the border of the popup and any text. 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static const int kHorizontalPadding = 10; 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 2503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // Desired height of the password section. 2603b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) static const int kPopupPasswordSectionHeight = 62; 2703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Called by the view when the saved passwords link is clicked. 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void OnSavedPasswordsLinkClicked() = 0; 305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 31116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch // Return the minimum allowable width for the popup. 32116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch virtual int GetMinimumWidth() = 0; 33116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Accessors 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool display_password() const = 0; 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool password_selected() const = 0; 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual base::string16 password() const = 0; 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Translated strings 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual base::string16 SuggestedText() = 0; 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual const base::string16& HelpText() = 0; 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual const gfx::Range& HelpTextLinkRange() = 0; 435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) protected: 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual ~PasswordGenerationPopupController() {} 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} // namespace autofill 495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ 51