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/protector/base_setting_change.h" | 5 #include "chrome/browser/protector/base_setting_change.h" |
6 #include "chrome/browser/protector/composite_settings_change.h" | 6 #include "chrome/browser/protector/composite_settings_change.h" |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 namespace protector { | 10 namespace protector { |
(...skipping 21 matching lines...) Expand all Loading... |
32 composite_change->MergeWith(other); | 32 composite_change->MergeWith(other); |
33 return composite_change; | 33 return composite_change; |
34 } | 34 } |
35 | 35 |
36 bool BaseSettingChange::Contains(const BaseSettingChange* other) const { | 36 bool BaseSettingChange::Contains(const BaseSettingChange* other) const { |
37 // BaseSettingChange can only contain itself. | 37 // BaseSettingChange can only contain itself. |
38 return this == other; | 38 return this == other; |
39 } | 39 } |
40 | 40 |
41 bool BaseSettingChange::Init(Profile* profile) { | 41 bool BaseSettingChange::Init(Profile* profile) { |
42 DCHECK(profile); | 42 DCHECK(profile && !profile_); |
43 profile_ = profile; | 43 profile_ = profile; |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
| 47 void BaseSettingChange::InitWhenDisabled(Profile* profile) { |
| 48 DCHECK(profile && !profile_); |
| 49 } |
| 50 |
47 void BaseSettingChange::Apply(Browser* browser) { | 51 void BaseSettingChange::Apply(Browser* browser) { |
48 } | 52 } |
49 | 53 |
50 void BaseSettingChange::Discard(Browser* browser) { | 54 void BaseSettingChange::Discard(Browser* browser) { |
51 } | 55 } |
52 | 56 |
53 void BaseSettingChange::Timeout() { | 57 void BaseSettingChange::Timeout() { |
54 } | 58 } |
55 | 59 |
56 BaseSettingChange::DisplayName BaseSettingChange::GetApplyDisplayName() const { | 60 BaseSettingChange::DisplayName BaseSettingChange::GetApplyDisplayName() const { |
57 return DisplayName(kDefaultNamePriority, string16()); | 61 return DisplayName(kDefaultNamePriority, string16()); |
58 } | 62 } |
59 | 63 |
60 GURL BaseSettingChange::GetNewSettingURL() const { | 64 GURL BaseSettingChange::GetNewSettingURL() const { |
61 return GURL(); | 65 return GURL(); |
62 } | 66 } |
63 | 67 |
64 bool BaseSettingChange::CanBeMerged() const { | 68 bool BaseSettingChange::CanBeMerged() const { |
65 // By default change can be collapsed if it has a non-empty keyword. | 69 // By default change can be collapsed if it has a non-empty keyword. |
66 return !GetNewSettingURL().is_empty(); | 70 return !GetNewSettingURL().is_empty(); |
67 } | 71 } |
68 | 72 |
69 } // namespace protector | 73 } // namespace protector |
OLD | NEW |