Chromium Code Reviews| 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_POLICY_POLICY_BUNDLE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_POLICY_BUNDLE_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_BUNDLE_H_ | 6 #define CHROME_BROWSER_POLICY_POLICY_BUNDLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 void CopyFrom(const PolicyBundle& other); | 42 void CopyFrom(const PolicyBundle& other); |
| 43 | 43 |
| 44 // Merges the PolicyMaps of |this| with those of |other| for each namespace | 44 // Merges the PolicyMaps of |this| with those of |other| for each namespace |
| 45 // in common. Also adds copies of the (namespace, PolicyMap) pairs in |other| | 45 // in common. Also adds copies of the (namespace, PolicyMap) pairs in |other| |
| 46 // that don't have an entry in |this|. | 46 // that don't have an entry in |this|. |
| 47 // Each policy in each PolicyMap is replaced only if the policy from |other| | 47 // Each policy in each PolicyMap is replaced only if the policy from |other| |
| 48 // has a higher priority. | 48 // has a higher priority. |
| 49 // See PolicyMap::MergeFrom for details on merging individual PolicyMaps. | 49 // See PolicyMap::MergeFrom for details on merging individual PolicyMaps. |
| 50 void MergeFrom(const PolicyBundle& other); | 50 void MergeFrom(const PolicyBundle& other); |
| 51 | 51 |
| 52 // Returns true if |other| has the same keys and value as |this|. | |
| 53 bool Equals(const PolicyBundle& other) const; | |
| 54 | |
| 52 // Returns iterators to the beginning and end of the underlying container. | 55 // Returns iterators to the beginning and end of the underlying container. |
| 53 // These can be used to iterate over and read the PolicyMaps, but not to | 56 // These can be used to iterate over and read the PolicyMaps, but not to |
| 54 // modify them. | 57 // modify them. |
| 55 const_iterator begin() const; | 58 const_iterator begin() const; |
| 56 const_iterator end() const; | 59 const_iterator end() const; |
| 57 | 60 |
| 58 // Erases all the existing pairs. | 61 // Erases all the existing pairs. |
| 59 void Clear(); | 62 void Clear(); |
| 60 | 63 |
| 64 // XXX TODO: remove | |
|
Mattias Nissler (ping if slow)
2012/05/14 16:55:59
so?
Joao da Silva
2012/05/15 13:07:05
omgwtfbbq
| |
| 65 void Dump() const; | |
| 66 | |
| 61 private: | 67 private: |
| 62 MapType policy_bundle_; | 68 MapType policy_bundle_; |
| 63 | 69 |
| 64 // An empty PolicyMap that is returned by const Get() for namespaces that | 70 // An empty PolicyMap that is returned by const Get() for namespaces that |
| 65 // do not exist in |policy_bundle_|. | 71 // do not exist in |policy_bundle_|. |
| 66 const PolicyMap kEmpty_; | 72 const PolicyMap kEmpty_; |
| 67 | 73 |
| 68 DISALLOW_COPY_AND_ASSIGN(PolicyBundle); | 74 DISALLOW_COPY_AND_ASSIGN(PolicyBundle); |
| 69 }; | 75 }; |
| 70 | 76 |
| 71 } // namespace policy | 77 } // namespace policy |
| 72 | 78 |
| 73 #endif // CHROME_BROWSER_POLICY_POLICY_BUNDLE_H_ | 79 #endif // CHROME_BROWSER_POLICY_POLICY_BUNDLE_H_ |
| OLD | NEW |