Chromium Code Reviews| 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 // A helper class that stays in sync with a preference (bool, int, real, | 5 // A helper class that stays in sync with a preference (bool, int, real, |
| 6 // string or filepath). For example: | 6 // string or filepath). For example: |
| 7 // | 7 // |
| 8 // class MyClass { | 8 // class MyClass { |
| 9 // public: | 9 // public: |
| 10 // MyClass(PrefService* prefs) { | 10 // MyClass(PrefService* prefs) { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 | 281 |
| 282 mutable scoped_refptr<Internal> internal_; | 282 mutable scoped_refptr<Internal> internal_; |
| 283 | 283 |
| 284 DISALLOW_COPY_AND_ASSIGN(PrefMember); | 284 DISALLOW_COPY_AND_ASSIGN(PrefMember); |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 // Declaration of template specialization need to be repeated here | 287 // Declaration of template specialization need to be repeated here |
| 288 // specifically for each specialization (rather than just once above) | 288 // specifically for each specialization (rather than just once above) |
| 289 // or at least one of our compilers won't be happy in all cases. | 289 // or at least one of our compilers won't be happy in all cases. |
| 290 // Specifically, it was failing on ChromeOS with a complaint about | 290 // Specifically, it was failing on ChromeOS with a complaint about |
| 291 // PrefMember<FilePath>::UpdateValueInternal not being defined when | 291 // PrefMember<base::FilePath>::UpdateValueInternal not being defined when |
|
Mattias Nissler (ping if slow)
2013/02/06 17:53:33
unrelated changes?
Jói
2013/02/07 14:52:32
These were to fix a compilation snafu after a merg
| |
| 292 // built in a chroot with the following parameters: | 292 // built in a chroot with the following parameters: |
| 293 // | 293 // |
| 294 // FEATURES="noclean nostrip" USE="-chrome_debug -chrome_remoting | 294 // FEATURES="noclean nostrip" USE="-chrome_debug -chrome_remoting |
| 295 // -chrome_internal -chrome_pdf component_build" | 295 // -chrome_internal -chrome_pdf component_build" |
| 296 // ~/trunk/goma/goma-wrapper cros_chrome_make --board=${BOARD} | 296 // ~/trunk/goma/goma-wrapper cros_chrome_make --board=${BOARD} |
| 297 // --install --runhooks | 297 // --install --runhooks |
| 298 | 298 |
| 299 template <> | 299 template <> |
| 300 BASE_PREFS_EXPORT void PrefMember<bool>::UpdatePref(const bool& value); | 300 BASE_PREFS_EXPORT void PrefMember<bool>::UpdatePref(const bool& value); |
| 301 | 301 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 319 | 319 |
| 320 template <> | 320 template <> |
| 321 BASE_PREFS_EXPORT void PrefMember<std::string>::UpdatePref( | 321 BASE_PREFS_EXPORT void PrefMember<std::string>::UpdatePref( |
| 322 const std::string& value); | 322 const std::string& value); |
| 323 | 323 |
| 324 template <> | 324 template <> |
| 325 BASE_PREFS_EXPORT bool PrefMember<std::string>::Internal::UpdateValueInternal( | 325 BASE_PREFS_EXPORT bool PrefMember<std::string>::Internal::UpdateValueInternal( |
| 326 const Value& value) const; | 326 const Value& value) const; |
| 327 | 327 |
| 328 template <> | 328 template <> |
| 329 BASE_PREFS_EXPORT void PrefMember<FilePath>::UpdatePref(const FilePath& value); | 329 BASE_PREFS_EXPORT void PrefMember<base::FilePath>::UpdatePref( |
| 330 const base::FilePath& value); | |
| 330 | 331 |
| 331 template <> | 332 template <> |
| 332 BASE_PREFS_EXPORT bool PrefMember<FilePath>::Internal::UpdateValueInternal( | 333 BASE_PREFS_EXPORT bool |
| 334 PrefMember<base::FilePath>::Internal::UpdateValueInternal( | |
| 333 const Value& value) const; | 335 const Value& value) const; |
| 334 | 336 |
| 335 template <> | 337 template <> |
| 336 BASE_PREFS_EXPORT void PrefMember<std::vector<std::string> >::UpdatePref( | 338 BASE_PREFS_EXPORT void PrefMember<std::vector<std::string> >::UpdatePref( |
| 337 const std::vector<std::string>& value); | 339 const std::vector<std::string>& value); |
| 338 | 340 |
| 339 template <> | 341 template <> |
| 340 BASE_PREFS_EXPORT bool | 342 BASE_PREFS_EXPORT bool |
| 341 PrefMember<std::vector<std::string> >::Internal::UpdateValueInternal( | 343 PrefMember<std::vector<std::string> >::Internal::UpdateValueInternal( |
| 342 const Value& value) const; | 344 const Value& value) const; |
| 343 | 345 |
| 344 typedef PrefMember<bool> BooleanPrefMember; | 346 typedef PrefMember<bool> BooleanPrefMember; |
| 345 typedef PrefMember<int> IntegerPrefMember; | 347 typedef PrefMember<int> IntegerPrefMember; |
| 346 typedef PrefMember<double> DoublePrefMember; | 348 typedef PrefMember<double> DoublePrefMember; |
| 347 typedef PrefMember<std::string> StringPrefMember; | 349 typedef PrefMember<std::string> StringPrefMember; |
| 348 typedef PrefMember<FilePath> FilePathPrefMember; | 350 typedef PrefMember<base::FilePath> FilePathPrefMember; |
| 349 // This preference member is expensive for large string arrays. | 351 // This preference member is expensive for large string arrays. |
| 350 typedef PrefMember<std::vector<std::string> > StringListPrefMember; | 352 typedef PrefMember<std::vector<std::string> > StringListPrefMember; |
| 351 | 353 |
| 352 #endif // BASE_PREFS_PUBLIC_PREF_MEMBER_H_ | 354 #endif // BASE_PREFS_PUBLIC_PREF_MEMBER_H_ |
| OLD | NEW |