| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 void BookmarksAPI::Shutdown() { | 320 void BookmarksAPI::Shutdown() { |
| 321 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 321 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 322 } | 322 } |
| 323 | 323 |
| 324 static base::LazyInstance<ProfileKeyedAPIFactory<BookmarksAPI> > | 324 static base::LazyInstance<ProfileKeyedAPIFactory<BookmarksAPI> > |
| 325 g_factory = LAZY_INSTANCE_INITIALIZER; | 325 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 326 | 326 |
| 327 // static | 327 // static |
| 328 ProfileKeyedAPIFactory<BookmarksAPI>* BookmarksAPI::GetFactoryInstance() { | 328 ProfileKeyedAPIFactory<BookmarksAPI>* BookmarksAPI::GetFactoryInstance() { |
| 329 return &g_factory.Get(); | 329 return g_factory.Pointer(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void BookmarksAPI::OnListenerAdded(const EventListenerInfo& details) { | 332 void BookmarksAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 333 bookmark_event_router_.reset(new BookmarkEventRouter(profile_, | 333 bookmark_event_router_.reset(new BookmarkEventRouter(profile_, |
| 334 BookmarkModelFactory::GetForProfile(profile_))); | 334 BookmarkModelFactory::GetForProfile(profile_))); |
| 335 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 335 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 336 } | 336 } |
| 337 | 337 |
| 338 bool BookmarksGetFunction::RunImpl() { | 338 bool BookmarksGetFunction::RunImpl() { |
| 339 scoped_ptr<bookmarks::Get::Params> params( | 339 scoped_ptr<bookmarks::Get::Params> params( |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 #if !defined(OS_ANDROID) | 1015 #if !defined(OS_ANDROID) |
| 1016 // Android does not have support for the standard exporter. | 1016 // Android does not have support for the standard exporter. |
| 1017 // TODO(jgreenwald): remove ifdef once extensions are no longer built on | 1017 // TODO(jgreenwald): remove ifdef once extensions are no longer built on |
| 1018 // Android. | 1018 // Android. |
| 1019 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 1019 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
| 1020 #endif | 1020 #endif |
| 1021 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 1021 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 } // namespace extensions | 1024 } // namespace extensions |
| OLD | NEW |