Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / browser / webui / shared_resources_data_source.h
blob5c300ef68ec3c34cf0b32a16989ab163944622ef
1 // Copyright (c) 2011 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 CONTENT_BROWSER_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_
6 #define CONTENT_BROWSER_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/url_data_source.h"
12 namespace content {
14 // A DataSource for chrome://resources/ URLs.
15 class SharedResourcesDataSource : public URLDataSource {
16 public:
17 SharedResourcesDataSource();
19 // URLDataSource implementation.
20 std::string GetSource() const override;
21 void StartDataRequest(
22 const std::string& path,
23 int render_process_id,
24 int render_frame_id,
25 const URLDataSource::GotDataCallback& callback) override;
26 std::string GetMimeType(const std::string&) const override;
27 std::string GetAccessControlAllowOriginForOrigin(
28 const std::string& origin) const override;
30 private:
31 ~SharedResourcesDataSource() override;
33 DISALLOW_COPY_AND_ASSIGN(SharedResourcesDataSource);
36 } // namespace content
38 #endif // CONTENT_BROWSER_WEBUI_SHARED_RESOURCES_DATA_SOURCE_H_