[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / autofill / password_generation_popup_view_views.h
blob28f07cc9f68b2bc83cd1d7d6a750ae4736a4624c
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_VIEWS_H_
8 #include "chrome/browser/ui/autofill/password_generation_popup_view.h"
9 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h"
10 #include "ui/views/controls/styled_label_listener.h"
12 namespace views {
13 class StyledLabel;
14 class View;
17 namespace autofill {
19 class PasswordGenerationPopupController;
21 class PasswordGenerationPopupViewViews : public AutofillPopupBaseView,
22 public PasswordGenerationPopupView,
23 public views::StyledLabelListener {
24 public:
25 PasswordGenerationPopupViewViews(
26 PasswordGenerationPopupController* controller,
27 views::Widget* observing_widget);
29 // PasswordGenerationPopupView implementation
30 virtual void Show() OVERRIDE;
31 virtual void Hide() OVERRIDE;
32 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE;
33 virtual void PasswordSelectionUpdated() OVERRIDE;
35 private:
36 virtual ~PasswordGenerationPopupViewViews();
38 // Helper function to create |password_view_|.
39 void CreatePasswordView();
41 // views:Views implementation.
42 virtual void Layout() OVERRIDE;
43 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
45 // views::StyledLabelListener implementation
46 virtual void StyledLabelLinkClicked(const gfx::Range& range,
47 int event_flags) OVERRIDE;
49 // Sub views. Used to change bounds when updating. Weak references.
50 views::View* password_view_;
51 views::StyledLabel* help_label_;
53 // Controller for this view. Weak reference.
54 PasswordGenerationPopupController* controller_;
56 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupViewViews);
59 } // namespace autofill
61 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_VIEWS_H_