[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / location_bar / generated_credit_card_view.h
blob5dda7f38e7af8fe63abe6066ce3ce3c396db2654
1 // Copyright 2013 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_LOCATION_BAR_GENERATED_CREDIT_CARD_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_GENERATED_CREDIT_CARD_VIEW_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
11 #include "chrome/browser/ui/views/location_bar/location_bar_decoration_view.h"
12 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
13 #include "ui/views/controls/image_view.h"
15 namespace autofill {
16 class GeneratedCreditCardBubbleController;
19 ////////////////////////////////////////////////////////////////////////////////
21 // GeneratedCreditCardView
23 // An icon that shows up in the omnibox after successfully generating a credit
24 // card number. Used as an anchor and click target to show the associated
25 // bubble with more details about the credit cards saved or used.
27 ////////////////////////////////////////////////////////////////////////////////
28 class GeneratedCreditCardView : public LocationBarDecorationView {
29 public:
30 explicit GeneratedCreditCardView(LocationBarView::Delegate* delegate);
31 virtual ~GeneratedCreditCardView();
33 void Update();
35 protected:
36 // LocationBarDecorationView:
37 virtual bool CanHandleClick() const OVERRIDE;
38 virtual void OnClick() OVERRIDE;
40 private:
41 // Helper to get the GeneratedCreditCardBubbleController associated with the
42 // current web contents.
43 autofill::GeneratedCreditCardBubbleController* GetController() const;
45 LocationBarView::Delegate* delegate_; // weak; outlives us.
47 DISALLOW_COPY_AND_ASSIGN(GeneratedCreditCardView);
50 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_GENERATED_CREDIT_CARD_VIEW_H_