OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_GENERATED_CREDIT_CARD_DECORATION_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_GENERATED_CREDIT_CARD_DECORATION_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
| 12 |
| 13 class LocationBarViewMac; |
| 14 |
| 15 namespace autofill { |
| 16 class GeneratedCreditCardBubbleController; |
| 17 } |
| 18 |
| 19 // An icon that shows up in the omnibox after successfully generating a credit |
| 20 // card number. Used as an anchor and click target to show the associated |
| 21 // bubble with more details about the credit cards saved or used. |
| 22 class GeneratedCreditCardDecoration : public ImageDecoration { |
| 23 public: |
| 24 explicit GeneratedCreditCardDecoration(LocationBarViewMac* owner); |
| 25 virtual ~GeneratedCreditCardDecoration(); |
| 26 |
| 27 // Called when this decoration should update its visible status. |
| 28 void Update(); |
| 29 |
| 30 // Get the point where the bookmark bubble should point within the |
| 31 // decoration's frame. |
| 32 NSPoint GetBubblePointInFrame(NSRect frame); |
| 33 |
| 34 // Implement |LocationBarDecoration|. |
| 35 // N.B. - this is identical to LocationBarDecorationView's OnClick |
| 36 // and canHandleClick. |
| 37 virtual bool AcceptsMousePress() OVERRIDE; |
| 38 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| 39 |
| 40 private: |
| 41 // Helper to get the GeneratedCreditCardBubbleController associated with the |
| 42 // current web contents. |
| 43 autofill::GeneratedCreditCardBubbleController* GetController() const; |
| 44 |
| 45 // The control that owns this. Weak. |
| 46 LocationBarViewMac* owner_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(GeneratedCreditCardDecoration); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_GENERATED_CREDIT_CARD_DECORATION
_H_ |
| 52 |
OLD | NEW |