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

Side by Side Diff: chrome/browser/search/suggestions/suggestions_service_factory.cc

Issue 1156003008: Decode ImageManager cached images on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use MessageLoop API Created 5 years, 6 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
« no previous file with comments | « no previous file | components/suggestions/image_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/search/suggestions/suggestions_service_factory.h" 5 #include "chrome/browser/search/suggestions/suggestions_service_factory.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData> > db( 61 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData> > db(
62 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); 62 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner));
63 63
64 base::FilePath database_dir( 64 base::FilePath database_dir(
65 the_profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails"))); 65 the_profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails")));
66 66
67 scoped_ptr<ImageFetcherImpl> image_fetcher( 67 scoped_ptr<ImageFetcherImpl> image_fetcher(
68 new ImageFetcherImpl(the_profile->GetRequestContext())); 68 new ImageFetcherImpl(the_profile->GetRequestContext()));
69 scoped_ptr<ImageManager> thumbnail_manager( 69 scoped_ptr<ImageManager> thumbnail_manager(
70 new ImageManager(image_fetcher.Pass(), db.Pass(), database_dir)); 70 new ImageManager(
71 image_fetcher.Pass(), db.Pass(), database_dir,
72 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)));
71 return new SuggestionsService( 73 return new SuggestionsService(
72 the_profile->GetRequestContext(), suggestions_store.Pass(), 74 the_profile->GetRequestContext(), suggestions_store.Pass(),
73 thumbnail_manager.Pass(), blacklist_store.Pass()); 75 thumbnail_manager.Pass(), blacklist_store.Pass());
74 } 76 }
75 77
76 void SuggestionsServiceFactory::RegisterProfilePrefs( 78 void SuggestionsServiceFactory::RegisterProfilePrefs(
77 user_prefs::PrefRegistrySyncable* registry) { 79 user_prefs::PrefRegistrySyncable* registry) {
78 SuggestionsService::RegisterProfilePrefs(registry); 80 SuggestionsService::RegisterProfilePrefs(registry);
79 } 81 }
80 82
81 } // namespace suggestions 83 } // namespace suggestions
OLDNEW
« no previous file with comments | « no previous file | components/suggestions/image_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698