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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkEventRouter); | 62 DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkEventRouter); |
63 }; | 63 }; |
64 | 64 |
65 class BookmarksFunction : public AsyncExtensionFunction, | 65 class BookmarksFunction : public AsyncExtensionFunction, |
66 public NotificationObserver { | 66 public NotificationObserver { |
67 virtual void Run(); | 67 virtual void Run(); |
68 virtual bool RunImpl() = 0; | 68 virtual bool RunImpl() = 0; |
69 | 69 |
70 protected: | 70 protected: |
71 // Helper to get the bookmark id as int64 from the given string id. | 71 // Helper to get the bookmark id as int64 from the given string id. |
72 // Sets error_ to an error string if the given id string can't be parsed | 72 // Sets error_ to an errro string if the given id string can't be parsed |
73 // as an int64. In case of error, doesn't change id and returns false. | 73 // as an int64. In case of error, doesn't change id and returns false. |
74 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); | 74 bool GetBookmarkIdAsInt64(const std::string& id_string, int64* id); |
75 | 75 |
76 private: | 76 private: |
77 virtual void Observe(NotificationType type, | 77 virtual void Observe(NotificationType type, |
78 const NotificationSource& source, | 78 const NotificationSource& source, |
79 const NotificationDetails& details); | 79 const NotificationDetails& details); |
80 NotificationRegistrar registrar_; | 80 NotificationRegistrar registrar_; |
81 }; | 81 }; |
82 | 82 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 virtual bool RunImpl(); | 118 virtual bool RunImpl(); |
119 DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.move") | 119 DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.move") |
120 }; | 120 }; |
121 | 121 |
122 class UpdateBookmarkFunction : public BookmarksFunction { | 122 class UpdateBookmarkFunction : public BookmarksFunction { |
123 virtual bool RunImpl(); | 123 virtual bool RunImpl(); |
124 DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.update") | 124 DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.update") |
125 }; | 125 }; |
126 | 126 |
127 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ | 127 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARKS_MODULE_H_ |
OLD | NEW |