Commit 0df2f544 authored by Hiroshi Ichikawa's avatar Hiroshi Ichikawa Committed by Commit Bot

Add NS_ASSUME_NONNULL_BEGIN/END to files in //ios/web_view.

Bug: 696661
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I4fd7e1f098c7179f813149e565f4c8f29aa92e47
Reviewed-on: https://chromium-review.googlesource.com/867149Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: Hiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530005}
parent dadd77a1
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_html_element.h"
NS_ASSUME_NONNULL_BEGIN
@interface CWVHTMLElement ()
- (nonnull instancetype)init NS_UNAVAILABLE;
......@@ -18,4 +20,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_HTML_ELEMENT_INTERNAL_H_
......@@ -7,14 +7,18 @@
#import "ios/web_view/public/cwv_navigation_action.h"
NS_ASSUME_NONNULL_BEGIN
@interface CWVNavigationAction ()
- (nonnull instancetype)init NS_UNAVAILABLE;
- (nonnull instancetype)initWithRequest:(nonnull NSURLRequest*)request
- (nonnull instancetype)initWithRequest:(NSURLRequest*)request
userInitiated:(BOOL)userInitiated
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_NAVIGATION_ACTION_INTERNAL_H_
......@@ -7,8 +7,12 @@
#include "ios/web_view/public/cwv_navigation_type.h"
#include "ui/base/page_transition_types.h"
NS_ASSUME_NONNULL_BEGIN
// Converts ui::PageTransition to CWVNavigationType.
CWVNavigationType CWVNavigationTypeFromPageTransition(
ui::PageTransition ui_page_transition);
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_PAGE_TRANSITION_INTERNAL_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_preferences.h"
NS_ASSUME_NONNULL_BEGIN
class PrefService;
@interface CWVPreferences ()
......@@ -18,4 +20,6 @@ class PrefService;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_PREFERENCES_INTERNAL_H_
......@@ -9,6 +9,8 @@
#import "ios/web_view/public/cwv_scroll_view.h"
NS_ASSUME_NONNULL_BEGIN
@class CRWWebViewScrollViewProxy;
@interface CWVScrollView ()
......@@ -18,4 +20,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_SCROLL_VIEW_INTERNAL_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_user_content_controller.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVWebViewConfiguration;
@interface CWVUserContentController ()
......@@ -16,4 +18,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_USER_CONTENT_CONTROLLER_INTERNAL_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_web_view_configuration.h"
NS_ASSUME_NONNULL_BEGIN
namespace ios_web_view {
class WebViewBrowserState;
} // namespace ios_web_view
......@@ -20,12 +22,11 @@ class WebViewBrowserState;
+ (void)shutDown;
// The browser state associated with this configuration.
@property(nonatomic, readonly, nonnull)
ios_web_view::WebViewBrowserState* browserState;
@property(nonatomic, readonly) ios_web_view::WebViewBrowserState* browserState;
// Registers a |webView| so that this class can call |shutDown| on it later on.
// Only weak references are held, so no need for de-register method.
- (void)registerWebView:(nonnull CWVWebView*)webView;
- (void)registerWebView:(CWVWebView*)webView;
// Because Obj-C classes under ARC tend to outlive C++ classes, this method is
// needed to cleanly tear down this object. Must be called before |dealloc|.
......@@ -33,4 +34,6 @@ class WebViewBrowserState;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_WEB_VIEW_CONFIGURATION_INTERNAL_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_web_view.h"
NS_ASSUME_NONNULL_BEGIN
@interface CWVWebView ()
// This is called by the associated CWVWebViewConfiguration in order to shut
......@@ -15,4 +17,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_CWV_WEB_VIEW_INTERNAL_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_authentication_controller.h"
NS_ASSUME_NONNULL_BEGIN
namespace ios_web_view {
class WebViewBrowserState;
} // namespace ios_web_view
......@@ -19,4 +21,6 @@ class WebViewBrowserState;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_SIGNIN_CWV_AUTHENTICATION_CONTROLLER_INTERNAL_H_
......@@ -9,6 +9,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
// Encapsulates information about HTML element. Used in
// delegate methods.
CWV_EXPORT
......@@ -22,4 +24,6 @@ CWV_EXPORT
@property(nullable, copy, readonly) NSString* text;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_HTML_ELEMENT_H_
......@@ -9,15 +9,19 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
// Encapsulates information about an action which caused a navigation.
CWV_EXPORT
@interface CWVNavigationAction : NSObject
// Destination request associated with the action.
@property(nonatomic, copy, readonly, nonnull) NSURLRequest* request;
@property(nonatomic, copy, readonly) NSURLRequest* request;
// YES if the action was caused by a user action (e.g. link tap).
@property(nonatomic, readonly, getter=isUserInitiated) BOOL userInitiated;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_NAVIGATION_ACTION_H_
......@@ -11,6 +11,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@protocol CWVScrollViewDelegate;
// Scroll view inside the web view. This is not a subclass of UIScrollView
......@@ -19,8 +21,6 @@
//
// These methods are forwarded to the internal UIScrollView. Please see the
// <UIKit/UIScrollView.h> documentation for details about the following methods.
//
// TODO(crbug.com/719323): Add nullability annotations.
CWV_EXPORT
@interface CWVScrollView : NSObject
......@@ -56,4 +56,6 @@ CWV_EXPORT
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_
......@@ -9,6 +9,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVScrollView;
// Delegete for CWVScrollView.
......@@ -32,4 +34,6 @@ CWV_EXPORT
- (void)scrollViewWillBeginZooming:(CWVScrollView*)webViewScrollViewProxy;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_DELEGATE_H_
......@@ -10,6 +10,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVHTMLElement;
@class CWVPreviewElementInfo;
@class CWVWebView;
......@@ -74,7 +76,7 @@ CWV_EXPORT
// Called when the user performs a peek action on a link with |linkURL| with
// force touch. Returns a view controller shown as a pop-up. Uses Webkit's
// default preview behavior when it returns nil.
- (UIViewController*)webView:(CWVWebView*)webView
- (nullable UIViewController*)webView:(CWVWebView*)webView
previewingViewControllerForElement:(CWVPreviewElementInfo*)elementInfo;
// Instructs the delegate to display |previewingViewController| inside the app,
......@@ -84,4 +86,6 @@ CWV_EXPORT
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_UI_DELEGATE_H_
......@@ -9,6 +9,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVUserScript;
// Allows injecting custom scripts into CWVWebView created with the
......@@ -17,17 +19,18 @@ CWV_EXPORT
@interface CWVUserContentController : NSObject
// The user scripts associated with the configuration.
@property(nonatomic, copy, readonly, nonnull)
NSArray<CWVUserScript*>* userScripts;
@property(nonatomic, copy, readonly) NSArray<CWVUserScript*>* userScripts;
- (nonnull instancetype)init NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
// Adds a user script.
- (void)addUserScript:(nonnull CWVUserScript*)userScript;
- (void)addUserScript:(CWVUserScript*)userScript;
// Removes all associated user scripts.
- (void)removeAllUserScripts;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_CONTENT_CONTROLLER_H_
......@@ -9,6 +9,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
// User Script to be injected into main frame of CWVWebView after
// window.document is created, but before other content is loaded (i.e., at the
// same timing as WKUserScriptInjectionTimeAtDocumentStart).
......@@ -16,12 +18,14 @@ CWV_EXPORT
@interface CWVUserScript : NSObject
// JavaScript source code.
@property(nonatomic, copy, readonly, nonnull) NSString* source;
@property(nonatomic, copy, readonly) NSString* source;
- (nonnull instancetype)init NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
- (nonnull instancetype)initWithSource:(nonnull NSString*)source;
- (instancetype)initWithSource:(NSString*)source;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_
......@@ -8,6 +8,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVAutofillController;
@class CWVScrollView;
@class CWVTranslationController;
......@@ -29,7 +31,8 @@ CWV_EXPORT
@property(nonatomic, readonly) CWVWebViewConfiguration* configuration;
// This web view's navigation delegate.
@property(nonatomic, weak) id<CWVNavigationDelegate> navigationDelegate;
@property(nonatomic, weak, nullable) id<CWVNavigationDelegate>
navigationDelegate;
// This web view's translation controller.
@property(nonatomic, readonly) CWVTranslationController* translationController;
......@@ -38,7 +41,7 @@ CWV_EXPORT
@property(nonatomic, readonly) CWVAutofillController* autofillController;
// This web view's UI delegate
@property(nonatomic, weak) id<CWVUIDelegate> UIDelegate;
@property(nonatomic, weak, nullable) id<CWVUIDelegate> UIDelegate;
// Whether or not this web view can go backwards or forwards. KVO Compliant.
@property(nonatomic, readonly) BOOL canGoBack;
......@@ -110,7 +113,6 @@ CWV_EXPORT
clientID:(NSString*)clientID
clientSecret:(NSString*)clientSecret;
// |configuration| must not be null
- (instancetype)initWithFrame:(CGRect)frame
configuration:(CWVWebViewConfiguration*)configuration
NS_DESIGNATED_INITIALIZER;
......@@ -140,4 +142,6 @@ CWV_EXPORT
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_
......@@ -7,6 +7,8 @@
#import "ios/web_view/public/cwv_web_view_configuration.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVAuthenticationController;
@interface CWVWebViewConfiguration (Sync)
......@@ -18,4 +20,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_CONFIGURATION_SYNC_H_
......@@ -9,6 +9,8 @@
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVPreferences;
@class CWVUserContentController;
@class CWVWebsiteDataStore;
......@@ -38,4 +40,6 @@ CWV_EXPORT
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_CONFIGURATION_H_
......@@ -6,6 +6,8 @@
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
// UIApplicationDelegate implementation for web_view_shell.
@interface ShellAppDelegate : UIResponder<UIApplicationDelegate>
......@@ -14,4 +16,6 @@
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_SHELL_SHELL_APP_DELEGATE_H_
......@@ -8,7 +8,11 @@
#import <ChromeWebView/ChromeWebView.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShellAutofillDelegate : NSObject<CWVAutofillControllerDelegate>
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_SHELL_SHELL_AUTOFILL_DELEGATE_H_
......@@ -8,7 +8,11 @@
#import <ChromeWebView/ChromeWebView.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShellTranslationDelegate : NSObject<CWVTranslationControllerDelegate>
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_SHELL_SHELL_TRANSLATION_DELEGATE_H_
......@@ -8,6 +8,8 @@
#import <ChromeWebView/ChromeWebView.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
// Accessibility label added to the back button.
extern NSString* const kWebViewShellBackButtonAccessibilityLabel;
// Accessibility label added to the forward button.
......@@ -27,4 +29,6 @@ extern NSString* const
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_SHELL_SHELL_VIEW_CONTROLLER_H_
......@@ -9,6 +9,8 @@
#import <EarlGrey/EarlGrey.h>
NS_ASSUME_NONNULL_BEGIN
namespace ios_web_view {
// Matcher for web view shell address field text property equal to |text|.
......@@ -25,4 +27,6 @@ id<GREYMatcher> AddressField();
} // namespace ios_web_view
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_SHELL_TEST_EARL_GREY_WEB_VIEW_SHELL_MATCHERS_H_
......@@ -7,6 +7,8 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
// Observes a KVO compliant property. To use this Observer, create an instance
// and call |setObservedObject:keyPath:|. Then test expected values against
// |lastValue|.
......@@ -28,9 +30,10 @@
// Sets the |object| and |keyPath| to observe. The |keyPath| property of
// |object| must exist and be KVO compliant.
- (void)setObservedObject:(nonnull NSObject*)object
keyPath:(nonnull NSString*)keyPath;
- (void)setObservedObject:(NSObject*)object keyPath:(NSString*)keyPath;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_TEST_OBSERVER_H_
......@@ -5,11 +5,14 @@
#ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_
#define IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_
#import <Foundation/Foundation.h>
#include <memory>
#include <string>
#include "testing/platform_test.h"
NS_ASSUME_NONNULL_BEGIN
namespace net {
namespace test_server {
class EmbeddedTestServer;
......@@ -56,3 +59,5 @@ class WebViewIntTest : public PlatformTest {
} // namespace ios_web_view
#endif // IOS_WEB_VIEW_TEST_WEB_VIEW_INT_TEST_H_
NS_ASSUME_NONNULL_END
......@@ -9,6 +9,8 @@
#include "base/compiler_specific.h"
NS_ASSUME_NONNULL_BEGIN
@class CWVWebView;
namespace ios_web_view {
......@@ -44,3 +46,5 @@ bool WaitForWebViewLoadCompletionOrTimeout(CWVWebView* web_view)
} // namespace ios_web_view
#endif // IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_
NS_ASSUME_NONNULL_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