Commit b4f69961 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Removes the TextFieldStyling protocol and associated code (5/5).

BUG=991397

Change-Id: I6fe57a8f8e51200a87c8c7eaeb77b6ea6e7cc68f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742807Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685299}
parent 02e551b2
......@@ -19,7 +19,6 @@ source_set("providers") {
"//base",
"//ios/chrome/browser/providers/images",
"//ios/chrome/browser/providers/signin",
"//ios/chrome/browser/providers/ui",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/distribution",
"//ios/public/provider/chrome/browser/signin",
......
......@@ -19,8 +19,6 @@ class ChromiumBrowserProvider : public ios::ChromeBrowserProvider {
std::unique_ptr<ios::ChromeIdentityService> service) override;
ios::ChromeIdentityService* GetChromeIdentityService() override;
UITextField* CreateStyledTextField() const override NS_RETURNS_RETAINED;
UITextField<TextFieldStyling>* CreateStyledTextField(
CGRect frame) const override NS_RETURNS_RETAINED;
VoiceSearchProvider* GetVoiceSearchProvider() const override;
id<LogoVendor> CreateLogoVendor(ios::ChromeBrowserState* browser_state)
const override NS_RETURNS_RETAINED;
......
......@@ -11,7 +11,6 @@
#import "ios/chrome/browser/providers/chromium_voice_search_provider.h"
#import "ios/chrome/browser/providers/images/chromium_branded_image_provider.h"
#include "ios/chrome/browser/providers/signin/chromium_signin_resources_provider.h"
#include "ios/chrome/browser/providers/ui/chromium_styled_text_field.h"
#include "ios/public/provider/chrome/browser/distribution/app_distribution_provider.h"
#include "ios/public/provider/chrome/browser/overrides_provider.h"
#include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h"
......@@ -65,11 +64,6 @@ UITextField* ChromiumBrowserProvider::CreateStyledTextField() const {
return [[UITextField alloc] initWithFrame:CGRectZero];
}
UITextField<TextFieldStyling>* ChromiumBrowserProvider::CreateStyledTextField(
CGRect frame) const {
return [[ChromiumStyledTextField alloc] initWithFrame:CGRectZero];
}
VoiceSearchProvider* ChromiumBrowserProvider::GetVoiceSearchProvider() const {
return voice_search_provider_.get();
}
......
# Copyright 2016 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.
source_set("ui") {
sources = [
"chromium_styled_text_field.h",
"chromium_styled_text_field.mm",
]
deps = [
"//base",
"//ios/public/provider/chrome/browser/ui",
]
libs = [ "UIKit.framework" ]
configs += [ "//build/config/compiler:enable_arc" ]
}
// Copyright 2016 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_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_
#define IOS_CHROME_BROWSER_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_
#import "ios/public/provider/chrome/browser/ui/text_field_styling.h"
#import <UIKit/UIKit.h>
// ChromiumStyledTextField does not style the text field or perform text
// validation, but it provides a barebones implementation of the
// TextFieldStyling protocol for use in Chromium builds.
@interface ChromiumStyledTextField : UITextField<TextFieldStyling>
@end
#endif // IOS_CHROME_BROWSER_PROVIDERS_UI_CHROMIUM_STYLED_TEXT_FIELD_H_
// Copyright 2016 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/providers/ui/chromium_styled_text_field.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation ChromiumStyledTextField
@synthesize placeholderStyle = _placeholderStyle;
@synthesize textValidator = _textValidator;
- (void)setUseErrorStyling:(BOOL)error {
}
@end
......@@ -44,7 +44,6 @@ source_set("test_support") {
"//ios/public/provider/chrome/browser/signin:test_support",
"//ios/public/provider/chrome/browser/spotlight:test_support",
"//ios/public/provider/chrome/browser/ui",
"//ios/public/provider/chrome/browser/ui:test_support",
"//ios/public/provider/chrome/browser/user:test_support",
"//ios/public/provider/chrome/browser/user_feedback:test_support",
"//ios/public/provider/chrome/browser/voice",
......
......@@ -37,7 +37,6 @@ class WebState;
}
@protocol LogoVendor;
@protocol TextFieldStyling;
@class TabModel;
@class UITextField;
@class UIView;
......@@ -110,9 +109,6 @@ class ChromeBrowserProvider {
virtual std::string GetRiskData();
// Creates and returns a new styled text field.
virtual UITextField* CreateStyledTextField() const NS_RETURNS_RETAINED;
// Deprecated.
virtual UITextField<TextFieldStyling>* CreateStyledTextField(
CGRect frame) const NS_RETURNS_RETAINED;
// Initializes the cast service. Should be called soon after the given
// |main_tab_model| is created.
......
......@@ -72,11 +72,6 @@ UITextField* ChromeBrowserProvider::CreateStyledTextField() const {
return nil;
}
UITextField<TextFieldStyling>* ChromeBrowserProvider::CreateStyledTextField(
CGRect frame) const {
return nil;
}
void ChromeBrowserProvider::InitializeCastService(
TabModel* main_tab_model) const {}
......
......@@ -9,7 +9,6 @@
#include "base/macros.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#include "ios/public/provider/chrome/browser/ui/text_field_styling.h"
namespace ios {
......@@ -27,8 +26,6 @@ class TestChromeBrowserProvider : public ChromeBrowserProvider {
std::unique_ptr<ChromeIdentityService> service) override;
ChromeIdentityService* GetChromeIdentityService() override;
UITextField* CreateStyledTextField() const override NS_RETURNS_RETAINED;
UITextField<TextFieldStyling>* CreateStyledTextField(
CGRect frame) const override NS_RETURNS_RETAINED;
VoiceSearchProvider* GetVoiceSearchProvider() const override;
AppDistributionProvider* GetAppDistributionProvider() const override;
OmahaServiceProvider* GetOmahaServiceProvider() const override;
......
......@@ -15,7 +15,6 @@
#include "ios/public/provider/chrome/browser/signin/test_signin_resources_provider.h"
#import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h"
#import "ios/public/provider/chrome/browser/ui/fullscreen_provider.h"
#import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h"
#import "ios/public/provider/chrome/browser/user/test_special_user_provider.h"
#import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_provider.h"
#import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h"
......@@ -71,11 +70,6 @@ UITextField* TestChromeBrowserProvider::CreateStyledTextField() const {
return [[UITextField alloc] initWithFrame:CGRectZero];
}
UITextField<TextFieldStyling>* TestChromeBrowserProvider::CreateStyledTextField(
CGRect frame) const {
return [[TestStyledTextField alloc] initWithFrame:frame];
}
VoiceSearchProvider* TestChromeBrowserProvider::GetVoiceSearchProvider() const {
return voice_search_provider_.get();
}
......
......@@ -8,7 +8,6 @@ source_set("ui") {
"fullscreen_provider.h",
"fullscreen_provider.mm",
"logo_vendor.h",
"text_field_styling.h",
]
deps = [
"//base",
......@@ -16,15 +15,3 @@ source_set("ui") {
]
libs = [ "CoreGraphics.framework" ]
}
source_set("test_support") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"test_styled_text_field.h",
"test_styled_text_field.mm",
]
deps = [
":ui",
]
}
// Copyright 2016 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_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEST_STYLED_TEXT_FIELD_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEST_STYLED_TEXT_FIELD_H_
#import "ios/public/provider/chrome/browser/ui/text_field_styling.h"
#import <UIKit/UIKit.h>
@interface TestStyledTextField : UITextField<TextFieldStyling>
@end
#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEST_STYLED_TEXT_FIELD_H_
// Copyright 2016 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/public/provider/chrome/browser/ui/test_styled_text_field.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation TestStyledTextField
@synthesize placeholderStyle = _placeholderStyle;
@synthesize textValidator = _textValidator;
- (void)setUseErrorStyling:(BOOL)error {
}
@end
// Copyright 2016 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_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEXT_FIELD_STYLING_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEXT_FIELD_STYLING_H_
#import <Foundation/Foundation.h>
@protocol TextFieldValidation;
// Types of styling controlling layout of the placeholder.
typedef NS_ENUM(NSInteger, TextFieldStylingPlaceholder) {
// Effectively the same placeholder as a UITextField.
TextFieldStylingPlaceholderDefault = 0,
// The placeholder text will float above the field when there is content or
// the field is being edited.
TextFieldStylingPlaceholderFloatingPlaceholder,
};
// The TextFieldStyling protocol works with UITextField to add methods related
// to styling and input validation.
@protocol TextFieldStyling
// The placement for the placeholder text (if there is any).
@property(nonatomic, assign) TextFieldStylingPlaceholder placeholderStyle;
// The object used to validate text in this text field. If nil, no validation
// is performed.
@property(nonatomic, weak) id<TextFieldValidation> textValidator;
// If |error| is YES, display this field using error colors and styling.
- (void)setUseErrorStyling:(BOOL)error;
@end
// The TextFieldValidation protocol is used to validate the contents of a text
// field.
@protocol TextFieldValidation
// Returns an error string to display if the contents of the given |field| are
// invalid. If this method returns nil, the contents of the field are presumed
// to be valid and no error needs to displayed. This method is called whenever
// the field's text changes.
- (NSString*)validationErrorForTextField:(id<TextFieldStyling>)field;
@end
#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_TEXT_FIELD_STYLING_H_
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