Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: components/bookmarks/browser/bookmark_pasteboard_helper_mac.h

Issue 1854223002: mac: Fix bookmark drag and drop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp37_dnd
Patch Set: Fix memory leak. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
7 7
8 #include "components/bookmarks/browser/bookmark_node_data.h" 8 #include "components/bookmarks/browser/bookmark_node_data.h"
9 9
10 #if defined(__OBJC__) 10 #if defined(__OBJC__)
11 @class NSPasteboardItem;
11 @class NSString; 12 @class NSString;
12 #endif // __OBJC__ 13 #endif // __OBJC__
13 14
14 namespace base { 15 namespace base {
15 class FilePath; 16 class FilePath;
16 } 17 }
17 18
18 namespace bookmarks { 19 namespace bookmarks {
19 20
20 // This set of functions lets C++ code interact with the cocoa pasteboard and 21 // This set of functions lets C++ code interact with the cocoa pasteboard and
21 // dragging methods. 22 // dragging methods.
22 23
24 #if defined(__OBJC__)
25 // Creates a NSPasteboardItem that contains all the data for the bookmarks.
26 NSPasteboardItem* PasteboardItemFromBookmarks(
27 const std::vector<BookmarkNodeData::Element>& elements,
28 const base::FilePath& profile_path);
29 #endif // __OBJC__
30
23 // Writes a set of bookmark elements from a profile to the specified pasteboard. 31 // Writes a set of bookmark elements from a profile to the specified pasteboard.
24 void WriteBookmarksToPasteboard( 32 void WriteBookmarksToPasteboard(
25 ui::ClipboardType type, 33 ui::ClipboardType type,
26 const std::vector<BookmarkNodeData::Element>& elements, 34 const std::vector<BookmarkNodeData::Element>& elements,
27 const base::FilePath& profile_path); 35 const base::FilePath& profile_path);
28 36
29 // Reads a set of bookmark elements from the specified pasteboard. 37 // Reads a set of bookmark elements from the specified pasteboard.
30 bool ReadBookmarksFromPasteboard( 38 bool ReadBookmarksFromPasteboard(
31 ui::ClipboardType type, 39 ui::ClipboardType type,
32 std::vector<BookmarkNodeData::Element>& elements, 40 std::vector<BookmarkNodeData::Element>& elements,
33 base::FilePath* profile_path); 41 base::FilePath* profile_path);
34 42
35 // Returns true if the specified pasteboard contains any sort of bookmark 43 // Returns true if the specified pasteboard contains any sort of bookmark
36 // elements. It currently does not consider a plaintext url a valid bookmark. 44 // elements. It currently does not consider a plaintext url a valid bookmark.
37 bool PasteboardContainsBookmarks(ui::ClipboardType type); 45 bool PasteboardContainsBookmarks(ui::ClipboardType type);
38 46
39 } // namespace bookmarks 47 } // namespace bookmarks
40 48
41 #if defined(__OBJC__) 49 #if defined(__OBJC__)
42 // Pasteboard type for dictionary containing bookmark structure consisting 50 // Pasteboard type for dictionary containing bookmark structure consisting
43 // of individual bookmark nodes and/or bookmark folders. 51 // of individual bookmark nodes and/or bookmark folders.
44 extern "C" NSString* const kBookmarkDictionaryListPboardType; 52 extern "C" NSString* const kBookmarkDictionaryListPboardType;
45 #endif // __OBJC__ 53 #endif // __OBJC__
46 54
47 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ 55 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698