| 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. |
| 8 #if defined(OS_WIN) |
| 9 #include "app/os_exchange_data.h" |
| 10 #else |
| 11 #include "chrome/common/temp_scaffolding_stubs.h" |
| 12 #endif |
| 7 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 8 #include "base/pickle.h" | 14 #include "base/pickle.h" |
| 9 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 11 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
| 12 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 13 | 19 |
| 14 // TODO(port): Port this file. | |
| 15 #if defined(OS_WIN) | |
| 16 #include "chrome/common/os_exchange_data.h" | |
| 17 #else | |
| 18 #include "chrome/common/temp_scaffolding_stubs.h" | |
| 19 #endif | |
| 20 | 20 |
| 21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 22 static CLIPFORMAT clipboard_format = 0; | 22 static CLIPFORMAT clipboard_format = 0; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 static void RegisterFormat() { | 25 static void RegisterFormat() { |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 if (clipboard_format == 0) { | 27 if (clipboard_format == 0) { |
| 28 clipboard_format = RegisterClipboardFormat(L"chrome/x-bookmark-entries"); | 28 clipboard_format = RegisterClipboardFormat(L"chrome/x-bookmark-entries"); |
| 29 DCHECK(clipboard_format); | 29 DCHECK(clipboard_format); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const { | 183 BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const { |
| 184 std::vector<BookmarkNode*> nodes = GetNodes(profile); | 184 std::vector<BookmarkNode*> nodes = GetNodes(profile); |
| 185 return nodes.size() == 1 ? nodes[0] : NULL; | 185 return nodes.size() == 1 ? nodes[0] : NULL; |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool BookmarkDragData::IsFromProfile(Profile* profile) const { | 188 bool BookmarkDragData::IsFromProfile(Profile* profile) const { |
| 189 // An empty path means the data is not associated with any profile. | 189 // An empty path means the data is not associated with any profile. |
| 190 return (!profile_path_.empty() && | 190 return (!profile_path_.empty() && |
| 191 profile->GetPath().ToWStringHack() == profile_path_); | 191 profile->GetPath().ToWStringHack() == profile_path_); |
| 192 } | 192 } |
| OLD | NEW |