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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_
6 #define IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_
8 #include "ios/net/clients/crn_forwarding_network_client.h"
11 // Used for UMA histogram and must be kept in sync with the histograms.xml file.
12 enum class InjectionResult
: int {
14 FAIL_FIND_INJECTION_LOCATION
,
15 FAIL_INSUFFICIENT_CONTENT_LENGTH
,
18 INJECTION_RESULT_COUNT
19 // INJECTION_RESULT_COUNT must always be the last element in this enum
23 // Network client that injects a script tag into HTML and XHTML documents.
24 @interface CRWJSInjectionNetworkClient
: CRNForwardingNetworkClient
26 // Returns YES if |response| has a "Content-Type" header approriate for
27 // injection. At this time this means if the "Content-Type" header is HTML
29 + (BOOL
)canHandleResponse
:(NSURLResponse
*)response
;
33 #endif // IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_