| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 static const bool kServiceIsNULLWhileTesting = true; | 107 static const bool kServiceIsNULLWhileTesting = true; |
| 108 | 108 |
| 109 // Created lazily upon OnListenerAdded. | 109 // Created lazily upon OnListenerAdded. |
| 110 scoped_ptr<BookmarkEventRouter> bookmark_event_router_; | 110 scoped_ptr<BookmarkEventRouter> bookmark_event_router_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 class BookmarksFunction : public ChromeAsyncExtensionFunction, | 113 class BookmarksFunction : public ChromeAsyncExtensionFunction, |
| 114 public BaseBookmarkModelObserver { | 114 public BaseBookmarkModelObserver { |
| 115 public: | 115 public: |
| 116 // AsyncExtensionFunction: | 116 // AsyncExtensionFunction: |
| 117 virtual bool RunImpl() OVERRIDE; | 117 virtual bool RunAsync() OVERRIDE; |
| 118 | 118 |
| 119 protected: | 119 protected: |
| 120 virtual ~BookmarksFunction() {} | 120 virtual ~BookmarksFunction() {} |
| 121 | 121 |
| 122 // RunImpl semantic equivalent called when the bookmarks are ready. | 122 // RunAsync semantic equivalent called when the bookmarks are ready. |
| 123 virtual bool RunOnReady() = 0; | 123 virtual bool RunOnReady() = 0; |
| 124 | 124 |
| 125 // Helper to get the bookmark id as int64 from the given string id. | 125 // Helper to get the bookmark id as int64 from the given string id. |
| 126 // Sets error_ to an error string if the given id string can't be parsed | 126 // Sets error_ to an error string if the given id string can't be parsed |
| 127 // as an int64. In case of error, doesn't change id and returns false. | 127 // as an int64. In case of error, doesn't change id and returns false. |
| 128 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); | 128 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); |
| 129 | 129 |
| 130 // Helper to get the bookmark node from a given string id. | 130 // Helper to get the bookmark node from a given string id. |
| 131 // If the given id can't be parsed or doesn't refer to a valid node, sets | 131 // If the given id can't be parsed or doesn't refer to a valid node, sets |
| 132 // error_ and returns NULL. | 132 // error_ and returns NULL. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 private: | 351 private: |
| 352 virtual ~BookmarksExportFunction() {} | 352 virtual ~BookmarksExportFunction() {} |
| 353 | 353 |
| 354 // BookmarksFunction: | 354 // BookmarksFunction: |
| 355 virtual bool RunOnReady() OVERRIDE; | 355 virtual bool RunOnReady() OVERRIDE; |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 } // namespace extensions | 358 } // namespace extensions |
| 359 | 359 |
| 360 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ | 360 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ |
| OLD | NEW |