| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h
" | 5 #import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h
" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h" | 8 #import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h" |
| 9 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h" | 9 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h" |
| 10 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_mediator.h" | 10 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_mediator.h" |
| 11 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.h
" | 11 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.h
" |
| 12 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 12 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
| 13 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" | 13 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" |
| 14 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" |
| 14 | 15 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 @interface WebContextMenuCoordinator ()<ContextMenuCommands> | 20 @interface WebContextMenuCoordinator ()<ContextMenuCommands> |
| 20 // The menu context. | 21 // The menu context. |
| 21 @property(nonatomic, strong, readonly) ContextMenuContextImpl* context; | 22 @property(nonatomic, strong, readonly) ContextMenuContextImpl* context; |
| 22 // The view controller that displayes the context menu UI. | 23 // The view controller that displayes the context menu UI. |
| 23 @property(nonatomic, strong) ContextMenuViewController* viewController; | 24 @property(nonatomic, strong) ContextMenuViewController* viewController; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 withContext:self.context]; | 48 withContext:self.context]; |
| 48 [self.browser->dispatcher() | 49 [self.browser->dispatcher() |
| 49 startDispatchingToTarget:self | 50 startDispatchingToTarget:self |
| 50 forSelector:@selector(hideContextMenu:)]; | 51 forSelector:@selector(hideContextMenu:)]; |
| 51 [super start]; | 52 [super start]; |
| 52 } | 53 } |
| 53 | 54 |
| 54 - (void)stop { | 55 - (void)stop { |
| 55 [self.browser->dispatcher() stopDispatchingToTarget:self]; | 56 [self.browser->dispatcher() stopDispatchingToTarget:self]; |
| 56 [super stop]; | 57 [super stop]; |
| 58 [self.parentCoordinator removeChildCoordinator:self]; |
| 57 } | 59 } |
| 58 | 60 |
| 59 #pragma mark - ContextMenuCommands | 61 #pragma mark - ContextMenuCommands |
| 60 | 62 |
| 61 - (void)hideContextMenu:(ContextMenuContext*)context { | 63 - (void)hideContextMenu:(ContextMenuContext*)context { |
| 62 DCHECK_EQ(self.context, context); | 64 DCHECK_EQ(self.context, context); |
| 63 [self stop]; | 65 [self stop]; |
| 64 } | 66 } |
| 65 | 67 |
| 66 @end | 68 @end |
| OLD | NEW |