| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 namespace { | 63 namespace { |
| 64 | 64 |
| 65 class DefaultRuleIterator : public RuleIterator { | 65 class DefaultRuleIterator : public RuleIterator { |
| 66 public: | 66 public: |
| 67 explicit DefaultRuleIterator(const base::Value* value) { | 67 explicit DefaultRuleIterator(const base::Value* value) { |
| 68 if (value) | 68 if (value) |
| 69 value_.reset(value->DeepCopy()); | 69 value_.reset(value->DeepCopy()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool HasNext() const { | 72 virtual bool HasNext() const OVERRIDE { |
| 73 return value_.get() != NULL; | 73 return value_.get() != NULL; |
| 74 } | 74 } |
| 75 | 75 |
| 76 Rule Next() { | 76 virtual Rule Next() OVERRIDE { |
| 77 DCHECK(value_.get()); | 77 DCHECK(value_.get()); |
| 78 return Rule(ContentSettingsPattern::Wildcard(), | 78 return Rule(ContentSettingsPattern::Wildcard(), |
| 79 ContentSettingsPattern::Wildcard(), | 79 ContentSettingsPattern::Wildcard(), |
| 80 value_.release()); | 80 value_.release()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 scoped_ptr<base::Value> value_; | 84 scoped_ptr<base::Value> value_; |
| 85 }; | 85 }; |
| 86 | 86 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // Migrate obsolete cookie prompt mode. | 325 // Migrate obsolete cookie prompt mode. |
| 326 if (ValueToContentSetting( | 326 if (ValueToContentSetting( |
| 327 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == | 327 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == |
| 328 CONTENT_SETTING_ASK) { | 328 CONTENT_SETTING_ASK) { |
| 329 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( | 329 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( |
| 330 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); | 330 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace content_settings | 334 } // namespace content_settings |
| OLD | NEW |