Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 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_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ | |
| 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ | |
| 7 | |
| 8 #import <Cocoa/Cocoa.h> | |
| 9 | |
| 10 #include "base/mac/scoped_nsobject.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" | |
| 13 | |
| 14 namespace autofill { | |
| 15 struct DialogOverlayState; | |
|
sail
2013/09/04 20:04:06
Don't need to indent or add a "// namespace ..." c
groby-ooo-7-16
2013/09/04 20:41:45
Done.
| |
| 16 } // namespace autofill | |
| 17 | |
| 18 namespace ui { | |
| 19 class Animation; | |
| 20 class MultiAnimation; | |
| 21 } // namespace ui | |
| 22 | |
| 23 class AnimationDelegateBridge; | |
| 24 @class AutofillMessageStackView; | |
| 25 | |
| 26 // Protocol that allows Cocoa objects to act as a delegate for a ui::Animation. | |
| 27 @protocol ChromiumAnimationDelegate | |
|
sail
2013/09/04 20:04:06
How about just AnimationDelegate or AnimationDeleg
groby-ooo-7-16
2013/09/04 20:41:45
I'm fine with that - I just hope it doesn't clash
| |
| 28 - (void)animationProgressed:(const ui::Animation*)animation; | |
| 29 - (void)animationEnded:(const ui::Animation*)animation; | |
| 30 @end | |
| 31 | |
| 32 | |
| 33 @interface AutofillOverlayController : | |
| 34 NSViewController<ChromiumAnimationDelegate, AutofillLayout> { | |
| 35 @private | |
| 36 base::scoped_nsobject<NSBox> view_; // The main view. | |
|
sail
2013/09/04 20:04:06
Instead of keeping a separate reference to this, h
groby-ooo-7-16
2013/09/04 20:41:45
Done.
| |
| 37 base::scoped_nsobject<NSView> childView_; // Contains all UI elements. | |
| 38 base::scoped_nsobject<NSImageView> imageView_; | |
| 39 base::scoped_nsobject<AutofillMessageStackView> messageStackView_; | |
| 40 | |
| 41 scoped_ptr<ui::MultiAnimation> fadeOutAnimation_; // Animation rules. | |
| 42 scoped_ptr<AnimationDelegateBridge> animationDelegate_; | |
| 43 } | |
| 44 | |
| 45 | |
| 46 // Set the current dialog state. | |
| 47 - (void)setState:(const autofill::DialogOverlayState&)state; | |
| 48 | |
| 49 // Start the animation sequence. At its end, the dialog will hide itself. | |
| 50 - (void)beginFadeOut; | |
| 51 | |
| 52 // Get the preferred view height for a given width. | |
| 53 - (int)getHeightForWidth:(int)width; | |
|
sail
2013/09/04 20:04:06
how about heightForWidth:?
groby-ooo-7-16
2013/09/04 20:41:45
Done.
| |
| 54 | |
| 55 @end | |
| 56 | |
| 57 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_OVERLAY_CONTROLLER_H_ | |
| 58 | |
| OLD | NEW |