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_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 public: | 121 public: |
122 // AsyncExtensionFunction: | 122 // AsyncExtensionFunction: |
123 virtual bool RunAsync() OVERRIDE; | 123 virtual bool RunAsync() OVERRIDE; |
124 | 124 |
125 protected: | 125 protected: |
126 virtual ~BookmarksFunction() {} | 126 virtual ~BookmarksFunction() {} |
127 | 127 |
128 // RunAsync semantic equivalent called when the bookmarks are ready. | 128 // RunAsync semantic equivalent called when the bookmarks are ready. |
129 virtual bool RunOnReady() = 0; | 129 virtual bool RunOnReady() = 0; |
130 | 130 |
| 131 // Helper to get the BookmarkModel. |
| 132 BookmarkModel* GetBookmarkModel(); |
| 133 |
131 // Helper to get the ChromeBookmarkClient. | 134 // Helper to get the ChromeBookmarkClient. |
132 ChromeBookmarkClient* GetChromeBookmarkClient(); | 135 ChromeBookmarkClient* GetChromeBookmarkClient(); |
133 | 136 |
134 // Helper to get the bookmark id as int64 from the given string id. | 137 // Helper to get the bookmark id as int64 from the given string id. |
135 // Sets error_ to an error string if the given id string can't be parsed | 138 // Sets error_ to an error string if the given id string can't be parsed |
136 // as an int64. In case of error, doesn't change id and returns false. | 139 // as an int64. In case of error, doesn't change id and returns false. |
137 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); | 140 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); |
138 | 141 |
139 // Helper to get the bookmark node from a given string id. | 142 // Helper to get the bookmark node from a given string id. |
140 // If the given id can't be parsed or doesn't refer to a valid node, sets | 143 // If the given id can't be parsed or doesn't refer to a valid node, sets |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 private: | 369 private: |
367 virtual ~BookmarksExportFunction() {} | 370 virtual ~BookmarksExportFunction() {} |
368 | 371 |
369 // BookmarksFunction: | 372 // BookmarksFunction: |
370 virtual bool RunOnReady() OVERRIDE; | 373 virtual bool RunOnReady() OVERRIDE; |
371 }; | 374 }; |
372 | 375 |
373 } // namespace extensions | 376 } // namespace extensions |
374 | 377 |
375 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ | 378 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ |
OLD | NEW |