Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: components/content_settings/core/browser/website_settings_info.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/content_settings/core/browser/website_settings_info.h" 5 #include "components/content_settings/core/browser/website_settings_info.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 30 matching lines...) Expand all
41 default_value_pref_name_(GetPrefName(name, kDefaultPrefPrefix)), 41 default_value_pref_name_(GetPrefName(name, kDefaultPrefPrefix)),
42 initial_default_value_(std::move(initial_default_value)), 42 initial_default_value_(std::move(initial_default_value)),
43 sync_status_(sync_status), 43 sync_status_(sync_status),
44 lossy_status_(lossy_status), 44 lossy_status_(lossy_status),
45 scoping_type_(scoping_type), 45 scoping_type_(scoping_type),
46 incognito_behavior_(incognito_behavior) { 46 incognito_behavior_(incognito_behavior) {
47 // For legacy reasons the default value is currently restricted to be an int. 47 // For legacy reasons the default value is currently restricted to be an int.
48 // TODO(raymes): We should migrate the underlying pref to be a dictionary 48 // TODO(raymes): We should migrate the underlying pref to be a dictionary
49 // rather than an int. 49 // rather than an int.
50 DCHECK(!initial_default_value_ || 50 DCHECK(!initial_default_value_ ||
51 initial_default_value_->IsType(base::Value::TYPE_INTEGER)); 51 initial_default_value_->IsType(base::Value::Type::INTEGER));
52 } 52 }
53 53
54 WebsiteSettingsInfo::~WebsiteSettingsInfo() {} 54 WebsiteSettingsInfo::~WebsiteSettingsInfo() {}
55 55
56 uint32_t WebsiteSettingsInfo::GetPrefRegistrationFlags() const { 56 uint32_t WebsiteSettingsInfo::GetPrefRegistrationFlags() const {
57 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; 57 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS;
58 58
59 if (sync_status_ == SYNCABLE) 59 if (sync_status_ == SYNCABLE)
60 flags |= user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; 60 flags |= user_prefs::PrefRegistrySyncable::SYNCABLE_PREF;
61 61
62 if (lossy_status_ == LOSSY) 62 if (lossy_status_ == LOSSY)
63 flags |= PrefRegistry::LOSSY_PREF; 63 flags |= PrefRegistry::LOSSY_PREF;
64 64
65 return flags; 65 return flags;
66 } 66 }
67 67
68 } // namespace content_settings 68 } // namespace content_settings
OLDNEW
« no previous file with comments | « components/content_settings/core/browser/content_settings_pref.cc ('k') | components/dom_distiller/core/distiller_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698