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

Unified Diff: chrome/browser/bookmarks/bookmark_html_writer.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/bookmarks/bookmark_html_writer.cc
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index df55855046e679d38934e18993c7eb0cf1a6e3bc..7b82ea17f3e0997ba5dc16c16a4c4bf3d7d0ee32 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
+#include "chrome/browser/profiles/profile.h"
#include "components/bookmarks/browser/bookmark_codec.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/favicon/core/favicon_service.h"
@@ -409,10 +410,12 @@ BookmarkFaviconFetcher::~BookmarkFaviconFetcher() {
}
void BookmarkFaviconFetcher::ExportBookmarks() {
- ExtractUrls(BookmarkModelFactory::GetForProfile(
- profile_)->bookmark_bar_node());
- ExtractUrls(BookmarkModelFactory::GetForProfile(profile_)->other_node());
- ExtractUrls(BookmarkModelFactory::GetForProfile(profile_)->mobile_node());
+ ExtractUrls(BookmarkModelFactory::GetForBrowserContext(profile_)
+ ->bookmark_bar_node());
+ ExtractUrls(
+ BookmarkModelFactory::GetForBrowserContext(profile_)->other_node());
+ ExtractUrls(
+ BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node());
if (!bookmark_urls_.empty())
FetchNextFavicon();
else
@@ -448,10 +451,11 @@ void BookmarkFaviconFetcher::ExecuteWriter() {
BookmarkCodec codec;
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- base::Bind(&Writer::DoWrite,
- new Writer(codec.Encode(BookmarkModelFactory::GetForProfile(
- profile_)),
- path_, favicons_map_.release(), observer_)));
+ base::Bind(
+ &Writer::DoWrite,
+ new Writer(codec.Encode(
+ BookmarkModelFactory::GetForBrowserContext(profile_)),
+ path_, favicons_map_.release(), observer_)));
if (g_fetcher) {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, g_fetcher);
g_fetcher = nullptr;
« no previous file with comments | « chrome/browser/autocomplete/in_memory_url_index_factory.cc ('k') | chrome/browser/bookmarks/bookmark_html_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698