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.
5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_LOADING_SHIELD_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_LOADING_SHIELD_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h"
14 class AutofillLoadingAnimationBridge
;
17 class AutofillDialogViewDelegate
;
18 class LoadingAnimation
;
21 // Controller for the "Loading..." shield view of the Autofill dialog.
22 @interface AutofillLoadingShieldController
: NSViewController
<AutofillLayout
> {
24 // The main label for the shield.
25 base::scoped_nsobject
<NSTextField
> message_
;
27 // The animate dots that follow the |message_|.
28 base::scoped_nsobject
<NSArray
> dots_
;
30 // C++ bridge class for animating the dots.
31 scoped_ptr
<AutofillLoadingAnimationBridge
> animationDriver_
;
33 autofill::AutofillDialogViewDelegate
* delegate_
; // not owned, owns dialog.
36 // Designated initializer.
37 - (id
)initWithDelegate
:(autofill::AutofillDialogViewDelegate
*)delegate
;
39 // Updates the layout of the loading shield based on the |delegate_|'s state.
42 // Updates the positions of the dots to match the current frame of the
44 - (void)relayoutDotsForSteppedAnimation
:
45 (const autofill::LoadingAnimation
&)animation
;
49 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_LOADING_SHIELD_CONTROLLER_H_