| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/extensions/csp_parser.h" | 5 #include "chrome/browser/extensions/csp_parser.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/extensions/csp_handler.h" | 9 #include "chrome/common/extensions/csp_handler.h" |
| 10 #include "chrome/common/extensions/manifest_handlers/sandboxed_page_info.h" |
| 10 | 11 |
| 11 namespace extensions { | 12 namespace extensions { |
| 12 | 13 |
| 13 CSPParser::CSPParser(Profile* profile) { | 14 CSPParser::CSPParser(Profile* profile) { |
| 14 (new CSPHandler(false))->Register(); // platform app. | 15 (new CSPHandler(false))->Register(); // not platform app. |
| 15 (new CSPHandler(true))->Register(); // platform app. | 16 (new CSPHandler(true))->Register(); // platform app. |
| 17 (new SandboxedPageHandler)->Register(); |
| 16 } | 18 } |
| 17 | 19 |
| 18 CSPParser::~CSPParser() { | 20 CSPParser::~CSPParser() { |
| 19 } | 21 } |
| 20 | 22 |
| 21 static base::LazyInstance<ProfileKeyedAPIFactory<CSPParser> > | 23 static base::LazyInstance<ProfileKeyedAPIFactory<CSPParser> > |
| 22 g_factory = LAZY_INSTANCE_INITIALIZER; | 24 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 23 | 25 |
| 24 // static | 26 // static |
| 25 ProfileKeyedAPIFactory<CSPParser>* CSPParser::GetFactoryInstance() { | 27 ProfileKeyedAPIFactory<CSPParser>* CSPParser::GetFactoryInstance() { |
| 26 return &g_factory.Get(); | 28 return &g_factory.Get(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 } // namespace extensions | 31 } // namespace extensions |
| OLD | NEW |