summaryrefslogtreecommitdiffstats
path: root/base/file_path.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 01:17:26 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 01:17:26 +0000
commit44ec9b3b965335d661a144e11894da3cea999bf3 (patch)
tree549ce1740dda62e2014a75a7f3a6cff430dde45e /base/file_path.cc
parent993e6ea820a8b71c8f7767822de3b66bd2bb3c6f (diff)
downloadchromium_src-44ec9b3b965335d661a144e11894da3cea999bf3.zip
chromium_src-44ec9b3b965335d661a144e11894da3cea999bf3.tar.gz
chromium_src-44ec9b3b965335d661a144e11894da3cea999bf3.tar.bz2
Support reordering of Browser Actions within the container. Currently does not support dragging to/from the chevron menu.
Also fixed two bugs in the same code: - the container would be 0 width if a value for it hasn't been saved (part of bug 32101). - the default icon was not used when a tab specific icon was not found (bug 34317). BUG=http://crbug.com/26990, http://crbug.com/32101, http://crbug.com/34317 TEST=In both LTR and RTL locale, try reordering the browser actions and make sure to test dragging to the ends with and without a chevron visible. Install Send to Gmail extension and make sure it has an icon while in the overflow menu. Review URL: http://codereview.chromium.org/549224 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.cc')
-rw-r--r--base/file_path.cc40
1 files changed, 39 insertions, 1 deletions
diff --git a/base/file_path.cc b/base/file_path.cc
index dde8ae1..d1a6371 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 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.
@@ -9,6 +9,7 @@
#endif
#include "base/logging.h"
+#include "base/pickle.h"
// These includes are just for the *Hack functions, and should be removed
// when those functions are removed.
@@ -1051,6 +1052,43 @@ FilePath FilePath::StripTrailingSeparators() const {
return new_path;
}
+// static.
+void FilePath::WriteStringTypeToPickle(Pickle* pickle,
+ const FilePath::StringType& path) {
+#if defined(WCHAR_T_IS_UTF16)
+ pickle->WriteWString(path);
+#elif defined(WCHAR_T_IS_UTF32)
+ pickle->WriteString(path);
+#else
+ NOTIMPLEMENTED() << "Impossible encoding situation!";
+#endif
+}
+
+// static.
+bool FilePath::ReadStringTypeFromPickle(Pickle* pickle, void** iter,
+ FilePath::StringType* path) {
+#if defined(WCHAR_T_IS_UTF16)
+ if (!pickle->ReadWString(iter, path))
+ return false;
+#elif defined(WCHAR_T_IS_UTF32)
+ if (!pickle->ReadString(iter, path))
+ return false;
+#else
+ NOTIMPLEMENTED() << "Impossible encoding situation!";
+ return false;
+#endif
+
+ return true;
+}
+
+void FilePath::WriteToPickle(Pickle* pickle) {
+ WriteStringTypeToPickle(pickle, value());
+}
+
+bool FilePath::ReadFromPickle(Pickle* pickle, void** iter) {
+ return ReadStringTypeFromPickle(pickle, iter, &path_);
+}
+
void FilePath::StripTrailingSeparatorsInternal() {
// If there is no drive letter, start will be 1, which will prevent stripping
// the leading separator if there is only one separator. If there is a drive