Index: chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h b/chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d0bcf578817153410a1bffdace45b2375ad56f62 |
--- /dev/null |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_overlay_controller.h |
@@ -0,0 +1,68 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ |
+#define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#include "base/mac/scoped_nsobject.h" |
+#include "base/memory/scoped_ptr.h" |
+#import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" |
+ |
+namespace autofill { |
+ class AutofillDialogViewDelegate; |
+ struct DialogOverlayState; |
+} // namespace autofill |
+ |
+namespace ui { |
+ class Animation; |
+ class MultiAnimation; |
+} // namespace ui |
+ |
+class AnimationDelegateBridge; |
+class OverlayTimerBridge; |
+ |
+@class AutofillMessageStackView; |
+ |
+// Protocol that allows Cocoa objects to act as a delegate for a ui::Animation. |
+@protocol ChromiumAnimationDelegate |
+- (void)animationProgressed:(const ui::Animation*)animation; |
+- (void)animationEnded:(const ui::Animation*)animation; |
+@end |
+ |
+ |
+@interface AutofillOverlayController : |
+ NSViewController<ChromiumAnimationDelegate, AutofillLayout> { |
+ @private |
+ base::scoped_nsobject<NSBox> view_; // The main view. |
+ base::scoped_nsobject<NSView> childView_; // Contains all UI elements. |
sail
2013/09/04 21:18:51
maybe add a comment that this is used for the fade
groby-ooo-7-16
2013/09/04 22:19:01
Done.
|
+ base::scoped_nsobject<NSImageView> imageView_; |
+ base::scoped_nsobject<AutofillMessageStackView> messageStackView_; |
+ |
+ scoped_ptr<ui::MultiAnimation> fadeOutAnimation_; // Animation rules. |
+ scoped_ptr<AnimationDelegateBridge> animationDelegate_; |
+ |
+ // Timer to control refresh rate of the overlay's state. |
+ scoped_ptr<OverlayTimerBridge> refreshTimer_; |
+ |
+ autofill::AutofillDialogViewDelegate* delegate_; // not owned, owns dialog. |
+} |
+ |
+// Designated initializer. |
+- (id)initWithDelegate:(autofill::AutofillDialogViewDelegate*)delegate; |
+ |
+// Updates the state from the dialog controller. |
+- (void)updateState; |
+ |
+// Start the animation sequence. At its end, the dialog will hide itself. |
+- (void)beginFadeOut; |
+ |
+// Get the preferred view height for a given width. |
+- (int)getHeightForWidth:(int)width; |
sail
2013/09/04 21:18:51
Use CGFloat instead?
groby-ooo-7-16
2013/09/04 22:19:01
Reluctant, because '0' is a special case - and equ
sail
2013/09/04 23:08:25
I think it's still a good idea to make this a CGFl
groby-ooo-7-16
2013/09/05 00:44:20
Done, then.
On 2013/09/04 23:08:25, sail wrote:
|
+ |
+@end |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ |
+ |