Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / web / webui / url_data_source_ios.cc
blob3a1e8208dfbe761d436ef60a28a9ef828ad86753
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 #include "ios/web/public/url_data_source_ios.h"
7 #include "ios/web/public/web_client.h"
8 #include "ios/web/webui/url_data_manager_ios.h"
9 #include "net/url_request/url_request.h"
11 namespace web {
13 void URLDataSourceIOS::Add(BrowserState* browser_state,
14 URLDataSourceIOS* source) {
15 URLDataManagerIOS::AddDataSource(browser_state, source);
18 bool URLDataSourceIOS::ShouldReplaceExistingSource() const {
19 return true;
22 bool URLDataSourceIOS::AllowCaching() const {
23 return true;
26 std::string URLDataSourceIOS::GetContentSecurityPolicyObjectSrc() const {
27 return "object-src 'none';";
30 bool URLDataSourceIOS::ShouldDenyXFrameOptions() const {
31 return true;
34 bool URLDataSourceIOS::ShouldServiceRequest(
35 const net::URLRequest* request) const {
36 if (GetWebClient()->IsAppSpecificURL(request->url()))
37 return true;
38 return false;
41 } // namespace web