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/prefs/session_startup_pref.h" | 5 #include "chrome/browser/prefs/session_startup_pref.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/prefs/pref_service.h" | |
12 #include "base/prefs/scoped_user_pref_update.h" | |
13 #include "base/values.h" | 11 #include "base/values.h" |
14 #include "build/build_config.h" | 12 #include "build/build_config.h" |
15 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
17 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
| 16 #include "components/prefs/pref_service.h" |
| 17 #include "components/prefs/scoped_user_pref_update.h" |
18 #include "components/url_formatter/url_fixer.h" | 18 #include "components/url_formatter/url_fixer.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Converts a SessionStartupPref::Type to an integer written to prefs. | 22 // Converts a SessionStartupPref::Type to an integer written to prefs. |
23 int TypeToPrefValue(SessionStartupPref::Type type) { | 23 int TypeToPrefValue(SessionStartupPref::Type type) { |
24 switch (type) { | 24 switch (type) { |
25 case SessionStartupPref::LAST: return SessionStartupPref::kPrefValueLast; | 25 case SessionStartupPref::LAST: return SessionStartupPref::kPrefValueLast; |
26 case SessionStartupPref::URLS: return SessionStartupPref::kPrefValueURLs; | 26 case SessionStartupPref::URLS: return SessionStartupPref::kPrefValueURLs; |
27 default: return SessionStartupPref::kPrefValueNewTab; | 27 default: return SessionStartupPref::kPrefValueNewTab; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 switch (pref_value) { | 146 switch (pref_value) { |
147 case kPrefValueLast: return SessionStartupPref::LAST; | 147 case kPrefValueLast: return SessionStartupPref::LAST; |
148 case kPrefValueURLs: return SessionStartupPref::URLS; | 148 case kPrefValueURLs: return SessionStartupPref::URLS; |
149 default: return SessionStartupPref::DEFAULT; | 149 default: return SessionStartupPref::DEFAULT; |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} | 153 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} |
154 | 154 |
155 SessionStartupPref::~SessionStartupPref() {} | 155 SessionStartupPref::~SessionStartupPref() {} |
OLD | NEW |