Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/generated_credit_card_decoration.h

Issue 40483003: [rAC, OSX] Add "generated CC" info bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final fixes (arrow position etc.) Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698