Index: ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder.mm |
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder.mm b/ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d626bb313f0f4f0148286b6723050a585df8976b |
--- /dev/null |
+++ b/ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder.mm |
@@ -0,0 +1,39 @@ |
+// 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. |
+ |
+#import "ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder.h" |
+ |
+#include "components/prefs/pref_service.h" |
+#include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
+#include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" |
+#include "ios/chrome/browser/pref_names.h" |
+#include "ios/chrome/browser/reading_list/reading_list_download_service.h" |
+#include "ios/chrome/browser/reading_list/reading_list_download_service_factory.h" |
+#include "ios/chrome/browser/reading_list/reading_list_model_factory.h" |
+ |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
+@implementation ReadingListViewControllerBuilder |
+ |
++ (ReadingListViewController*) |
+readingListViewControllerInBrowserState:(ios::ChromeBrowserState*)browserState |
+ tabModel:(TabModel*)tabModel { |
+ ReadingListModel* model = |
+ ReadingListModelFactory::GetInstance()->GetForBrowserState(browserState); |
+ favicon::LargeIconService* service = |
+ IOSChromeLargeIconServiceFactory::GetForBrowserState(browserState); |
+ ReadingListDownloadService* rlservice = |
+ ReadingListDownloadServiceFactory::GetInstance()->GetForBrowserState( |
+ browserState); |
+ ReadingListViewController* vc = |
+ [[ReadingListViewController alloc] initWithModel:model |
+ tabModel:tabModel |
+ largeIconService:service |
+ readingListDownloadService:rlservice]; |
+ return vc; |
+} |
+ |
+@end |