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

Unified Diff: ios/chrome/browser/ui/alert_coordinator/alert_controller_coordinator.h

Issue 2119373002: Creates coordinators for displaying alerts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: ios/chrome/browser/ui/alert_coordinator/alert_controller_coordinator.h
diff --git a/ios/chrome/browser/ui/alert_coordinator/alert_controller_coordinator.h b/ios/chrome/browser/ui/alert_coordinator/alert_controller_coordinator.h
new file mode 100644
index 0000000000000000000000000000000000000000..b35171607c69de660b6073d5b5d8323f3995ced4
--- /dev/null
+++ b/ios/chrome/browser/ui/alert_coordinator/alert_controller_coordinator.h
@@ -0,0 +1,38 @@
+// 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_CHROME_BROWSER_UI_ALERT_COORDINATOR_ALERT_CONTROLLER_COORDINATOR_H_
+#define IOS_CHROME_BROWSER_UI_ALERT_COORDINATOR_ALERT_CONTROLLER_COORDINATOR_H_
+
+#import <Foundation/Foundation.h>
+
+#include "base/ios/block_types.h"
+#import "ios/chrome/browser/chrome_coordinator.h"
+
+// A coordinator specialization for the case where the coordinator is
+// creating and managing an alert (popup or action sheet) to be displayed to the
+// user. This is an abstract class and should not be initialized directly. Use
+// one of its subclasses.
+@interface AlertControllerCoordinator : ChromeCoordinator
lpromero 2016/07/06 09:03:59 How do we make sure we don't end up with a huge tr
gambard 2016/07/07 08:57:43 I used delegates for Model Alert and Action Sheet.
+
+// Whether the context menu is visible. This will be true after |-start| is
+// called until a subsequent |-stop|.
+@property(nonatomic, readonly, getter=isVisible) BOOL visible;
+// Message of the alert.
+@property(nonatomic, copy) NSString* message;
+
+// Adds an item at the end of the menu if |visible| is false.
lpromero 2016/07/06 09:03:59 Instead of silently fail, should it DCHECK?
gambard 2016/07/07 08:57:43 It does not fail, it does nothing. I think it is b
+- (void)addItemWithTitle:(NSString*)title
+ action:(ProceduralBlock)actionBlock
+ destructive:(BOOL)isDestructive;
lpromero 2016/07/06 09:03:59 Pass a UIAlertActionStyle instead.
gambard 2016/07/07 08:57:43 Ok but it crashes if two UIAlertActionStyleCancel
+
+// Creates a cancel button. This button will be displayed at the end.
lpromero 2016/07/06 09:03:59 I'd remove the word "Creates". What about: // Adds
gambard 2016/07/07 08:57:43 Done.
+- (void)addCancelButton;
+
+// Returns the number of action attached to the current alert.
lpromero 2016/07/06 09:03:59 s/action/actions
gambard 2016/07/07 08:57:43 Done.
+- (NSUInteger)actionCount;
lpromero 2016/07/06 09:03:59 s/actionCount/actionsCount
gambard 2016/07/07 08:57:43 Done.
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_ALERT_COORDINATOR_ALERT_CONTROLLER_COORDINATOR_H_

Powered by Google App Engine
This is Rietveld 408576698