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

Side by Side Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.h

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 static const bool kServiceIsNULLWhileTesting = true; 110 static const bool kServiceIsNULLWhileTesting = true;
111 111
112 // Created lazily upon OnListenerAdded. 112 // Created lazily upon OnListenerAdded.
113 scoped_ptr<BookmarkEventRouter> bookmark_event_router_; 113 scoped_ptr<BookmarkEventRouter> bookmark_event_router_;
114 }; 114 };
115 115
116 class BookmarksFunction : public ChromeAsyncExtensionFunction, 116 class BookmarksFunction : public ChromeAsyncExtensionFunction,
117 public BaseBookmarkModelObserver { 117 public BaseBookmarkModelObserver {
118 public: 118 public:
119 // AsyncExtensionFunction: 119 // AsyncExtensionFunction:
120 virtual bool RunImpl() OVERRIDE; 120 virtual bool RunAsync() OVERRIDE;
121 121
122 protected: 122 protected:
123 virtual ~BookmarksFunction() {} 123 virtual ~BookmarksFunction() {}
124 124
125 // RunImpl semantic equivalent called when the bookmarks are ready. 125 // RunAsync semantic equivalent called when the bookmarks are ready.
126 virtual bool RunOnReady() = 0; 126 virtual bool RunOnReady() = 0;
127 127
128 // Helper to get the bookmark id as int64 from the given string id. 128 // Helper to get the bookmark id as int64 from the given string id.
129 // Sets error_ to an error string if the given id string can't be parsed 129 // Sets error_ to an error string if the given id string can't be parsed
130 // as an int64. In case of error, doesn't change id and returns false. 130 // as an int64. In case of error, doesn't change id and returns false.
131 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); 131 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id);
132 132
133 // Helper to get the bookmark node from a given string id. 133 // Helper to get the bookmark node from a given string id.
134 // If the given id can't be parsed or doesn't refer to a valid node, sets 134 // If the given id can't be parsed or doesn't refer to a valid node, sets
135 // error_ and returns NULL. 135 // error_ and returns NULL.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 private: 354 private:
355 virtual ~BookmarksExportFunction() {} 355 virtual ~BookmarksExportFunction() {}
356 356
357 // BookmarksFunction: 357 // BookmarksFunction:
358 virtual bool RunOnReady() OVERRIDE; 358 virtual bool RunOnReady() OVERRIDE;
359 }; 359 };
360 360
361 } // namespace extensions 361 } // namespace extensions
362 362
363 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ 363 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698