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

Unified Diff: ios/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.mm

Issue 2785893003: [ios clean] Add placeholder for NTP bookmarks, chrome home and open tabs. (Closed)
Patch Set: Comments Created 3 years, 8 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/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.mm b/ios/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.mm
new file mode 100644
index 0000000000000000000000000000000000000000..8a2c5b30f5d8af0c7e3bfd869db0ac7411eaeb78
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.mm
@@ -0,0 +1,90 @@
+// Copyright 2017 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.
+
+#import "ios/clean/chrome/browser/ui/ntp/new_tab_page_home_coordinator.h"
+
+#import "ios/chrome/browser/ui/ntp/google_landing_controller.h"
+#import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h"
+#import "ios/chrome/browser/ui/url_loader.h"
+#import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h"
+#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
+#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h"
+#import "ios/web/public/navigation_manager.h"
+#include "ios/web/public/web_state/web_state.h"
+#include "ui/base/page_transition_types.h"
+#include "url/gurl.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface NTPHomeCoordinator ()<UrlLoader, OmniboxFocuser>
+//@property(nonatomic, strong) NTPHomeMediator* mediator;
+@property(nonatomic, strong) UIViewController* viewController;
+@property(nonatomic, strong) GoogleLandingController* wrapperViewController;
+@end
+
+@implementation NTPHomeCoordinator
+@synthesize viewController = _viewController;
+@synthesize webState = _webState;
+@synthesize wrapperViewController = _wrapperViewController;
+
+- (void)start {
+ // PLACEHOLDER: Re-using old view controllers for now.
+ DCHECK(self.webState);
+ self.wrapperViewController = [[GoogleLandingController alloc]
+ initWithLoader:self
+ browserState:self.browser->browser_state()
+ focuser:self
+ webToolbarDelegate:nil
+ tabModel:nil];
+ self.viewController = [[UIViewController alloc] init];
+ self.viewController.view = [self.wrapperViewController view];
+ [super start];
+}
+
marq (ping after 24h) 2017/04/05 12:22:48 #pragma mark - for each adopted protocol.
justincohen 2017/04/05 19:28:24 Done.
+- (void)loadURL:(const GURL&)url
marq (ping after 24h) 2017/04/05 12:22:48 Move this to a mediator?
justincohen 2017/04/05 19:28:24 Done.
+ referrer:(const web::Referrer&)referrer
+ transition:(ui::PageTransition)transition
+ rendererInitiated:(BOOL)rendererInitiated {
+ web::NavigationManager::WebLoadParams params(url);
+ params.transition_type = transition;
+ self.webState->GetNavigationManager()->LoadURLWithParams(params);
+}
+
+- (void)webPageOrderedOpen:(const GURL&)url
+ referrer:(const web::Referrer&)referrer
+ inBackground:(BOOL)inBackground
+ appendTo:(OpenPosition)appendTo {
+}
+
+- (void)webPageOrderedOpen:(const GURL&)url
+ referrer:(const web::Referrer&)referrer
+ inIncognito:(BOOL)inIncognito
+ inBackground:(BOOL)inBackground
+ appendTo:(OpenPosition)appendTo {
+}
+
+- (void)loadSessionTab:(const sessions::SessionTab*)sessionTab {
+}
+
+- (void)loadJavaScriptFromLocationBar:(NSString*)script {
+}
+
+- (void)focusOmnibox {
+}
+
+- (void)cancelOmniboxEdit {
+}
+
+- (void)focusFakebox {
+}
+
+- (void)onFakeboxBlur {
+}
+
+- (void)onFakeboxAnimationComplete {
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698