OLD | NEW |
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_NODE_DATA_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_DATA_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_DATA_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Typical usage to read is: | 52 // Typical usage to read is: |
53 // BookmarkNodeData data; | 53 // BookmarkNodeData data; |
54 // if (data.Read(os_exchange_data)) | 54 // if (data.Read(os_exchange_data)) |
55 // // data is valid, contents are in elements. | 55 // // data is valid, contents are in elements. |
56 | 56 |
57 struct BookmarkNodeData { | 57 struct BookmarkNodeData { |
58 // Element represents a single node. | 58 // Element represents a single node. |
59 struct Element { | 59 struct Element { |
60 Element(); | 60 Element(); |
61 explicit Element(const BookmarkNode* node); | 61 explicit Element(const BookmarkNode* node); |
| 62 Element(const Element& other); |
62 ~Element(); | 63 ~Element(); |
63 | 64 |
64 // If true, this element represents a URL. | 65 // If true, this element represents a URL. |
65 bool is_url; | 66 bool is_url; |
66 | 67 |
67 // The URL, only valid if is_url is true. | 68 // The URL, only valid if is_url is true. |
68 GURL url; | 69 GURL url; |
69 | 70 |
70 // Title of the entry, used for both urls and folders. | 71 // Title of the entry, used for both urls and folders. |
71 base::string16 title; | 72 base::string16 title; |
(...skipping 20 matching lines...) Expand all Loading... |
92 bool ReadFromPickle(base::PickleIterator* iterator); | 93 bool ReadFromPickle(base::PickleIterator* iterator); |
93 | 94 |
94 // ID of the node. | 95 // ID of the node. |
95 int64_t id_; | 96 int64_t id_; |
96 }; | 97 }; |
97 | 98 |
98 // The MIME type for the clipboard format for BookmarkNodeData. | 99 // The MIME type for the clipboard format for BookmarkNodeData. |
99 static const char kClipboardFormatString[]; | 100 static const char kClipboardFormatString[]; |
100 | 101 |
101 BookmarkNodeData(); | 102 BookmarkNodeData(); |
| 103 BookmarkNodeData(const BookmarkNodeData& other); |
102 | 104 |
103 // Created a BookmarkNodeData populated from the arguments. | 105 // Created a BookmarkNodeData populated from the arguments. |
104 explicit BookmarkNodeData(const BookmarkNode* node); | 106 explicit BookmarkNodeData(const BookmarkNode* node); |
105 explicit BookmarkNodeData(const std::vector<const BookmarkNode*>& nodes); | 107 explicit BookmarkNodeData(const std::vector<const BookmarkNode*>& nodes); |
106 | 108 |
107 ~BookmarkNodeData(); | 109 ~BookmarkNodeData(); |
108 | 110 |
109 #if defined(TOOLKIT_VIEWS) | 111 #if defined(TOOLKIT_VIEWS) |
110 static const ui::Clipboard::FormatType& GetBookmarkFormatType(); | 112 static const ui::Clipboard::FormatType& GetBookmarkFormatType(); |
111 #endif | 113 #endif |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 std::vector<Element> elements; | 184 std::vector<Element> elements; |
183 | 185 |
184 private: | 186 private: |
185 // Path of the profile we originated from. | 187 // Path of the profile we originated from. |
186 base::FilePath profile_path_; | 188 base::FilePath profile_path_; |
187 }; | 189 }; |
188 | 190 |
189 } // namespace bookmarks | 191 } // namespace bookmarks |
190 | 192 |
191 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_DATA_H_ | 193 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_DATA_H_ |
OLD | NEW |