| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 explicit Element(const BookmarkNode* node); | 47 explicit Element(const BookmarkNode* node); |
| 48 ~Element(); | 48 ~Element(); |
| 49 | 49 |
| 50 // If true, this element represents a URL. | 50 // If true, this element represents a URL. |
| 51 bool is_url; | 51 bool is_url; |
| 52 | 52 |
| 53 // The URL, only valid if is_url is true. | 53 // The URL, only valid if is_url is true. |
| 54 GURL url; | 54 GURL url; |
| 55 | 55 |
| 56 // Title of the entry, used for both urls and folders. | 56 // Title of the entry, used for both urls and folders. |
| 57 string16 title; | 57 base::string16 title; |
| 58 | 58 |
| 59 // Date of when this node was created. | 59 // Date of when this node was created. |
| 60 base::Time date_added; | 60 base::Time date_added; |
| 61 | 61 |
| 62 // Date of the last modification. Only used for folders. | 62 // Date of the last modification. Only used for folders. |
| 63 base::Time date_folder_modified; | 63 base::Time date_folder_modified; |
| 64 | 64 |
| 65 // Children, only used for non-URL nodes. | 65 // Children, only used for non-URL nodes. |
| 66 std::vector<Element> children; | 66 std::vector<Element> children; |
| 67 | 67 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 #if defined(TOOLKIT_VIEWS) | 92 #if defined(TOOLKIT_VIEWS) |
| 93 static const ui::OSExchangeData::CustomFormat& GetBookmarkCustomFormat(); | 93 static const ui::OSExchangeData::CustomFormat& GetBookmarkCustomFormat(); |
| 94 #endif | 94 #endif |
| 95 | 95 |
| 96 static bool ClipboardContainsBookmarks(); | 96 static bool ClipboardContainsBookmarks(); |
| 97 | 97 |
| 98 // Reads bookmarks from the given vector. | 98 // Reads bookmarks from the given vector. |
| 99 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); | 99 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); |
| 100 | 100 |
| 101 // Creates a single-bookmark DragData from url/title pair. | 101 // Creates a single-bookmark DragData from url/title pair. |
| 102 bool ReadFromTuple(const GURL& url, const string16& title); | 102 bool ReadFromTuple(const GURL& url, const base::string16& title); |
| 103 | 103 |
| 104 // Writes bookmarks to the specified clipboard. | 104 // Writes bookmarks to the specified clipboard. |
| 105 void WriteToClipboard(ui::ClipboardType type); | 105 void WriteToClipboard(ui::ClipboardType type); |
| 106 | 106 |
| 107 // Reads bookmarks from the specified clipboard. Prefers data written via | 107 // Reads bookmarks from the specified clipboard. Prefers data written via |
| 108 // WriteToClipboard() but will also attempt to read a plain bookmark. | 108 // WriteToClipboard() but will also attempt to read a plain bookmark. |
| 109 bool ReadFromClipboard(ui::ClipboardType type); | 109 bool ReadFromClipboard(ui::ClipboardType type); |
| 110 | 110 |
| 111 #if defined(TOOLKIT_VIEWS) | 111 #if defined(TOOLKIT_VIEWS) |
| 112 // Writes elements to data. If there is only one element and it is a URL | 112 // Writes elements to data. If there is only one element and it is a URL |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // The actual elements written to the clipboard. | 159 // The actual elements written to the clipboard. |
| 160 std::vector<Element> elements; | 160 std::vector<Element> elements; |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 // Path of the profile we originated from. | 163 // Path of the profile we originated from. |
| 164 base::FilePath profile_path_; | 164 base::FilePath profile_path_; |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ | 167 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| OLD | NEW |