Commit 61eeb03d authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[remoting][iOS] Switch to use the new UI library for account management

This CL makes the iOS app use the newer Google account management
library instead of the deprecated one, i.e. we no longer use the side
menu and will use the circular profile button on the top-right corner
of the screen.

Code changes in this CL include:

* Introduce an AccountManager as an abstraction layer to
  Google-internal account management UI components, also with an
  AccountManagerChromium implementation for the public build.
* Deprecate AppViewController and remove AppViewControllerChromium as
  the new UI component doesn't act as the root view controller of the
  app.
* Remove ToS and Privacy Policy from the side menu items, as the new UI
  already comes with these links in the footer.

Internal change: https://chrome-internal-review.googlesource.com/c/chrome/ios_internal/+/3202666
Demo: https://screencast.googleplex.com/cast/NDYyMzk5MDAzNzQxMzg4OHxkODBmNGI4OC01YQ

Bug: 810097
Change-Id: I660e2aeef7337050e827f3a32b524deac7b0e462
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343637
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796500}
parent 128ef328
...@@ -14,6 +14,8 @@ group("all") { ...@@ -14,6 +14,8 @@ group("all") {
# source set to be used by both external and internal app. # source set to be used by both external and internal app.
source_set("common_source_set") { source_set("common_source_set") {
sources = [ sources = [
"account_manager.h",
"account_manager.mm",
"app_delegate.h", "app_delegate.h",
"app_delegate.mm", "app_delegate.mm",
"app_initializer.h", "app_initializer.h",
...@@ -120,8 +122,9 @@ source_set("common_source_set") { ...@@ -120,8 +122,9 @@ source_set("common_source_set") {
source_set("app_source_set") { source_set("app_source_set") {
sources = [ sources = [
"account_manager_chromium.h",
"account_manager_chromium.mm",
"app_initializer_chromium.mm", "app_initializer_chromium.mm",
"app_view_controller_chromium.mm",
"refresh_control_provider_chromium.h", "refresh_control_provider_chromium.h",
"refresh_control_provider_chromium.mm", "refresh_control_provider_chromium.mm",
"remoting_menu_view_controller.h", "remoting_menu_view_controller.h",
......
// Copyright 2020 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 REMOTING_IOS_APP_ACCOUNT_MANAGER_H_
#define REMOTING_IOS_APP_ACCOUNT_MANAGER_H_
#include <memory>
#import <UIKit/UIKit.h>
namespace remoting {
namespace ios {
// An interface that provides UI components to manage the user's account. The
// implementation may come from some internal libraries.
//
// This interface does not deal with callbacks of user sign-in, sign-out, or
// account switching. For these events you can listen to the kUserDidUpdate
// event defined in remoting_service.h.
class AccountManager {
public:
AccountManager();
virtual ~AccountManager();
// Sets the AccountManager singleton. Can only be called once.
static void SetInstance(std::unique_ptr<AccountManager> account_manager);
// Gets the AccountManager instance.
static AccountManager* GetInstance();
// Creates a view controller that renders an account particle disc, a little
// circular button that shows the user's avatar image and pops up the account
// management menu.
virtual UIViewController* CreateAccountParticleDiscViewController() = 0;
// Presents a menu that allows the user to choose an account to sign in or add
// a new account. This is usually used when the app is first launched or the
// user has previously signed out.
virtual void PresentSignInMenu() = 0;
};
} // namespace ios
} // namespace remoting
#endif // REMOTING_IOS_APP_ACCOUNT_MANAGER_H_
\ No newline at end of file
// Copyright 2020 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 "remoting/ios/app/account_manager.h"
#include "base/check.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace remoting {
namespace ios {
namespace {
// Leaky.
static AccountManager* g_account_manager = nullptr;
} // namespace
AccountManager::AccountManager() = default;
AccountManager::~AccountManager() = default;
// static
void AccountManager::SetInstance(
std::unique_ptr<AccountManager> account_manager) {
DCHECK(!g_account_manager);
g_account_manager = account_manager.release();
}
// static
AccountManager* AccountManager::GetInstance() {
DCHECK(g_account_manager);
return g_account_manager;
}
} // namespace ios
} // namespace remoting
// Copyright 2020 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 REMOTING_IOS_APP_ACCOUNT_MANAGER_CHROMIUM_H_
#define REMOTING_IOS_APP_ACCOUNT_MANAGER_CHROMIUM_H_
#include "remoting/ios/app/account_manager.h"
namespace remoting {
namespace ios {
class AccountManagerChromium final : public AccountManager {
public:
AccountManagerChromium();
~AccountManagerChromium() override;
AccountManagerChromium(const AccountManagerChromium&) = delete;
AccountManagerChromium& operator=(const AccountManagerChromium&) = delete;
// AccountManager overrides.
UIViewController* CreateAccountParticleDiscViewController() override;
void PresentSignInMenu() override;
};
} // namespace ios
} // namespace remoting
#endif // REMOTING_IOS_APP_ACCOUNT_MANAGER_CHROMIUM_H_
// Copyright 2020 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.
#include "remoting/ios/app/account_manager_chromium.h"
#import "remoting/ios/app/remoting_menu_view_controller.h"
#import "remoting/ios/app/remoting_theme.h"
#import "remoting/ios/app/view_utils.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
void ShowMenu() {
RemotingMenuViewController* menu_view_controller =
[[RemotingMenuViewController alloc] init];
[remoting::TopPresentingVC() presentViewController:menu_view_controller
animated:YES
completion:nil];
}
} // namespace
@interface SimpleAccountParticleDiscViewController : UIViewController
@end
@implementation SimpleAccountParticleDiscViewController
- (void)loadView {
UIButton* button = [UIButton buttonWithType:UIButtonTypeSystem];
[button setImage:RemotingTheme.settingsIcon forState:UIControlStateNormal];
[button addTarget:self
action:@selector(showMenu)
forControlEvents:UIControlEventTouchUpInside];
self.view = button;
}
- (void)showMenu {
ShowMenu();
}
@end
namespace remoting {
namespace ios {
AccountManagerChromium::AccountManagerChromium() = default;
AccountManagerChromium::~AccountManagerChromium() = default;
UIViewController*
AccountManagerChromium::CreateAccountParticleDiscViewController() {
return [[SimpleAccountParticleDiscViewController alloc] initWithNibName:nil
bundle:nil];
}
void AccountManagerChromium::PresentSignInMenu() {
ShowMenu();
}
} // namespace ios
} // namespace remoting
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
// Default created delegate class for the entire application. // Default created delegate class for the entire application.
@interface AppDelegate : UIResponder<UIApplicationDelegate> @interface AppDelegate : UIResponder<UIApplicationDelegate>
- (void)showMenuAnimated:(BOOL)animated;
- (void)hideMenuAnimated:(BOOL)animated;
@property(strong, nonatomic) UIWindow* window; @property(strong, nonatomic) UIWindow* window;
@property(class, strong, nonatomic, readonly) AppDelegate* instance; @property(class, strong, nonatomic, readonly) AppDelegate* instance;
...@@ -22,8 +19,6 @@ ...@@ -22,8 +19,6 @@
// Presents contents modally onto the topmost view controller. // Presents contents modally onto the topmost view controller.
- (void)presentHelpCenter; - (void)presentHelpCenter;
- (void)presentTermsOfService;
- (void)presentPrivacyPolicy;
// TODO(yuweih): Replace calls to this method with methods from HelpAndFeedback. // TODO(yuweih): Replace calls to this method with methods from HelpAndFeedback.
// This will present the Send Feedback view controller onto the topmost view // This will present the Send Feedback view controller onto the topmost view
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#include "remoting/base/string_resources.h" #include "remoting/base/string_resources.h"
#import "remoting/ios/app/account_manager.h"
#import "remoting/ios/app/app_initializer.h" #import "remoting/ios/app/app_initializer.h"
#import "remoting/ios/app/app_view_controller.h" #import "remoting/ios/app/app_view_controller.h"
#import "remoting/ios/app/first_launch_view_presenter.h" #import "remoting/ios/app/first_launch_view_presenter.h"
...@@ -36,7 +37,6 @@ static NSString* const kPrivacyPolicyUrl = ...@@ -36,7 +37,6 @@ static NSString* const kPrivacyPolicyUrl =
@"https://policies.google.com/privacy"; @"https://policies.google.com/privacy";
@interface AppDelegate ()<FirstLaunchViewControllerDelegate> { @interface AppDelegate ()<FirstLaunchViewControllerDelegate> {
AppViewController* _appViewController;
FirstLaunchViewPresenter* _firstLaunchViewPresenter; FirstLaunchViewPresenter* _firstLaunchViewPresenter;
} }
@end @end
...@@ -90,17 +90,6 @@ static NSString* const kPrivacyPolicyUrl = ...@@ -90,17 +90,6 @@ static NSString* const kPrivacyPolicyUrl =
} }
#endif // ifndef NDEBUG #endif // ifndef NDEBUG
#pragma mark - Public
- (void)showMenuAnimated:(BOOL)animated {
DCHECK(_appViewController != nil);
[_appViewController showMenuAnimated:animated];
}
- (void)hideMenuAnimated:(BOOL)animated {
DCHECK(_appViewController != nil);
[_appViewController hideMenuAnimated:animated];
}
#pragma mark - Properties #pragma mark - Properties
+ (AppDelegate*)instance { + (AppDelegate*)instance {
...@@ -116,15 +105,13 @@ static NSString* const kPrivacyPolicyUrl = ...@@ -116,15 +105,13 @@ static NSString* const kPrivacyPolicyUrl =
UINavigationController* navController = UINavigationController* navController =
[[UINavigationController alloc] initWithRootViewController:vc]; [[UINavigationController alloc] initWithRootViewController:vc];
navController.navigationBarHidden = true; navController.navigationBarHidden = true;
_appViewController =
[[AppViewController alloc] initWithMainViewController:navController];
_firstLaunchViewPresenter = _firstLaunchViewPresenter =
[[FirstLaunchViewPresenter alloc] initWithNavController:navController [[FirstLaunchViewPresenter alloc] initWithNavController:navController
viewControllerDelegate:self]; viewControllerDelegate:self];
if (![RemotingService.instance.authentication.user isAuthenticated]) { if (![RemotingService.instance.authentication.user isAuthenticated]) {
[_firstLaunchViewPresenter presentView]; [_firstLaunchViewPresenter presentView];
} }
self.window.rootViewController = _appViewController; self.window.rootViewController = navController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
[UserStatusPresenter.instance start]; [UserStatusPresenter.instance start];
remoting::NotificationPresenter::GetInstance()->Start(); remoting::NotificationPresenter::GetInstance()->Start();
...@@ -149,20 +136,6 @@ static NSString* const kPrivacyPolicyUrl = ...@@ -149,20 +136,6 @@ static NSString* const kPrivacyPolicyUrl =
[self presentOnTopPresentingVC:[[HelpViewController alloc] init]]; [self presentOnTopPresentingVC:[[HelpViewController alloc] init]];
} }
- (void)presentTermsOfService {
[self presentOnTopPresentingVC:[[WebViewController alloc]
initWithUrl:kTosUrl
title:l10n_util::GetNSString(
IDS_TERMS_OF_SERVICE)]];
}
- (void)presentPrivacyPolicy {
[self presentOnTopPresentingVC:[[WebViewController alloc]
initWithUrl:kPrivacyPolicyUrl
title:l10n_util::GetNSString(
IDS_PRIVACY_POLICY)]];
}
- (void)presentFeedbackFlowWithContext:(NSString*)context { - (void)presentFeedbackFlowWithContext:(NSString*)context {
[HelpAndFeedback.instance presentFeedbackFlowWithContext:context]; [HelpAndFeedback.instance presentFeedbackFlowWithContext:context];
} }
...@@ -174,8 +147,7 @@ static NSString* const kPrivacyPolicyUrl = ...@@ -174,8 +147,7 @@ static NSString* const kPrivacyPolicyUrl =
#pragma mark - FirstLaunchViewPresenterDelegate #pragma mark - FirstLaunchViewPresenterDelegate
- (void)presentSignInFlow { - (void)presentSignInFlow {
DCHECK(_appViewController); remoting::ios::AccountManager::GetInstance()->PresentSignInMenu();
[_appViewController presentSignInFlow];
} }
@end @end
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#import "remoting/ios/app/app_initializer.h" #import "remoting/ios/app/app_initializer.h"
#include <memory>
#import "remoting/ios/app/account_manager_chromium.h"
#import "remoting/ios/app/help_and_feedback.h" #import "remoting/ios/app/help_and_feedback.h"
#import "remoting/ios/app/refresh_control_provider_chromium.h" #import "remoting/ios/app/refresh_control_provider_chromium.h"
#import "remoting/ios/facade/remoting_oauth_authentication.h" #import "remoting/ios/facade/remoting_oauth_authentication.h"
...@@ -22,6 +25,8 @@ ...@@ -22,6 +25,8 @@
HelpAndFeedback.instance = [[HelpAndFeedback alloc] init]; HelpAndFeedback.instance = [[HelpAndFeedback alloc] init];
RefreshControlProvider.instance = RefreshControlProvider.instance =
[[RefreshControlProviderChromium alloc] init]; [[RefreshControlProviderChromium alloc] init];
remoting::ios::AccountManager::SetInstance(
std::make_unique<remoting::ios::AccountManagerChromium>());
} }
+ (void)onAppDidFinishLaunching { + (void)onAppDidFinishLaunching {
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
// DEPRECATED.
// TODO(yuweih): Remove this file once the down stream implementation is
// removed.
@protocol AppController<NSObject> @protocol AppController<NSObject>
// For adding new methods, please mark them as optional until they are // For adding new methods, please mark them as optional until they are
......
// 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.
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
#import "remoting/ios/app/app_view_controller.h"
#import "remoting/ios/app/remoting_menu_view_controller.h"
// The Chromium implementation for the AppViewController. It simply shows the
// menu modally.
@interface AppViewController () {
UIViewController* _mainViewController;
RemotingMenuViewController* _menuController; // nullable
}
@end
@implementation AppViewController
- (instancetype)initWithMainViewController:
(UIViewController*)mainViewController {
if (self = [super init]) {
_mainViewController = mainViewController;
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self addChildViewController:_mainViewController];
[self.view addSubview:_mainViewController.view];
[_mainViewController didMoveToParentViewController:self];
}
#pragma mark - AppController
- (void)showMenuAnimated:(BOOL)animated {
if (_menuController != nil && [_menuController isBeingPresented]) {
return;
}
_menuController = [[RemotingMenuViewController alloc] init];
[self presentViewController:_menuController animated:animated completion:nil];
}
- (void)hideMenuAnimated:(BOOL)animated {
if (_menuController == nil || ![_menuController isBeingPresented]) {
return;
}
[_menuController dismissViewControllerAnimated:animated completion:nil];
_menuController = nil;
}
- (void)presentSignInFlow {
[self showMenuAnimated:YES];
}
- (UIViewController*)childViewControllerForStatusBarStyle {
return _mainViewController;
}
- (UIViewController*)childViewControllerForStatusBarHidden {
return _mainViewController;
}
@end
...@@ -338,7 +338,8 @@ ...@@ -338,7 +338,8 @@
static UIImage* icon; static UIImage* icon;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
icon = [UIImage imageNamed:@"ic_help"]; icon = [[UIImage imageNamed:@"ic_help"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}); });
return icon; return icon;
} }
...@@ -347,7 +348,8 @@ ...@@ -347,7 +348,8 @@
static UIImage* icon; static UIImage* icon;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
icon = [UIImage imageNamed:@"ic_feedback"]; icon = [[UIImage imageNamed:@"ic_feedback"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}); });
return icon; return icon;
} }
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
#import <MaterialComponents/MaterialSnackbar.h> #import <MaterialComponents/MaterialSnackbar.h>
#import "base/bind.h" #import "base/bind.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "remoting/base/oauth_token_getter.h"
#include "remoting/base/string_resources.h"
#include "remoting/client/connect_to_host_info.h"
#import "remoting/ios/app/account_manager.h"
#import "remoting/ios/app/app_delegate.h" #import "remoting/ios/app/app_delegate.h"
#import "remoting/ios/app/client_connection_view_controller.h" #import "remoting/ios/app/client_connection_view_controller.h"
#import "remoting/ios/app/host_collection_view_controller.h" #import "remoting/ios/app/host_collection_view_controller.h"
...@@ -23,17 +29,11 @@ ...@@ -23,17 +29,11 @@
#import "remoting/ios/app/host_setup_view_controller.h" #import "remoting/ios/app/host_setup_view_controller.h"
#import "remoting/ios/app/host_view_controller.h" #import "remoting/ios/app/host_view_controller.h"
#import "remoting/ios/app/refresh_control_provider.h" #import "remoting/ios/app/refresh_control_provider.h"
#import "remoting/ios/app/remoting_menu_view_controller.h"
#import "remoting/ios/app/remoting_theme.h" #import "remoting/ios/app/remoting_theme.h"
#import "remoting/ios/app/view_utils.h" #import "remoting/ios/app/view_utils.h"
#import "remoting/ios/domain/client_session_details.h" #import "remoting/ios/domain/client_session_details.h"
#import "remoting/ios/facade/remoting_service.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "remoting/base/oauth_token_getter.h"
#include "remoting/base/string_resources.h"
#include "remoting/client/connect_to_host_info.h"
#include "remoting/ios/facade/host_list_service.h" #include "remoting/ios/facade/host_list_service.h"
#import "remoting/ios/facade/remoting_service.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -142,14 +142,6 @@ using remoting::HostListService; ...@@ -142,14 +142,6 @@ using remoting::HostListService;
self.navigationItem.title = self.navigationItem.title =
l10n_util::GetNSString(IDS_PRODUCT_NAME).lowercaseString; l10n_util::GetNSString(IDS_PRODUCT_NAME).lowercaseString;
UIBarButtonItem* menuButton =
[[UIBarButtonItem alloc] initWithImage:RemotingTheme.menuIcon
style:UIBarButtonItemStyleDone
target:self
action:@selector(didSelectMenu)];
remoting::SetAccessibilityInfoFromImage(menuButton);
self.navigationItem.leftBarButtonItem = menuButton;
_appBarViewController.headerView.backgroundColor = _appBarViewController.headerView.backgroundColor =
RemotingTheme.hostListBackgroundColor; RemotingTheme.hostListBackgroundColor;
_appBarViewController.navigationBar.backgroundColor = _appBarViewController.navigationBar.backgroundColor =
...@@ -196,15 +188,37 @@ using remoting::HostListService; ...@@ -196,15 +188,37 @@ using remoting::HostListService;
[self.view sendSubviewToBack:imageView]; [self.view sendSubviewToBack:imageView];
imageView.translatesAutoresizingMaskIntoConstraints = NO; imageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_appBarViewController.view];
[_appBarViewController didMoveToParentViewController:self];
UIViewController* accountParticleDiscViewController =
remoting::ios::AccountManager::GetInstance()
->CreateAccountParticleDiscViewController();
accountParticleDiscViewController.view
.translatesAutoresizingMaskIntoConstraints = NO;
[self addChildViewController:accountParticleDiscViewController];
[self.view addSubview:accountParticleDiscViewController.view];
[accountParticleDiscViewController didMoveToParentViewController:self];
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[[imageView widthAnchor] [[imageView widthAnchor]
constraintGreaterThanOrEqualToAnchor:[self.view widthAnchor]], constraintGreaterThanOrEqualToAnchor:[self.view widthAnchor]],
[[imageView heightAnchor] [[imageView heightAnchor]
constraintGreaterThanOrEqualToAnchor:[self.view heightAnchor]], constraintGreaterThanOrEqualToAnchor:[self.view heightAnchor]],
]];
[self.view addSubview:_appBarViewController.view]; [accountParticleDiscViewController.view.topAnchor
[_appBarViewController didMoveToParentViewController:self]; constraintEqualToAnchor:_appBarViewController.navigationBar.topAnchor],
[accountParticleDiscViewController.view.trailingAnchor
constraintEqualToAnchor:_appBarViewController.navigationBar
.trailingAnchor],
[accountParticleDiscViewController.view.widthAnchor
constraintEqualToConstant:accountParticleDiscViewController
.preferredContentSize.width],
[accountParticleDiscViewController.view.heightAnchor
constraintEqualToConstant:accountParticleDiscViewController
.preferredContentSize.height],
]];
__weak __typeof(self) weakSelf = self; __weak __typeof(self) weakSelf = self;
_hostListStateSubscription = _hostListStateSubscription =
...@@ -316,10 +330,6 @@ animationControllerForDismissedController:(UIViewController*)dismissed { ...@@ -316,10 +330,6 @@ animationControllerForDismissedController:(UIViewController*)dismissed {
_hostListService->RequestFetch(); _hostListService->RequestFetch();
} }
- (void)didSelectMenu {
[AppDelegate.instance showMenuAnimated:YES];
}
- (void)refreshContent { - (void)refreshContent {
if (_hostListService->state() == HostListService::State::FETCHING) { if (_hostListService->state() == HostListService::State::FETCHING) {
// We don't need to show the fetching view when either the host list or the // We don't need to show the fetching view when either the host list or the
...@@ -379,10 +389,11 @@ animationControllerForDismissedController:(UIViewController*)dismissed { ...@@ -379,10 +389,11 @@ animationControllerForDismissedController:(UIViewController*)dismissed {
// Pull-to-refresh is not available. We need to show a dedicated view to allow // Pull-to-refresh is not available. We need to show a dedicated view to allow
// user to retry. // user to retry.
// Dismiss snackbars and hide the SSO menu so that the accessibility focus // Dismiss snackbars and so that the accessibility focus can shift into the
// can shift into the label. // label.
// TODO(yuweih): See if we really need to hide the account menu in this case,
// since it requires nontrivial changes.
[MDCSnackbarManager dismissAndCallCompletionBlocksWithCategory:nil]; [MDCSnackbarManager dismissAndCallCompletionBlocksWithCategory:nil];
[AppDelegate.instance hideMenuAnimated:YES];
_fetchingErrorViewController.label.text = errorText; _fetchingErrorViewController.label.text = errorText;
remoting::SetAccessibilityFocusElement(_fetchingErrorViewController.label); remoting::SetAccessibilityFocusElement(_fetchingErrorViewController.label);
......
...@@ -81,20 +81,6 @@ static NSString* const kFeedbackContext = @"SideMenuFeedbackContext"; ...@@ -81,20 +81,6 @@ static NSString* const kFeedbackContext = @"SideMenuFeedbackContext";
action:^{ action:^{
[AppDelegate.instance presentHelpCenter]; [AppDelegate.instance presentHelpCenter];
}], }],
],
@[
[[SideMenuItem alloc]
initWithTitle:l10n_util::GetNSString(IDS_TERMS_OF_SERVICE)
icon:nil
action:^{
[AppDelegate.instance presentTermsOfService];
}],
[[SideMenuItem alloc]
initWithTitle:l10n_util::GetNSString(IDS_PRIVACY_POLICY)
icon:nil
action:^{
[AppDelegate.instance presentPrivacyPolicy];
}]
] ]
]; ];
}); });
......
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