| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ |
| 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "chrome/common/extensions/extension_resource.h" | 15 #include "extensions/common/extension_resource.h" |
| 16 | 16 |
| 17 class ExtensionServiceInterface; | 17 class ExtensionServiceInterface; |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class DictionaryValue; | 21 class DictionaryValue; |
| 22 class ListValue; | 22 class ListValue; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace extensions { | 25 namespace extensions { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 // A list of URL patterns that should be whitelisted for the site. | 53 // A list of URL patterns that should be whitelisted for the site. |
| 54 std::vector<std::string> patterns; | 54 std::vector<std::string> patterns; |
| 55 | 55 |
| 56 // A list of SHA1 hashes of hostnames that should be whitelisted | 56 // A list of SHA1 hashes of hostnames that should be whitelisted |
| 57 // for the site. | 57 // for the site. |
| 58 std::vector<std::string> hostname_hashes; | 58 std::vector<std::string> hostname_hashes; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 ManagedModeSiteList(const std::string& extension_id, | 61 ManagedModeSiteList(const std::string& extension_id, |
| 62 const ExtensionResource& path); | 62 const extensions::ExtensionResource& path); |
| 63 ~ManagedModeSiteList(); | 63 ~ManagedModeSiteList(); |
| 64 | 64 |
| 65 // Creates a copy of the site list. | 65 // Creates a copy of the site list. |
| 66 // Caller takes ownership of the returned value. | 66 // Caller takes ownership of the returned value. |
| 67 ManagedModeSiteList* Clone(); | 67 ManagedModeSiteList* Clone(); |
| 68 | 68 |
| 69 // Returns a list of all categories. | 69 // Returns a list of all categories. |
| 70 // TODO(bauerb): The list is hardcoded for now, but if we allow custom | 70 // TODO(bauerb): The list is hardcoded for now, but if we allow custom |
| 71 // categories, this should live in some registry. | 71 // categories, this should live in some registry. |
| 72 static void GetCategoryNames(std::vector<string16>* categories); | 72 static void GetCategoryNames(std::vector<string16>* categories); |
| 73 | 73 |
| 74 // Returns a list of all sites in this site list. | 74 // Returns a list of all sites in this site list. |
| 75 void GetSites(std::vector<Site>* sites); | 75 void GetSites(std::vector<Site>* sites); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 bool LazyLoad(); | 78 bool LazyLoad(); |
| 79 void CopyThumbnailUrl(const base::DictionaryValue* source, | 79 void CopyThumbnailUrl(const base::DictionaryValue* source, |
| 80 base::DictionaryValue* dest); | 80 base::DictionaryValue* dest); |
| 81 | 81 |
| 82 std::string extension_id_; | 82 std::string extension_id_; |
| 83 ExtensionResource path_; | 83 extensions::ExtensionResource path_; |
| 84 scoped_ptr<base::DictionaryValue> categories_; | 84 scoped_ptr<base::DictionaryValue> categories_; |
| 85 scoped_ptr<base::ListValue> sites_; | 85 scoped_ptr<base::ListValue> sites_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(ManagedModeSiteList); | 87 DISALLOW_COPY_AND_ASSIGN(ManagedModeSiteList); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ | 90 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_SITE_LIST_H_ |
| OLD | NEW |