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

Unified Diff: ios/clean/chrome/browser/ui/overlay_service/internal/browser_coordinator+overlay_support.mm

Issue 2921833002: [iOS Clean] Created OverlayService.
Patch Set: rebase & Mark's comments Created 3 years, 6 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/overlay_service/internal/browser_coordinator+overlay_support.mm
diff --git a/ios/clean/chrome/browser/ui/overlay_service/internal/browser_coordinator+overlay_support.mm b/ios/clean/chrome/browser/ui/overlay_service/internal/browser_coordinator+overlay_support.mm
new file mode 100644
index 0000000000000000000000000000000000000000..7744f86f12b5a65edab7a6e9915a77f65ff2fe14
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/overlay_service/internal/browser_coordinator+overlay_support.mm
@@ -0,0 +1,45 @@
+// 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/overlay_service/browser_coordinator+overlay_support.h"
+
+#include "base/logging.h"
+#import "ios/clean/chrome/browser/ui/overlay_service/internal/overlay_queue.h"
+#import "ios/clean/chrome/browser/ui/overlay_service/overlay_service_factory.h"
+#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
+#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation BrowserCoordinator (OverlaySupport)
+@dynamic overlayQueue;
+
+- (OverlayService*)overlayService {
+ return OverlayServiceFactory::GetInstance()->GetForBrowserState(
+ self.browser->browser_state());
+}
+
+- (BOOL)supportsOverlaying {
+ return NO;
+}
+
+- (void)startOverlayingCoordinator:(BrowserCoordinator*)overlayParent {
+ DCHECK(overlayParent);
+ [overlayParent addChildCoordinator:self];
+ [self start];
+}
+
+- (void)overlayWasStopped {
+ DCHECK(self.parentCoordinator);
+ [self.parentCoordinator removeChildCoordinator:self];
+ self.overlayQueue->OverlayWasStopped(self);
+}
+
+- (void)cancelOverlay {
+ // Implemented by subclasses.
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698