| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA_H_ | 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_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "chrome/browser/ui/autofill/password_generation_popup_controller.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" | 12 #import "chrome/browser/ui/cocoa/autofill/autofill_popup_base_view_cocoa.h" |
| 13 #import "ui/base/cocoa/tracking_area.h" | 13 #import "ui/base/cocoa/tracking_area.h" |
| 14 | 14 |
| 15 namespace autofill { | 15 namespace autofill { |
| 16 class AutofillPopupController; | 16 class AutofillPopupController; |
| 17 } // namespace autofill | 17 } // namespace autofill |
| 18 | 18 |
| 19 @class HyperlinkTextView; | 19 @class HyperlinkTextView; |
| 20 | 20 |
| 21 // Draws the native password generation popup view on Mac. | 21 // Draws the native password generation popup view on Mac. |
| 22 @interface PasswordGenerationPopupViewCocoa | 22 @interface PasswordGenerationPopupViewCocoa |
| 23 : AutofillPopupBaseViewCocoa <NSTextViewDelegate> { | 23 : AutofillPopupBaseViewCocoa <NSTextViewDelegate> { |
| 24 @private | 24 @private |
| 25 // The cross-platform controller for this view. | 25 // The cross-platform controller for this view. |
| 26 __weak autofill::PasswordGenerationPopupController* controller_; | 26 autofill::PasswordGenerationPopupController* controller_; // weak |
| 27 | 27 |
| 28 base::scoped_nsobject<NSView> passwordSection_; | 28 base::scoped_nsobject<NSView> passwordSection_; |
| 29 base::scoped_nsobject<NSTextField> passwordField_; | 29 base::scoped_nsobject<NSTextField> passwordField_; |
| 30 base::scoped_nsobject<NSTextField> passwordTitleField_; | 30 base::scoped_nsobject<NSTextField> passwordTitleField_; |
| 31 base::scoped_nsobject<NSImageView> keyIcon_; | 31 base::scoped_nsobject<NSImageView> keyIcon_; |
| 32 base::scoped_nsobject<NSBox> divider_; | 32 base::scoped_nsobject<NSBox> divider_; |
| 33 base::scoped_nsobject<HyperlinkTextView> helpTextView_; | 33 base::scoped_nsobject<HyperlinkTextView> helpTextView_; |
| 34 ui::ScopedCrTrackingArea helpTextTrackingArea_; | 34 ui::ScopedCrTrackingArea helpTextTrackingArea_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Designated initializer. | 37 // Designated initializer. |
| 38 - (id)initWithController: | 38 - (id)initWithController: |
| 39 (autofill::PasswordGenerationPopupController*)controller | 39 (autofill::PasswordGenerationPopupController*)controller |
| 40 frame:(NSRect)frame; | 40 frame:(NSRect)frame; |
| 41 | 41 |
| 42 // Determines whether |point| falls inside the password section of the popup. | 42 // Determines whether |point| falls inside the password section of the popup. |
| 43 // |point| needs to be in the popup's coordinate system. | 43 // |point| needs to be in the popup's coordinate system. |
| 44 - (BOOL)isPointInPasswordBounds:(NSPoint)point; | 44 - (BOOL)isPointInPasswordBounds:(NSPoint)point; |
| 45 | 45 |
| 46 // Informs the view that its controller has been (or will imminently be) | 46 // Informs the view that its controller has been (or will imminently be) |
| 47 // destroyed. | 47 // destroyed. |
| 48 - (void)controllerDestroyed; | 48 - (void)controllerDestroyed; |
| 49 | 49 |
| 50 // The preferred size for the popup. | 50 // The preferred size for the popup. |
| 51 - (NSSize)preferredSize; | 51 - (NSSize)preferredSize; |
| 52 | 52 |
| 53 @end | 53 @end |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA
_H_ | 55 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_COCOA
_H_ |
| OLD | NEW |