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

Unified Diff: ios/chrome/browser/ui/web_contents/web_coordinator.mm

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 4 years 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/web_contents/web_coordinator.mm
diff --git a/ios/chrome/browser/ui/web_contents/web_coordinator.mm b/ios/chrome/browser/ui/web_contents/web_coordinator.mm
new file mode 100644
index 0000000000000000000000000000000000000000..f0272612f1961657739da20e24faa84d1d911e51
--- /dev/null
+++ b/ios/chrome/browser/ui/web_contents/web_coordinator.mm
@@ -0,0 +1,45 @@
+// 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.
+
+// ====== New Architecture =====
+// = This code is only used in the new iOS Chrome architecture. =
+// ============================================================================
+
+#import "ios/chrome/browser/ui/web_contents/web_coordinator.h"
+
+#import "ios/chrome/browser/browser_coordinator+internal.h"
+#import "ios/chrome/browser/ui/web_contents/web_contents_view_controller.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface WebCoordinator ()
+
+@property(nonatomic, strong) WebContentsViewController* viewController;
+@property(nonatomic, readwrite, strong) WebMediator* webMediator;
+
+@end
+
+@implementation WebCoordinator
+@synthesize webMediator = _webMediator;
+@synthesize viewController = _viewController;
+
+- (void)start {
+ self.viewController = [[WebContentsViewController alloc]
+ initWithWebState:self.webMediator.webState];
+
+ // Reminder: this is a no-op if |rootViewController| is nil, for example
+ // when this coordinator's view controller will be contained instead of
+ // presented.
+ [self.rootViewController presentViewController:self.viewController
+ animated:YES
+ completion:nil];
+}
+
+- (void)setWebState:(web::WebState*)webState {
+ self.webMediator = [[WebMediator alloc] initWithWebState:webState];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698