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 @@
@property(strong, nonatomic) UIWindow* window;
@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
// controller.
- (void)navigateToHelpCenter:(UINavigationController*)navigationController;
......
......@@ -8,8 +8,6 @@
#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/first_launch_view_presenter.h"
#import "remoting/ios/app/help_and_feedback.h"
......@@ -32,10 +30,6 @@
}
@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
@synthesize window = _window;
......@@ -51,17 +45,13 @@ static NSString* const kFAQsUrl =
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
[self launchRootViewController];
// 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];
[RemotingTheme applyColorSchemes];
return YES;
}
#ifndef NDEBUG
// Used by Chromium debug build to authenticate.
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url {
DCHECK([RemotingService.instance.authentication
isKindOfClass:[RemotingOAuthAuthentication class]]);
......@@ -126,13 +116,6 @@ static NSString* const kFAQsUrl =
#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 {
[navigationController pushViewController:[[HelpViewController alloc] init]
animated:YES];
......
......@@ -559,16 +559,13 @@ static const CGFloat kKeyboardAnimationTime = 0.3;
}
- (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]
postNotificationName:kHostSessionPinProvided
object:self
userInfo:@{
kHostSessionHostName : _remoteHostName,
kHostSessionPin : pin,
kHostSessionCreatePairing :
[NSNumber numberWithBool:createPairing]
kHostSessionCreatePairing : @(createPairing)
}];
}
......
......@@ -319,8 +319,6 @@ static const CGFloat kMoveFABAnimationTime = 0.3;
#pragma mark - RemotingSettingsViewControllerDelegate
- (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;
[self resizeHostToFitIfNeeded];
}
......
......@@ -10,6 +10,9 @@
// Styles to be used when rendering the iOS client's UI.
@interface RemotingTheme : NSObject
// Applys default color schemes on elements like buttons and alerts.
+ (void)applyColorSchemes;
// Colors
@property(class, nonatomic, readonly) UIColor* buttonBackgroundColor;
......
......@@ -8,11 +8,20 @@
#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 "ui/base/l10n/l10n_util.h"
@implementation RemotingTheme
+ (void)applyColorSchemes {
MDCBasicColorScheme* colorScheme = [[MDCBasicColorScheme alloc]
initWithPrimaryColor:RemotingTheme.flatButtonTextColor];
[MDCAlertColorThemer applyColorScheme:colorScheme];
}
#pragma mark - Colors
+ (UIColor*)firstLaunchViewBackgroundColor {
......
......@@ -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") {
public_deps = [
":launchscreen_app_logo",
......
......@@ -72,7 +72,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext";
forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
withReuseIdentifier:UICollectionElementKindSectionHeader];
// TODO(nicholss): All of these strings need to be setup for l18n.
_sections = @[
l10n_util::GetNSString(IDS_DISPLAY_OPTIONS),
l10n_util::GetNSString(IDS_MOUSE_OPTIONS),
......@@ -234,22 +233,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext";
__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];
resizeOption.title = l10n_util::GetNSString(IDS_RESIZE_TO_CLIENT);
// TODO(nicholss): I think this text changes based on value. Confirm.
......
......@@ -8,7 +8,6 @@
#import <Foundation/Foundation.h>
// A detail record for a Remoting User.
// TODO(nicholss): This is not the final object yet.
@interface UserInfo : NSObject
@property(nonatomic, copy) NSString* userId;
......
......@@ -123,7 +123,6 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus(
std::string(base::SysNSStringToUTF8(authorizationCode)),
base::BindBlockArc(
^(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;
UserInfo* user = [[UserInfo alloc] init];
user.userEmail = base::SysUTF8ToNSString(user_email);
......@@ -161,8 +160,8 @@ RemotingAuthenticationStatus oauthStatusToRemotingAuthenticationStatus(
}
- (void)callbackWithAccessToken:(AccessTokenCallback)onAccessToken {
// TODO(nicholss): Be careful here since a failure to reset onAccessToken
// will end up with retain cycle and memory leakage.
// Be careful here since a failure to reset onAccessToken will end up with
// retain cycle and memory leakage.
if (_tokenGetter) {
_tokenGetter->CallWithToken(base::BindBlockArc(
^(remoting::OAuthTokenGetter::Status status,
......
......@@ -73,7 +73,6 @@ NSString* const kUserInfo = @"kUserInfo";
// TODO(yuweih): Maybe better to just cancel the previous request.
_hostListState = HostListStateNotFetched;
_lastFetchFailureReason = HostListFetchFailureReasonNoFailure;
// TODO(nicholss): This might need a pointer back to the service.
_clientRuntimeDelegate =
new remoting::IosClientRuntimeDelegate();
[self runtime]->SetDelegate(_clientRuntimeDelegate);
......
......@@ -16,8 +16,6 @@ typedef void (^PairingCredentialsCallback)(NSString* pairingId,
NSString* secret);
// 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
// Save a refresh token to the keychain.
......
......@@ -113,8 +113,7 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
info.pairing_secret = "";
}
// TODO(nicholss): I am not sure about the following fields yet.
// info.capabilities =
info.capabilities = "";
if ([RemotingPreferences.instance boolForFlag:RemotingFlagUseWebRTC]) {
info.flags = "useWebrtc";
[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