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_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h"
12 #import "chrome/browser/ui/cocoa/autofill/autofill_popup_base_view_cocoa.h"
13 #import "ui/base/cocoa/tracking_area.h"
16 class AutofillPopupController
;
17 } // namespace autofill
19 @
class HyperlinkTextView
;
21 // Draws the native password generation popup view on Mac.
22 @interface PasswordGenerationPopupViewCocoa
23 : AutofillPopupBaseViewCocoa
<NSTextViewDelegate
> {
25 // The cross-platform controller for this view.
26 __weak
autofill::PasswordGenerationPopupController
* controller_
;
28 base::scoped_nsobject
<NSView
> passwordSection_
;
29 base::scoped_nsobject
<NSTextField
> passwordField_
;
30 base::scoped_nsobject
<NSTextField
> passwordTitleField_
;
31 base::scoped_nsobject
<NSImageView
> keyIcon_
;
32 base::scoped_nsobject
<NSBox
> divider_
;
33 base::scoped_nsobject
<HyperlinkTextView
> helpTextView_
;
34 ui::ScopedCrTrackingArea helpTextTrackingArea_
;
37 // Designated initializer.
38 - (id
)initWithController
:
39 (autofill::PasswordGenerationPopupController
*)controller
42 // Determines whether |point| falls inside the password section of the popup.
43 // |point| needs to be in the popup's coordinate system.
44 - (BOOL
)isPointInPasswordBounds
:(NSPoint
)point
;
46 // Informs the view that its controller has been (or will imminently be)
48 - (void)controllerDestroyed
;
50 // The preferred size for the popup.
51 - (NSSize
)preferredSize
;
55 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA_H_