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

Side by Side Diff: components/dom_distiller/webui/dom_distiller_handler.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/dom_distiller/standalone/content_extractor.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/dom_distiller/webui/dom_distiller_handler.h" 5 #include "components/dom_distiller/webui/dom_distiller_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 base::Bind(&DomDistillerHandler::HandleViewUrl, base::Unretained(this))); 58 base::Bind(&DomDistillerHandler::HandleViewUrl, base::Unretained(this)));
59 } 59 }
60 60
61 void DomDistillerHandler::HandleAddArticle(const base::ListValue* args) { 61 void DomDistillerHandler::HandleAddArticle(const base::ListValue* args) {
62 std::string url; 62 std::string url;
63 args->GetString(0, &url); 63 args->GetString(0, &url);
64 GURL gurl(url); 64 GURL gurl(url);
65 if (gurl.is_valid()) { 65 if (gurl.is_valid()) {
66 service_->AddToList( 66 service_->AddToList(
67 gurl, 67 gurl,
68 service_->CreateDefaultDistillerPage(),
68 base::Bind(base::Bind(&DomDistillerHandler::OnArticleAdded, 69 base::Bind(base::Bind(&DomDistillerHandler::OnArticleAdded,
69 base::Unretained(this)))); 70 base::Unretained(this))));
70 } else { 71 } else {
71 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed"); 72 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed");
72 } 73 }
73 } 74 }
74 75
75 void DomDistillerHandler::HandleViewUrl(const base::ListValue* args) { 76 void DomDistillerHandler::HandleViewUrl(const base::ListValue* args) {
76 GURL view_url = GetViewUrlFromArgs(article_scheme_, args); 77 GURL view_url = GetViewUrlFromArgs(article_scheme_, args);
77 if (view_url.is_valid()) { 78 if (view_url.is_valid()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 void DomDistillerHandler::OnArticleAdded(bool article_available) { 122 void DomDistillerHandler::OnArticleAdded(bool article_available) {
122 // TODO(nyquist): Update this function. 123 // TODO(nyquist): Update this function.
123 if (article_available) { 124 if (article_available) {
124 HandleRequestEntries(NULL); 125 HandleRequestEntries(NULL);
125 } else { 126 } else {
126 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed"); 127 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed");
127 } 128 }
128 } 129 }
129 130
130 } // namespace dom_distiller 131 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/standalone/content_extractor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698