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