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 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" | 5 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 model_->RemoveObserver(this); | 256 model_->RemoveObserver(this); |
257 } | 257 } |
258 } | 258 } |
259 | 259 |
260 void BookmarkEventRouter::DispatchEvent( | 260 void BookmarkEventRouter::DispatchEvent( |
261 events::HistogramValue histogram_value, | 261 events::HistogramValue histogram_value, |
262 const std::string& event_name, | 262 const std::string& event_name, |
263 std::unique_ptr<base::ListValue> event_args) { | 263 std::unique_ptr<base::ListValue> event_args) { |
264 EventRouter* event_router = EventRouter::Get(browser_context_); | 264 EventRouter* event_router = EventRouter::Get(browser_context_); |
265 if (event_router) { | 265 if (event_router) { |
266 event_router->BroadcastEvent(base::WrapUnique(new extensions::Event( | 266 event_router->BroadcastEvent(base::MakeUnique<extensions::Event>( |
267 histogram_value, event_name, std::move(event_args)))); | 267 histogram_value, event_name, std::move(event_args))); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model, | 271 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model, |
272 bool ids_reassigned) { | 272 bool ids_reassigned) { |
273 // TODO(erikkay): Perhaps we should send this event down to the extension | 273 // TODO(erikkay): Perhaps we should send this event down to the extension |
274 // so they know when it's safe to use the API? | 274 // so they know when it's safe to use the API? |
275 } | 275 } |
276 | 276 |
277 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) { | 277 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) { |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 } | 838 } |
839 | 839 |
840 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 840 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
841 int index, | 841 int index, |
842 void* params) { | 842 void* params) { |
843 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 843 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
844 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 844 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
845 } | 845 } |
846 | 846 |
847 } // namespace extensions | 847 } // namespace extensions |
OLD | NEW |