| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 bookmarks::BookmarkModel* model, | 77 bookmarks::BookmarkModel* model, |
| 78 const bookmarks::BookmarkNode* node) override; | 78 const bookmarks::BookmarkNode* node) override; |
| 79 void ExtensiveBookmarkChangesBeginning( | 79 void ExtensiveBookmarkChangesBeginning( |
| 80 bookmarks::BookmarkModel* model) override; | 80 bookmarks::BookmarkModel* model) override; |
| 81 void ExtensiveBookmarkChangesEnded(bookmarks::BookmarkModel* model) override; | 81 void ExtensiveBookmarkChangesEnded(bookmarks::BookmarkModel* model) override; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 // Helper to actually dispatch an event to extension listeners. | 84 // Helper to actually dispatch an event to extension listeners. |
| 85 void DispatchEvent(events::HistogramValue histogram_value, | 85 void DispatchEvent(events::HistogramValue histogram_value, |
| 86 const std::string& event_name, | 86 const std::string& event_name, |
| 87 scoped_ptr<base::ListValue> event_args); | 87 std::unique_ptr<base::ListValue> event_args); |
| 88 | 88 |
| 89 content::BrowserContext* browser_context_; | 89 content::BrowserContext* browser_context_; |
| 90 bookmarks::BookmarkModel* model_; | 90 bookmarks::BookmarkModel* model_; |
| 91 bookmarks::ManagedBookmarkService* managed_; | 91 bookmarks::ManagedBookmarkService* managed_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(BookmarkEventRouter); | 93 DISALLOW_COPY_AND_ASSIGN(BookmarkEventRouter); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 class BookmarksAPI : public BrowserContextKeyedAPI, | 96 class BookmarksAPI : public BrowserContextKeyedAPI, |
| 97 public EventRouter::Observer { | 97 public EventRouter::Observer { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 113 | 113 |
| 114 content::BrowserContext* browser_context_; | 114 content::BrowserContext* browser_context_; |
| 115 | 115 |
| 116 // BrowserContextKeyedAPI implementation. | 116 // BrowserContextKeyedAPI implementation. |
| 117 static const char* service_name() { | 117 static const char* service_name() { |
| 118 return "BookmarksAPI"; | 118 return "BookmarksAPI"; |
| 119 } | 119 } |
| 120 static const bool kServiceIsNULLWhileTesting = true; | 120 static const bool kServiceIsNULLWhileTesting = true; |
| 121 | 121 |
| 122 // Created lazily upon OnListenerAdded. | 122 // Created lazily upon OnListenerAdded. |
| 123 scoped_ptr<BookmarkEventRouter> bookmark_event_router_; | 123 std::unique_ptr<BookmarkEventRouter> bookmark_event_router_; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 class BookmarksFunction : public ChromeAsyncExtensionFunction, | 126 class BookmarksFunction : public ChromeAsyncExtensionFunction, |
| 127 public bookmarks::BaseBookmarkModelObserver { | 127 public bookmarks::BaseBookmarkModelObserver { |
| 128 public: | 128 public: |
| 129 // AsyncExtensionFunction: | 129 // AsyncExtensionFunction: |
| 130 bool RunAsync() override; | 130 bool RunAsync() override; |
| 131 | 131 |
| 132 protected: | 132 protected: |
| 133 ~BookmarksFunction() override {} | 133 ~BookmarksFunction() override {} |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 private: | 366 private: |
| 367 ~BookmarksExportFunction() override {} | 367 ~BookmarksExportFunction() override {} |
| 368 | 368 |
| 369 // BookmarksFunction: | 369 // BookmarksFunction: |
| 370 bool RunOnReady() override; | 370 bool RunOnReady() override; |
| 371 }; | 371 }; |
| 372 | 372 |
| 373 } // namespace extensions | 373 } // namespace extensions |
| 374 | 374 |
| 375 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ | 375 #endif // CHROME_BROWSER_EXTENSIONS_API_BOOKMARKS_BOOKMARKS_API_H_ |
| OLD | NEW |