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 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
11 #include "base/i18n/file_util_icu.h" | 12 #include "base/i18n/file_util_icu.h" |
12 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
13 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
16 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
17 #include "base/sha1.h" | 18 #include "base/sha1.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 model_->RemoveObserver(this); | 258 model_->RemoveObserver(this); |
258 } | 259 } |
259 } | 260 } |
260 | 261 |
261 void BookmarkEventRouter::DispatchEvent( | 262 void BookmarkEventRouter::DispatchEvent( |
262 events::HistogramValue histogram_value, | 263 events::HistogramValue histogram_value, |
263 const std::string& event_name, | 264 const std::string& event_name, |
264 scoped_ptr<base::ListValue> event_args) { | 265 scoped_ptr<base::ListValue> event_args) { |
265 EventRouter* event_router = EventRouter::Get(browser_context_); | 266 EventRouter* event_router = EventRouter::Get(browser_context_); |
266 if (event_router) { | 267 if (event_router) { |
267 event_router->BroadcastEvent(make_scoped_ptr( | 268 event_router->BroadcastEvent(make_scoped_ptr(new extensions::Event( |
268 new extensions::Event(histogram_value, event_name, event_args.Pass()))); | 269 histogram_value, event_name, std::move(event_args)))); |
269 } | 270 } |
270 } | 271 } |
271 | 272 |
272 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model, | 273 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model, |
273 bool ids_reassigned) { | 274 bool ids_reassigned) { |
274 // TODO(erikkay): Perhaps we should send this event down to the extension | 275 // TODO(erikkay): Perhaps we should send this event down to the extension |
275 // so they know when it's safe to use the API? | 276 // so they know when it's safe to use the API? |
276 } | 277 } |
277 | 278 |
278 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) { | 279 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) { |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 } | 857 } |
857 | 858 |
858 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 859 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
859 int index, | 860 int index, |
860 void* params) { | 861 void* params) { |
861 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 862 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
862 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 863 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
863 } | 864 } |
864 | 865 |
865 } // namespace extensions | 866 } // namespace extensions |
OLD | NEW |