c643382abf294526cef6abddb8e28266d8e6b486
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / manifest_handlers / navigation_handler.h
1 // Copyright (c) 2014 Intel Corporation. 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.
4 #ifndef XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_NAVIGATION_HANDLER_H_
5 #define XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_NAVIGATION_HANDLER_H_
6
7 #include <string>
8 #include <vector>
9
10 #include "base/strings/string_split.h"
11 #include "xwalk/application/common/application_data.h"
12 #include "xwalk/application/common/manifest_handler.h"
13
14 namespace xwalk {
15 namespace application {
16
17 class NavigationInfo : public ApplicationData::ManifestData {
18  public:
19   explicit NavigationInfo(const std::string& allowed_domains);
20   virtual ~NavigationInfo();
21
22   const std::vector<std::string>& GetAllowedDomains() const {
23     return allowed_domains_; }
24
25  private:
26   std::vector<std::string> allowed_domains_;
27 };
28
29 class NavigationHandler : public ManifestHandler {
30  public:
31   NavigationHandler();
32   virtual ~NavigationHandler();
33
34   virtual bool Parse(scoped_refptr<ApplicationData> application_data,
35                      base::string16* error) OVERRIDE;
36   virtual std::vector<std::string> Keys() const OVERRIDE;
37
38  private:
39   DISALLOW_COPY_AND_ASSIGN(NavigationHandler);
40 };
41
42 }  // namespace application
43 }  // namespace xwalk
44
45 #endif  // XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_NAVIGATION_HANDLER_H_