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

Unified Diff: ios/showcase/core/app_delegate.mm

Issue 2651833002: [ios showcase]Configures Resource Bundle and adds Toolbar Coordinator (Closed)
Patch Set: Created 3 years, 11 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/showcase/core/app_delegate.mm
diff --git a/ios/showcase/core/app_delegate.mm b/ios/showcase/core/app_delegate.mm
index fda5403304f46f7c728ab057675a3296453a1808..8136bfb75cbc186ddd6f81d899a287cbcc131e51 100644
--- a/ios/showcase/core/app_delegate.mm
+++ b/ios/showcase/core/app_delegate.mm
@@ -4,6 +4,10 @@
#import "ios/showcase/core/app_delegate.h"
+#import "ios/clean/chrome/app/application_state.h"
+#import "ios/clean/chrome/app/steps/launch_to_background.h"
+#import "ios/clean/chrome/app/steps/launch_to_basic.h"
+#import "ios/clean/chrome/app/steps/launch_to_foreground.h"
#import "ios/showcase/core/showcase_model.h"
#import "ios/showcase/core/showcase_view_controller.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
@@ -14,8 +18,13 @@
#error "This file requires ARC support."
#endif
+@interface AppDelegate ()
+@property(nonatomic, strong) ApplicationState* applicationState;
+@end
+
@implementation AppDelegate
@synthesize window = _window;
+@synthesize applicationState = _applicationState;
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
@@ -27,6 +36,13 @@
initWithRootViewController:viewController];
self.window.rootViewController = navigationController;
[self.window makeKeyAndVisible];
+
+ self.applicationState = [[ApplicationState alloc] init];
marq (ping after 24h) 2017/01/24 09:49:07 Sorry for any confusion caused by my comment in ch
+ self.applicationState.application = application;
+ [self configureApplicationState];
+
+ [self.applicationState launchWithOptions:launchOptions];
+
return YES;
}
@@ -41,4 +57,23 @@
return [rows sortedArrayUsingDescriptors:@[ sortDescriptor ]];
}
+// Configures the application state for application launch by setting the launch
+// steps.
+// Future architecture/refactoring note: configuring the application state in
+// this way is outside the scope of responsibility of the object as defined in
+// the header file. The correct solution is probably a helper object that can
+// perform all of the configuration necessary, and that can be adjusted as
+// needed.
+- (void)configureApplicationState {
+ [self.applicationState.launchSteps addObjectsFromArray:@[
+ [[ProviderInitializer alloc] init],
+ [[SetupBundleAndUserDefaults alloc] init],
+ [[StartChromeMain alloc] init],
+ [[SetBrowserState alloc] init],
+ [[BeginForegrounding alloc] init],
+ [[PrepareForUI alloc] init],
+ [[CompleteForegrounding alloc] init],
+ ]];
+}
+
@end
« no previous file with comments | « ios/showcase/core/BUILD.gn ('k') | ios/showcase/core/main.mm » ('j') | ios/showcase/core/main.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698