Commit 202cd8ea authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[CRD iOS] Fixing/updating obsolete TODOs

This CL fixes/updates obsolete TODOs in remoting/ios, along with some
other small cleanups nearby.

Bug: 786616
Change-Id: I29b5e41a6dabb2f314a6e4fadc3fa443d1a55328
Reviewed-on: https://chromium-review.googlesource.com/783663
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519920}
parent c73d009b
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
@property(strong, nonatomic) UIWindow* window; @property(strong, nonatomic) UIWindow* window;
@property(class, strong, nonatomic, readonly) AppDelegate* instance; @property(class, strong, nonatomic, readonly) AppDelegate* instance;
// This will push the FAQ view controller onto the provided nav controller.
- (void)navigateToFAQs:(UINavigationController*)navigationController;
// This will push the Help Center view controller onto the provided nav // This will push the Help Center view controller onto the provided nav
// controller. // controller.
- (void)navigateToHelpCenter:(UINavigationController*)navigationController; - (void)navigateToHelpCenter:(UINavigationController*)navigationController;
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
#import "remoting/ios/app/app_delegate.h" #import "remoting/ios/app/app_delegate.h"
#import "ios/third_party/material_components_ios/src/components/Dialogs/src/ColorThemer/MDCAlertColorThemer.h"
#import "ios/third_party/material_components_ios/src/components/Themes/src/MDCColorScheme.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"
#import "remoting/ios/app/help_and_feedback.h" #import "remoting/ios/app/help_and_feedback.h"
...@@ -32,10 +30,6 @@ ...@@ -32,10 +30,6 @@
} }
@end @end
// TODO(nicholss): There is no FAQ page at the moment.
static NSString* const kFAQsUrl =
@"https://support.google.com/chrome/answer/1649523?co=GENIE.Platform%3DiOS";
@implementation AppDelegate @implementation AppDelegate
@synthesize window = _window; @synthesize window = _window;
...@@ -51,17 +45,13 @@ static NSString* const kFAQsUrl = ...@@ -51,17 +45,13 @@ static NSString* const kFAQsUrl =
- (BOOL)application:(UIApplication*)application - (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
[self launchRootViewController]; [self launchRootViewController];
[RemotingTheme applyColorSchemes];
// TODO(yuweih): Follow up on this to see if it can be removed. There is a bug
// where the MDC alert is defaulting to white text on white background.
MDCBasicColorScheme* colorScheme = [[MDCBasicColorScheme alloc]
initWithPrimaryColor:RemotingTheme.flatButtonTextColor];
[MDCAlertColorThemer applyColorScheme:colorScheme];
return YES; return YES;
} }
#ifndef NDEBUG #ifndef NDEBUG
// Used by Chromium debug build to authenticate.
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url {
DCHECK([RemotingService.instance.authentication DCHECK([RemotingService.instance.authentication
isKindOfClass:[RemotingOAuthAuthentication class]]); isKindOfClass:[RemotingOAuthAuthentication class]]);
...@@ -126,13 +116,6 @@ static NSString* const kFAQsUrl = ...@@ -126,13 +116,6 @@ static NSString* const kFAQsUrl =
#pragma mark - AppDelegate #pragma mark - AppDelegate
- (void)navigateToFAQs:(UINavigationController*)navigationController {
WebViewController* viewController =
[[WebViewController alloc] initWithUrl:kFAQsUrl
title:l10n_util::GetNSString(IDS_FAQS)];
[navigationController pushViewController:viewController animated:YES];
}
- (void)navigateToHelpCenter:(UINavigationController*)navigationController { - (void)navigateToHelpCenter:(UINavigationController*)navigationController {
[navigationController pushViewController:[[HelpViewController alloc] init] [navigationController pushViewController:[[HelpViewController alloc] init]
animated:YES]; animated:YES];
......
...@@ -559,16 +559,13 @@ static const CGFloat kKeyboardAnimationTime = 0.3; ...@@ -559,16 +559,13 @@ static const CGFloat kKeyboardAnimationTime = 0.3;
} }
- (void)didProvidePin:(NSString*)pin createPairing:(BOOL)createPairing { - (void)didProvidePin:(NSString*)pin createPairing:(BOOL)createPairing {
// TODO(nicholss): There is an open question if createPairing is supported on
// iOS. Need to fingure this out.
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
postNotificationName:kHostSessionPinProvided postNotificationName:kHostSessionPinProvided
object:self object:self
userInfo:@{ userInfo:@{
kHostSessionHostName : _remoteHostName, kHostSessionHostName : _remoteHostName,
kHostSessionPin : pin, kHostSessionPin : pin,
kHostSessionCreatePairing : kHostSessionCreatePairing : @(createPairing)
[NSNumber numberWithBool:createPairing]
}]; }];
} }
......
...@@ -319,8 +319,6 @@ static const CGFloat kMoveFABAnimationTime = 0.3; ...@@ -319,8 +319,6 @@ static const CGFloat kMoveFABAnimationTime = 0.3;
#pragma mark - RemotingSettingsViewControllerDelegate #pragma mark - RemotingSettingsViewControllerDelegate
- (void)setResizeToFit:(BOOL)resizeToFit { - (void)setResizeToFit:(BOOL)resizeToFit {
// TODO(yuweih): Maybe we add a native screen size mimimum before enabling
// this option? This doesn't work well for smaller screens. Ask Jon.
_settings.shouldResizeHostToFit = resizeToFit; _settings.shouldResizeHostToFit = resizeToFit;
[self resizeHostToFitIfNeeded]; [self resizeHostToFitIfNeeded];
} }
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
// Styles to be used when rendering the iOS client's UI. // Styles to be used when rendering the iOS client's UI.
@interface RemotingTheme : NSObject @interface RemotingTheme : NSObject
// Applys default color schemes on elements like buttons and alerts.
+ (void)applyColorSchemes;
// Colors // Colors
@property(class, nonatomic, readonly) UIColor* buttonBackgroundColor; @property(class, nonatomic, readonly) UIColor* buttonBackgroundColor;
......
...@@ -8,11 +8,20 @@ ...@@ -8,11 +8,20 @@
#import "remoting/ios/app/remoting_theme.h" #import "remoting/ios/app/remoting_theme.h"
#import "ios/third_party/material_components_ios/src/components/Dialogs/src/ColorThemer/MDCAlertColorThemer.h"
#import "ios/third_party/material_components_ios/src/components/Themes/src/MDCColorScheme.h"
#include "remoting/base/string_resources.h" #include "remoting/base/string_resources.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
@implementation RemotingTheme @implementation RemotingTheme
+ (void)applyColorSchemes {
MDCBasicColorScheme* colorScheme = [[MDCBasicColorScheme alloc]
initWithPrimaryColor:RemotingTheme.flatButtonTextColor];
[MDCAlertColorThemer applyColorScheme:colorScheme];
}
#pragma mark - Colors #pragma mark - Colors
+ (UIColor*)firstLaunchViewBackgroundColor { + (UIColor*)firstLaunchViewBackgroundColor {
......
...@@ -43,13 +43,6 @@ imageset("Background") { ...@@ -43,13 +43,6 @@ imageset("Background") {
] ]
} }
# TODO(yuweih): This target is used to exclude material design imagesets from
# the internal app's source set, that are already pulled-in by other deps of the
# internal app. We will need to redesign these once crbug.com/734054 is
# resolved.
group("system_icons") {
}
group("launchscreen_assets") { group("launchscreen_assets") {
public_deps = [ public_deps = [
":launchscreen_app_logo", ":launchscreen_app_logo",
......
...@@ -72,7 +72,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext"; ...@@ -72,7 +72,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext";
forSupplementaryViewOfKind:UICollectionElementKindSectionHeader forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
withReuseIdentifier:UICollectionElementKindSectionHeader]; withReuseIdentifier:UICollectionElementKindSectionHeader];
// TODO(nicholss): All of these strings need to be setup for l18n.
_sections = @[ _sections = @[
l10n_util::GetNSString(IDS_DISPLAY_OPTIONS), l10n_util::GetNSString(IDS_DISPLAY_OPTIONS),
l10n_util::GetNSString(IDS_MOUSE_OPTIONS), l10n_util::GetNSString(IDS_MOUSE_OPTIONS),
...@@ -234,22 +233,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext"; ...@@ -234,22 +233,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext";
__weak RemotingSettingsViewController* weakSelf = self; __weak RemotingSettingsViewController* weakSelf = self;
// We are not going to support the shrink option for now.
#if 0
SettingOption* shrinkOption = [[SettingOption alloc] init];
shrinkOption.title = l10n_util::GetNSString(IDS_SHRINK_TO_FIT);
// TODO(nicholss): I think this text changes based on value. Confirm.
shrinkOption.subtext = l10n_util::GetNSString(IDS_SHRINK_TO_FIT_SUBTITLE);
shrinkOption.style = OptionCheckbox;
shrinkOption.checked = NO;
__weak SettingOption* weakShrinkOption = shrinkOption;
shrinkOption.action = ^{
if ([weakSelf.delegate respondsToSelector:@selector(setShrinkToFit:)]) {
[weakSelf.delegate setShrinkToFit:weakShrinkOption.checked];
}
};
#endif
SettingOption* resizeOption = [[SettingOption alloc] init]; SettingOption* resizeOption = [[SettingOption alloc] init];
resizeOption.title = l10n_util::GetNSString(IDS_RESIZE_TO_CLIENT); resizeOption.title = l10n_util::GetNSString(IDS_RESIZE_TO_CLIENT);
// TODO(nicholss): I think this text changes based on value. Confirm. // TODO(nicholss): I think this text changes based on value. Confirm.
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
// A detail record for a Remoting User. // A detail record for a Remoting User.
// TODO(nicholss): This is not the final object yet.
@interface UserInfo : NSObject @interface UserInfo : NSObject
@property(nonatomic, copy) NSString* userId; @property(nonatomic, copy) NSString* userId;
......
...@@ -123,7 +123,6 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus( ...@@ -123,7 +123,6 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus(
std::string(base::SysNSStringToUTF8(authorizationCode)), std::string(base::SysNSStringToUTF8(authorizationCode)),
base::BindBlockArc( base::BindBlockArc(
^(const std::string& user_email, const std::string& refresh_token) { ^(const std::string& user_email, const std::string& refresh_token) {
// TODO(nicholss): Do something with these new creds.
VLOG(1) << "New Creds: " << user_email << " " << refresh_token; VLOG(1) << "New Creds: " << user_email << " " << refresh_token;
UserInfo* user = [[UserInfo alloc] init]; UserInfo* user = [[UserInfo alloc] init];
user.userEmail = base::SysUTF8ToNSString(user_email); user.userEmail = base::SysUTF8ToNSString(user_email);
...@@ -161,8 +160,8 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus( ...@@ -161,8 +160,8 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus(
} }
- (void)callbackWithAccessToken:(AccessTokenCallback)onAccessToken { - (void)callbackWithAccessToken:(AccessTokenCallback)onAccessToken {
// TODO(nicholss): Be careful here since a failure to reset onAccessToken // Be careful here since a failure to reset onAccessToken will end up with
// will end up with retain cycle and memory leakage. // retain cycle and memory leakage.
if (_tokenGetter) { if (_tokenGetter) {
_tokenGetter->CallWithToken(base::BindBlockArc( _tokenGetter->CallWithToken(base::BindBlockArc(
^(remoting::OAuthTokenGetter::Status status, ^(remoting::OAuthTokenGetter::Status status,
......
...@@ -73,7 +73,6 @@ NSString* const kUserInfo = @"kUserInfo"; ...@@ -73,7 +73,6 @@ NSString* const kUserInfo = @"kUserInfo";
// TODO(yuweih): Maybe better to just cancel the previous request. // TODO(yuweih): Maybe better to just cancel the previous request.
_hostListState = HostListStateNotFetched; _hostListState = HostListStateNotFetched;
_lastFetchFailureReason = HostListFetchFailureReasonNoFailure; _lastFetchFailureReason = HostListFetchFailureReasonNoFailure;
// TODO(nicholss): This might need a pointer back to the service.
_clientRuntimeDelegate = _clientRuntimeDelegate =
new remoting::IosClientRuntimeDelegate(); new remoting::IosClientRuntimeDelegate();
[self runtime]->SetDelegate(_clientRuntimeDelegate); [self runtime]->SetDelegate(_clientRuntimeDelegate);
......
...@@ -16,8 +16,6 @@ typedef void (^PairingCredentialsCallback)(NSString* pairingId, ...@@ -16,8 +16,6 @@ typedef void (^PairingCredentialsCallback)(NSString* pairingId,
NSString* secret); NSString* secret);
// Class to abstract the details from how iOS wants to write to the keychain. // Class to abstract the details from how iOS wants to write to the keychain.
// TODO(nicholss): This will have to be futher refactored when we integrate
// with the private Google auth.
@interface KeychainWrapper : NSObject @interface KeychainWrapper : NSObject
// Save a refresh token to the keychain. // Save a refresh token to the keychain.
......
...@@ -113,8 +113,7 @@ NSString* const kHostSessionPin = @"kHostSessionPin"; ...@@ -113,8 +113,7 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
info.pairing_secret = ""; info.pairing_secret = "";
} }
// TODO(nicholss): I am not sure about the following fields yet. info.capabilities = "";
// info.capabilities =
if ([RemotingPreferences.instance boolForFlag:RemotingFlagUseWebRTC]) { if ([RemotingPreferences.instance boolForFlag:RemotingFlagUseWebRTC]) {
info.flags = "useWebrtc"; info.flags = "useWebrtc";
[MDCSnackbarManager [MDCSnackbarManager
......
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