Fix breakages in https://codereview.chromium.org/1155713003/
[chromium-blink-merge.git] / ios / web / net / clients / crw_js_injection_network_client.h
blobb22e6b884c9b1b1122edf55b3340b87ce2c1db9c
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"
10 namespace web {
11 // Used for UMA histogram and must be kept in sync with the histograms.xml file.
12 enum class InjectionResult : int {
13 SUCCESS_INJECTED,
14 FAIL_FIND_INJECTION_LOCATION,
15 FAIL_INSUFFICIENT_CONTENT_LENGTH,
16 FAIL_SELF_REFERRER,
18 INJECTION_RESULT_COUNT
19 // INJECTION_RESULT_COUNT must always be the last element in this enum
21 } // namespace web
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
28 // or XHTML.
29 + (BOOL)canHandleResponse:(NSURLResponse*)response;
31 @end
33 #endif // IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_