blob: aa6df39f674ce19eefdd5a5cca2896399163a99b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/protector/base_setting_change.h"
#include "chrome/browser/protector/composite_settings_change.h"
#include "base/logging.h"
namespace protector {
const size_t kDefaultSearchProviderChangeNamePriority = 100U;
const size_t kSessionStartupChangeNamePriority = 50U;
const size_t kHomepageChangeNamePriority = 10U;
// static
const size_t BaseSettingChange::kDefaultNamePriority = 0U;
BaseSettingChange::BaseSettingChange()
: profile_(NULL) {
}
BaseSettingChange::~BaseSettingChange() {
}
CompositeSettingsChange* BaseSettingChange::MergeWith(
BaseSettingChange* other) {
CompositeSettingsChange* composite_change = new CompositeSettingsChange();
CHECK(composite_change->Init(profile_));
composite_change->MergeWith(this);
composite_change->MergeWith(other);
return composite_change;
}
bool BaseSettingChange::Contains(const BaseSettingChange* other) const {
// BaseSettingChange can only contain itself.
return this == other;
}
bool BaseSettingChange::Init(Profile* profile) {
DCHECK(profile && !profile_);
profile_ = profile;
return true;
}
void BaseSettingChange::InitWhenDisabled(Profile* profile) {
DCHECK(profile && !profile_);
}
void BaseSettingChange::Apply(Browser* browser) {
}
void BaseSettingChange::Discard(Browser* browser) {
}
void BaseSettingChange::Timeout() {
}
BaseSettingChange::DisplayName BaseSettingChange::GetApplyDisplayName() const {
return DisplayName(kDefaultNamePriority, string16());
}
GURL BaseSettingChange::GetNewSettingURL() const {
return GURL();
}
bool BaseSettingChange::CanBeMerged() const {
// By default change can be collapsed if it has a non-empty keyword.
return !GetNewSettingURL().is_empty();
}
bool BaseSettingChange::IsUserVisible() const {
return true;
}
} // namespace protector
|