OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/bookmarks/bookmark_drag_data.h" | 5 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
6 | 6 |
7 // TODO(port): Port this file. | 7 // TODO(port): Port this file. |
8 #if defined(TOOLKIT_VIEWS) | 8 #if defined(TOOLKIT_VIEWS) |
9 #include "app/os_exchange_data.h" | 9 #include "app/os_exchange_data.h" |
10 #else | 10 #else |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 Element element; | 125 Element element; |
126 if (data.GetURLAndTitle(&element.url, &element.title) && | 126 if (data.GetURLAndTitle(&element.url, &element.title) && |
127 element.url.is_valid()) { | 127 element.url.is_valid()) { |
128 element.is_url = true; | 128 element.is_url = true; |
129 elements.push_back(element); | 129 elements.push_back(element); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 return is_valid(); | 133 return is_valid(); |
134 } | 134 } |
| 135 #elif defined(TOOLKIT_VIEWS) |
| 136 void BookmarkDragData::Write(Profile* profile, OSExchangeData* data) const { |
| 137 NOTIMPLEMENTED(); |
| 138 } |
| 139 |
| 140 bool BookmarkDragData::Read(const OSExchangeData& data) { |
| 141 NOTIMPLEMENTED(); |
| 142 return false; |
| 143 } |
135 #endif | 144 #endif |
136 | 145 |
137 void BookmarkDragData::WriteToPickle(Profile* profile, Pickle* pickle) const { | 146 void BookmarkDragData::WriteToPickle(Profile* profile, Pickle* pickle) const { |
138 #if defined(WCHAR_T_IS_UTF16) | 147 #if defined(WCHAR_T_IS_UTF16) |
139 pickle->WriteWString( | 148 pickle->WriteWString( |
140 profile ? profile->GetPath().ToWStringHack() : std::wstring()); | 149 profile ? profile->GetPath().ToWStringHack() : std::wstring()); |
141 #elif defined(WCHAR_T_IS_UTF32) | 150 #elif defined(WCHAR_T_IS_UTF32) |
142 pickle->WriteString( | 151 pickle->WriteString( |
143 profile ? profile->GetPath().value() : std::string()); | 152 profile ? profile->GetPath().value() : std::string()); |
144 #else | 153 #else |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 210 |
202 bool BookmarkDragData::IsFromProfile(Profile* profile) const { | 211 bool BookmarkDragData::IsFromProfile(Profile* profile) const { |
203 // An empty path means the data is not associated with any profile. | 212 // An empty path means the data is not associated with any profile. |
204 return (!profile_path_.empty() && | 213 return (!profile_path_.empty() && |
205 #if defined(WCHAR_T_IS_UTF16) | 214 #if defined(WCHAR_T_IS_UTF16) |
206 profile->GetPath().ToWStringHack() == profile_path_); | 215 profile->GetPath().ToWStringHack() == profile_path_); |
207 #elif defined(WCHAR_T_IS_UTF32) | 216 #elif defined(WCHAR_T_IS_UTF32) |
208 profile->GetPath().value() == profile_path_); | 217 profile->GetPath().value() == profile_path_); |
209 #endif | 218 #endif |
210 } | 219 } |
OLD | NEW |