Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: ios/web/public/web_client.h

Issue 2764773002: Add CWVUserContentController which enables injecting JavaScripts. (Closed)
Patch Set: Apply new comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_WEB_PUBLIC_WEB_CLIENT_H_ 5 #ifndef IOS_WEB_PUBLIC_WEB_CLIENT_H_
6 #define IOS_WEB_PUBLIC_WEB_CLIENT_H_ 6 #define IOS_WEB_PUBLIC_WEB_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // view-source is allowed. 101 // view-source is allowed.
102 virtual void GetAdditionalWebUISchemes( 102 virtual void GetAdditionalWebUISchemes(
103 std::vector<std::string>* additional_schemes) {} 103 std::vector<std::string>* additional_schemes) {}
104 104
105 // Gives the embedder a chance to add url rewriters to the BrowserURLRewriter 105 // Gives the embedder a chance to add url rewriters to the BrowserURLRewriter
106 // singleton. 106 // singleton.
107 virtual void PostBrowserURLRewriterCreation(BrowserURLRewriter* rewriter) {} 107 virtual void PostBrowserURLRewriterCreation(BrowserURLRewriter* rewriter) {}
108 108
109 // Gives the embedder a chance to provide the JavaScript to be injected into 109 // Gives the embedder a chance to provide the JavaScript to be injected into
110 // the web view as early as possible. Result must not be nil. 110 // the web view as early as possible. Result must not be nil.
111 //
112 // TODO(crbug.com/703964): Change the return value to NSArray<NSString*> to
113 // improve performance.
Eugene But (OOO till 7-30) 2017/03/22 15:08:50 nit: please remove extra spaces before "improve" t
Hiroshi Ichikawa 2017/03/23 02:18:40 Done.
111 virtual NSString* GetEarlyPageScript(BrowserState* browser_state) const; 114 virtual NSString* GetEarlyPageScript(BrowserState* browser_state) const;
112 115
113 // Informs the embedder that a certificate error has occurred. If 116 // Informs the embedder that a certificate error has occurred. If
114 // |overridable| is true, the user can ignore the error and continue. The 117 // |overridable| is true, the user can ignore the error and continue. The
115 // embedder can call the |callback| asynchronously (an argument of true means 118 // embedder can call the |callback| asynchronously (an argument of true means
116 // that |cert_error| should be ignored and web// should load the page). 119 // that |cert_error| should be ignored and web// should load the page).
117 virtual void AllowCertificateError( 120 virtual void AllowCertificateError(
118 WebState* web_state, 121 WebState* web_state,
119 int cert_error, 122 int cert_error,
120 const net::SSLInfo& ssl_info, 123 const net::SSLInfo& ssl_info,
121 const GURL& request_url, 124 const GURL& request_url,
122 bool overridable, 125 bool overridable,
123 const base::Callback<void(bool)>& callback); 126 const base::Callback<void(bool)>& callback);
124 127
125 // Provides parameters for initializing the global task scheduler. If 128 // Provides parameters for initializing the global task scheduler. If
126 // |params_vector| is empty, default parameters are used. 129 // |params_vector| is empty, default parameters are used.
127 virtual void GetTaskSchedulerInitializationParams( 130 virtual void GetTaskSchedulerInitializationParams(
128 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 131 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
129 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 132 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
130 index_to_traits_callback) {} 133 index_to_traits_callback) {}
131 134
132 // Performs any necessary PostTask API redirection to the task scheduler. 135 // Performs any necessary PostTask API redirection to the task scheduler.
133 virtual void PerformExperimentalTaskSchedulerRedirections() {} 136 virtual void PerformExperimentalTaskSchedulerRedirections() {}
134 }; 137 };
135 138
136 } // namespace web 139 } // namespace web
137 140
138 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_ 141 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | ios/web_view/BUILD.gn » ('j') | ios/web_view/internal/web_view_early_page_script_provider.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698