Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc

Issue 178193030: Rename ProfileKeyedAPI to BrowserContextKeyedAPI and GetProfile to Get. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } 316 }
317 317
318 BookmarksAPI::~BookmarksAPI() { 318 BookmarksAPI::~BookmarksAPI() {
319 } 319 }
320 320
321 void BookmarksAPI::Shutdown() { 321 void BookmarksAPI::Shutdown() {
322 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( 322 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
323 this); 323 this);
324 } 324 }
325 325
326 static base::LazyInstance<ProfileKeyedAPIFactory<BookmarksAPI> > 326 static base::LazyInstance<BrowserContextKeyedAPIFactory<BookmarksAPI> >
327 g_factory = LAZY_INSTANCE_INITIALIZER; 327 g_factory = LAZY_INSTANCE_INITIALIZER;
328 328
329 // static 329 // static
330 ProfileKeyedAPIFactory<BookmarksAPI>* BookmarksAPI::GetFactoryInstance() { 330 BrowserContextKeyedAPIFactory<BookmarksAPI>*
331 BookmarksAPI::GetFactoryInstance() {
331 return g_factory.Pointer(); 332 return g_factory.Pointer();
332 } 333 }
333 334
334 void BookmarksAPI::OnListenerAdded(const EventListenerInfo& details) { 335 void BookmarksAPI::OnListenerAdded(const EventListenerInfo& details) {
335 bookmark_event_router_.reset(new BookmarkEventRouter( 336 bookmark_event_router_.reset(new BookmarkEventRouter(
336 browser_context_, 337 browser_context_,
337 BookmarkModelFactory::GetForProfile( 338 BookmarkModelFactory::GetForProfile(
338 Profile::FromBrowserContext(browser_context_)))); 339 Profile::FromBrowserContext(browser_context_))));
339 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( 340 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
340 this); 341 this);
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 #if !defined(OS_ANDROID) 1027 #if !defined(OS_ANDROID)
1027 // Android does not have support for the standard exporter. 1028 // Android does not have support for the standard exporter.
1028 // TODO(jgreenwald): remove ifdef once extensions are no longer built on 1029 // TODO(jgreenwald): remove ifdef once extensions are no longer built on
1029 // Android. 1030 // Android.
1030 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); 1031 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL);
1031 #endif 1032 #endif
1032 Release(); // Balanced in BookmarksIOFunction::SelectFile() 1033 Release(); // Balanced in BookmarksIOFunction::SelectFile()
1033 } 1034 }
1034 1035
1035 } // namespace extensions 1036 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698