| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSION_BOOKMARKS_MODULE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 std::set<BookmarkModel*> models_; | 63 std::set<BookmarkModel*> models_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkEventRouter); | 65 DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkEventRouter); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class BookmarksFunction : public AsyncExtensionFunction, | 68 class BookmarksFunction : public AsyncExtensionFunction, |
| 69 public NotificationObserver { | 69 public NotificationObserver { |
| 70 virtual void Run(); | 70 virtual void Run(); |
| 71 virtual bool RunImpl() = 0; | 71 virtual bool RunImpl() = 0; |
| 72 | 72 |
| 73 protected: |
| 74 // Helper to get the bookmark id as int64 from the given string id. |
| 75 // Sets error_ to an errro string if the given id string can't be parsed |
| 76 // as an int64. In case of error, doesn't change id and returns false. |
| 77 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); |
| 78 |
| 73 private: | 79 private: |
| 74 virtual void Observe(NotificationType type, | 80 virtual void Observe(NotificationType type, |
| 75 const NotificationSource& source, | 81 const NotificationSource& source, |
| 76 const NotificationDetails& details); | 82 const NotificationDetails& details); |
| 77 NotificationRegistrar registrar_; | 83 NotificationRegistrar registrar_; |
| 78 }; | 84 }; |
| 79 | 85 |
| 80 class GetBookmarksFunction : public BookmarksFunction { | 86 class GetBookmarksFunction : public BookmarksFunction { |
| 81 virtual bool RunImpl(); | 87 virtual bool RunImpl(); |
| 82 }; | 88 }; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 103 | 109 |
| 104 class MoveBookmarkFunction : public BookmarksFunction { | 110 class MoveBookmarkFunction : public BookmarksFunction { |
| 105 virtual bool RunImpl(); | 111 virtual bool RunImpl(); |
| 106 }; | 112 }; |
| 107 | 113 |
| 108 class SetBookmarkTitleFunction : public BookmarksFunction { | 114 class SetBookmarkTitleFunction : public BookmarksFunction { |
| 109 virtual bool RunImpl(); | 115 virtual bool RunImpl(); |
| 110 }; | 116 }; |
| 111 | 117 |
| 112 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ |
| OLD | NEW |