Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: ios/public/provider/chrome/browser/voice/logo_animation_controller.h

Issue 2448823002: [ios] Adds the LogoAnimationController protocol. (Closed)
Patch Set: Drop Default. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/public/provider/chrome/browser/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/public/provider/chrome/browser/voice/logo_animation_controller.h
diff --git a/ios/public/provider/chrome/browser/voice/logo_animation_controller.h b/ios/public/provider/chrome/browser/voice/logo_animation_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..4748352478dcb52ad4b64d5d1331c9a0a6f84587
--- /dev/null
+++ b/ios/public/provider/chrome/browser/voice/logo_animation_controller.h
@@ -0,0 +1,64 @@
+// Copyright 2016 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 IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_LOGO_ANIMATION_CONTROLLER_H_
+#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_LOGO_ANIMATION_CONTROLLER_H_
+
+#include <Foundation/Foundation.h>
+
+@protocol LogoAnimationControllerOwner;
+@protocol LogoAnimationControllerOwnerOwner;
+
+typedef NS_ENUM(NSUInteger, LogoAnimationControllerLogoState) {
+ // A state in which the logo is displayed.
+ LogoAnimationControllerLogoStateLogo,
+ // A state in which the microphone icon is displayed.
+ LogoAnimationControllerLogoStateMic,
+};
+
+#pragma mark LogoAnimationController
+
+// Protocol for objects that act as logo animation controllers.
+@protocol LogoAnimationController<NSObject>
+@end
+
+#pragma mark LogoAnimationControllerOwner
+
+// Protocol used to transfer ownership of LogoAnimationControllers between
+// objects.
+@protocol LogoAnimationControllerOwner
+
+// The controller to be used during the animation. Setting this property to a
+// new controller transfers ownership to the receiver, and resetting it to nil
+// relinquishes the receiver's ownership of the object. When this property is
+// set, the owner must add the new controller's view to its view hierarchy and
+// remove the old controller's view.
+@property(nonatomic, strong) id<LogoAnimationController>
+ logoAnimationController;
+
+// The default state used when the LogoAnimationController owned by the
+// receiver is not showing dots or animating.
+@property(nonatomic, readonly)
+ LogoAnimationControllerLogoState defaultLogoState;
+@end
+
+#pragma mark LogoAnimationControllerOwnerOwner
+
+// Protocol for objects that potentially own LogoAnimationControllerOwners and
+// sometimes (but not always) use them to display UI. This extra layer of
+// indirection is necessary to decide whether to reparent animation views during
+// transition animations, as simply checking whether a
+// LogoAnimationControllerOwner's logoAnimationController is nil is
+// insufficient. This is because a LogoAnimationController may have been
+// reparented, but its LogoAnimationControllerOwner should still be used as the
+// endpoint in the animation if it is in a state where it can be displayed.
+@protocol LogoAnimationControllerOwnerOwner
+
+// The LogoAnimationControllerOwner held by the conforming object.
+@property(nonatomic, readonly) id<LogoAnimationControllerOwner>
+ logoAnimationControllerOwner;
+
+@end
+
+#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_LOGO_ANIMATION_CONTROLLER_H_
« no previous file with comments | « ios/public/provider/chrome/browser/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698