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 #include "chrome/browser/content_settings/content_settings_default_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_default_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 namespace { | 68 namespace { |
69 | 69 |
70 class DefaultRuleIterator : public RuleIterator { | 70 class DefaultRuleIterator : public RuleIterator { |
71 public: | 71 public: |
72 explicit DefaultRuleIterator(const base::Value* value) { | 72 explicit DefaultRuleIterator(const base::Value* value) { |
73 if (value) | 73 if (value) |
74 value_.reset(value->DeepCopy()); | 74 value_.reset(value->DeepCopy()); |
75 } | 75 } |
76 | 76 |
77 virtual bool HasNext() const override { | 77 bool HasNext() const override { return value_.get() != NULL; } |
78 return value_.get() != NULL; | |
79 } | |
80 | 78 |
81 virtual Rule Next() override { | 79 Rule Next() override { |
82 DCHECK(value_.get()); | 80 DCHECK(value_.get()); |
83 return Rule(ContentSettingsPattern::Wildcard(), | 81 return Rule(ContentSettingsPattern::Wildcard(), |
84 ContentSettingsPattern::Wildcard(), | 82 ContentSettingsPattern::Wildcard(), |
85 value_.release()); | 83 value_.release()); |
86 } | 84 } |
87 | 85 |
88 private: | 86 private: |
89 scoped_ptr<base::Value> value_; | 87 scoped_ptr<base::Value> value_; |
90 }; | 88 }; |
91 | 89 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // Migrate obsolete cookie prompt mode. | 334 // Migrate obsolete cookie prompt mode. |
337 if (ValueToContentSetting( | 335 if (ValueToContentSetting( |
338 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == | 336 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == |
339 CONTENT_SETTING_ASK) { | 337 CONTENT_SETTING_ASK) { |
340 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( | 338 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( |
341 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); | 339 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); |
342 } | 340 } |
343 } | 341 } |
344 | 342 |
345 } // namespace content_settings | 343 } // namespace content_settings |
OLD | NEW |