Commit 190a8e91 authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Commit Bot

[SendTabToSelf] remove unused showActivityServiceContextMenu method

The previous client of this method was the Send Tab To Self Action Sheet,
which has been replaced by a modal dialog.

Bug: 970284
Change-Id: I85ca056ef970e515e94a30421d027ca7cae676e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696173Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Auto-Submit: Jeffrey Cohen <jeffreycohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677089}
parent 717f0703
...@@ -41,7 +41,6 @@ source_set("activity_services") { ...@@ -41,7 +41,6 @@ source_set("activity_services") {
"//ios/chrome/browser/ui/activity_services/activities", "//ios/chrome/browser/ui/activity_services/activities",
"//ios/chrome/browser/ui/activity_services/requirements", "//ios/chrome/browser/ui/activity_services/requirements",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/context_menu",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/web", "//ios/web",
"//net", "//net",
...@@ -110,7 +109,6 @@ source_set("unit_tests") { ...@@ -110,7 +109,6 @@ source_set("unit_tests") {
"//ios/chrome/browser/ui/activity_services/activities", "//ios/chrome/browser/ui/activity_services/activities",
"//ios/chrome/browser/ui/activity_services/requirements", "//ios/chrome/browser/ui/activity_services/requirements",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/context_menu",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/testing:ocmock_support", "//ios/testing:ocmock_support",
"//ios/web", "//ios/web",
......
...@@ -157,12 +157,6 @@ ...@@ -157,12 +157,6 @@
_latestErrorAlertMessage = [message copy]; _latestErrorAlertMessage = [message copy];
} }
- (void)showActivityServiceContextMenu:(NSString*)title
items:(NSArray<ContextMenuItem*>*)items {
_latestContextMenuTitle = [title copy];
EXPECT_GE([items count], 1U);
}
#pragma mark - ActivityServicePositioner #pragma mark - ActivityServicePositioner
- (UIView*)shareButtonView { - (UIView*)shareButtonView {
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_ #ifndef IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_
#define IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_ #define IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_
@class ContextMenuItem;
// ActivityServicePresentation contains methods that control how the activity // ActivityServicePresentation contains methods that control how the activity
// services menu is presented and dismissed on screen. // services menu is presented and dismissed on screen.
@protocol ActivityServicePresentation @protocol ActivityServicePresentation
...@@ -25,11 +23,6 @@ ...@@ -25,11 +23,6 @@
- (void)showActivityServiceErrorAlertWithStringTitle:(NSString*)title - (void)showActivityServiceErrorAlertWithStringTitle:(NSString*)title
message:(NSString*)message; message:(NSString*)message;
// Asks the implementor to show a context menu with the given |title| and
// with the items in |items|. There must be at least one item in |items|.
- (void)showActivityServiceContextMenu:(NSString*)title
items:(NSArray<ContextMenuItem*>*)items;
@end @end
#endif // IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_ #endif // IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_REQUIREMENTS_ACTIVITY_SERVICE_PRESENTATION_H_
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#include "ios/chrome/browser/system_flags.h" #include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/translate/chrome_ios_translate_client.h" #import "ios/chrome/browser/translate/chrome_ios_translate_client.h"
#import "ios/chrome/browser/ui/activity_services/activity_service_legacy_coordinator.h" #import "ios/chrome/browser/ui/activity_services/activity_service_legacy_coordinator.h"
#import "ios/chrome/browser/ui/activity_services/requirements/activity_service_positioner.h"
#import "ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h" #import "ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h"
#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
#import "ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.h" #import "ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.h"
...@@ -86,7 +85,6 @@ ...@@ -86,7 +85,6 @@
#import "ios/chrome/browser/ui/commands/show_signin_command.h" #import "ios/chrome/browser/ui/commands/show_signin_command.h"
#import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h" #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h"
#import "ios/chrome/browser/ui/context_menu/context_menu_coordinator.h" #import "ios/chrome/browser/ui/context_menu/context_menu_coordinator.h"
#import "ios/chrome/browser/ui/context_menu/context_menu_item.h"
#import "ios/chrome/browser/ui/dialogs/dialog_features.h" #import "ios/chrome/browser/ui/dialogs/dialog_features.h"
#import "ios/chrome/browser/ui/dialogs/dialog_presenter.h" #import "ios/chrome/browser/ui/dialogs/dialog_presenter.h"
#import "ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h" #import "ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h"
...@@ -4864,33 +4862,6 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -4864,33 +4862,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
[self showErrorAlertWithStringTitle:title message:message]; [self showErrorAlertWithStringTitle:title message:message];
} }
- (void)showActivityServiceContextMenu:(NSString*)title
items:(NSArray<ContextMenuItem*>*)items {
// In case a context menu is being shown, stop it first.
[_contextMenuCoordinator stop];
// Must have at least one item to choose from context menu.
DCHECK_GE([items count], 1U);
// Create a new context menu positioned at the location of the Share button.
UIView* inView = [self.primaryToolbarCoordinator
.activityServicePositioner shareButtonView];
// This assumes that inView.bounds.origin.x is zero because bounds rect
// origin should be at (0,0).
DCHECK(CGPointEqualToPoint(CGPointZero, inView.bounds.origin));
CGPoint location =
CGPointMake(CGRectGetMidX(inView.bounds), CGRectGetMaxY(inView.bounds));
_contextMenuCoordinator =
[[ContextMenuCoordinator alloc] initWithBaseViewController:self
title:title
inView:inView
atLocation:location];
for (ContextMenuItem* item in items) {
[_contextMenuCoordinator addItemWithTitle:item.title action:item.action];
}
[_contextMenuCoordinator start];
}
#pragma mark - CaptivePortalDetectorTabHelperDelegate #pragma mark - CaptivePortalDetectorTabHelperDelegate
- (void)captivePortalDetectorTabHelper: - (void)captivePortalDetectorTabHelper:
......
...@@ -7,8 +7,6 @@ source_set("context_menu") { ...@@ -7,8 +7,6 @@ source_set("context_menu") {
sources = [ sources = [
"context_menu_coordinator.h", "context_menu_coordinator.h",
"context_menu_coordinator.mm", "context_menu_coordinator.mm",
"context_menu_item.h",
"context_menu_item.mm",
] ]
deps = [ deps = [
"//base", "//base",
......
// Copyright 2019 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.
#ifndef IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
#define IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
#import <Foundation/Foundation.h>
#include "base/ios/block_types.h"
// Stores the title for each Context Menu selection and an associated
// block that will be executed if the user selects the context menu item.
@interface ContextMenuItem : NSObject
// Context Menu item title
@property(nonatomic, copy, readonly) NSString* title;
// Action block associated with the Context Menu item
@property(nonatomic, copy) ProceduralBlock action;
// Designated initializer for a new Context Menu Item object. |action| block
// may be nil.
- (instancetype)initWithTitle:(NSString*)title
action:(ProceduralBlock)action NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
#endif // IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
// Copyright 2019 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/context_menu/context_menu_item.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation ContextMenuItem
- (instancetype)initWithTitle:(NSString*)title action:(ProceduralBlock)action {
self = [super init];
if (self) {
_title = [title copy];
_action = [action copy];
}
return self;
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment