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

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

Issue 2921833002: [iOS Clean] Created OverlayService.
Patch Set: Use service pattern 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/web_contents/web_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
index 6198cab7d5b55770b97724151373fdd9f7165066..5a08296ee9456bb5e8ed26d2c513dd3760528e23 100644
--- a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
@@ -9,6 +9,8 @@
#import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h"
#import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h"
#import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h"
+#import "ios/clean/chrome/browser/ui/overlays/overlay_service.h"
+#import "ios/clean/chrome/browser/ui/overlays/overlay_service_factory.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h"
#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
@@ -27,6 +29,7 @@ @interface WebCoordinator ()<ContextMenuCommands, CRWWebStateDelegate> {
}
@property(nonatomic, strong) WebContentsViewController* viewController;
@property(nonatomic, strong) WebContentsMediator* mediator;
+
@end
@implementation WebCoordinator
@@ -50,13 +53,23 @@ - (void)setWebState:(web::WebState*)webState {
}
- (void)start {
+ // Create the view controller and start it.
self.viewController = [[WebContentsViewController alloc] init];
self.mediator.consumer = self.viewController;
self.mediator.webStateList = &self.browser->web_state_list();
[super start];
+ // Notify the OverlayService that this coordinator is displaying |webState|.
+ OverlayServiceFactory::GetInstance()
+ ->GetForBrowserState(self.browser->browser_state())
+ ->SetWebStateParentCoordinator(self, self.webState);
}
- (void)stop {
+ // Notify the OverlayService that this coordinator is no long displaying
marq (ping after 24h) 2017/06/21 09:41:54 no longer
kkhorimoto 2017/06/23 06:11:16 Done.
+ // |webState|.
+ OverlayServiceFactory::GetInstance()
+ ->GetForBrowserState(self.browser->browser_state())
+ ->SetWebStateParentCoordinator(nil, self.webState);
[super stop];
[self.mediator disconnect];
}

Powered by Google App Engine
This is Rietveld 408576698