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

Unified Diff: chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc

Issue 254483003: Start requiring DistillerPage for calls to DomDistillerService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indent fixes (full git cl format) Created 6 years, 8 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/extensions/api/reading_list_private/reading_list_private_api.cc
diff --git a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc
index 9f2919a3de38471570df0e01b967091e3b51d18c..69af0893969cfda178783831dbf47c63a1d8ccde 100644
--- a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc
+++ b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc
@@ -37,8 +37,10 @@ bool ReadingListPrivateAddEntryFunction::RunImpl() {
DomDistillerService* service =
DomDistillerServiceFactory::GetForBrowserContext(GetProfile());
- const std::string& id = service->AddToList(url_to_add, base::Bind(
- &ReadingListPrivateAddEntryFunction::SendResponse, this));
+ const std::string& id = service->AddToList(
+ url_to_add,
+ service->CreateDefaultDistillerPage().Pass(),
+ base::Bind(&ReadingListPrivateAddEntryFunction::SendResponse, this));
Entry new_entry;
new_entry.id = id;
results_ = AddEntry::Results::Create(new_entry);
@@ -49,7 +51,7 @@ bool ReadingListPrivateRemoveEntryFunction::RunImpl() {
scoped_ptr<RemoveEntry::Params> params(RemoveEntry::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
DomDistillerService* service =
- DomDistillerServiceFactory::GetForBrowserContext(GetProfile());
+ DomDistillerServiceFactory::GetForBrowserContext(GetProfile());
scoped_ptr<ArticleEntry> entry(service->RemoveEntry(params->id));
if (entry == NULL) {
results_ = make_scoped_ptr(new base::ListValue());
@@ -67,8 +69,8 @@ bool ReadingListPrivateGetEntriesFunction::RunImpl() {
const std::vector<ArticleEntry>& entries = service->GetEntries();
std::vector<linked_ptr<Entry> > result;
for (std::vector<ArticleEntry>::const_iterator i = entries.begin();
- i != entries.end();
- ++i) {
+ i != entries.end();
+ ++i) {
linked_ptr<Entry> e(new Entry);
e->id = i->entry_id();
result.push_back(e);

Powered by Google App Engine
This is Rietveld 408576698