summaryrefslogtreecommitdiffstats
path: root/chrome/browser/pref_member.h
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 01:22:46 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 01:22:46 +0000
commit4b392ef1066efa731dc564245228fc210d213b2f (patch)
tree6cac0cffbd92b05bd4b4cfe596755deaf958beee /chrome/browser/pref_member.h
parent799c948c822e04651c049e364145dc16e3a7135b (diff)
downloadchromium_src-4b392ef1066efa731dc564245228fc210d213b2f.zip
chromium_src-4b392ef1066efa731dc564245228fc210d213b2f.tar.gz
chromium_src-4b392ef1066efa731dc564245228fc210d213b2f.tar.bz2
Introduce FilePathPrefMember so we can get rid of some FromWString conversions.
BUG=24672 TEST=download a file and verify that works as before. Patch from Thiago Farina <thiago.farina@gmail.com> Review URL: http://codereview.chromium.org/1646015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/pref_member.h')
-rw-r--r--chrome/browser/pref_member.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/pref_member.h b/chrome/browser/pref_member.h
index 6f7bffb..d71bcd0 100644
--- a/chrome/browser/pref_member.h
+++ b/chrome/browser/pref_member.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
//
-// A helper class that stays in sync with a preference (bool, int, real, or
-// string). For example:
+// A helper class that stays in sync with a preference (bool, int, real,
+// string or filepath). For example:
//
// class MyClass {
// public:
@@ -27,6 +27,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/file_path.h"
#include "chrome/common/notification_observer.h"
class PrefService;
@@ -173,4 +174,17 @@ class StringPrefMember : public PrefMember<std::wstring> {
DISALLOW_COPY_AND_ASSIGN(StringPrefMember);
};
+class FilePathPrefMember : public PrefMember<FilePath> {
+ public:
+ FilePathPrefMember() : PrefMember<FilePath>() { }
+ virtual ~FilePathPrefMember() { }
+
+ protected:
+ virtual void UpdateValueFromPref();
+ virtual void UpdatePref(const FilePath& value);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FilePathPrefMember);
+};
+
#endif // CHROME_BROWSER_PREF_MEMBER_H_