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

Unified Diff: components/dom_distiller/webui/dom_distiller_handler.cc

Issue 105723002: Add the scheme chrome-distiller:// and hook up data source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments from jam@ Created 6 years, 11 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: components/dom_distiller/webui/dom_distiller_handler.cc
diff --git a/components/dom_distiller/webui/dom_distiller_handler.cc b/components/dom_distiller/webui/dom_distiller_handler.cc
index 3b8eee6f88e73a7e80be88b530e6d4254d3ca4c6..ede4f40615b78c919609e262ce382bb0c0809667 100644
--- a/components/dom_distiller/webui/dom_distiller_handler.cc
+++ b/components/dom_distiller/webui/dom_distiller_handler.cc
@@ -10,6 +10,7 @@
#include "base/values.h"
#include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/dom_distiller/core/proto/distilled_page.pb.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "url/gurl.h"
@@ -53,8 +54,11 @@ void DomDistillerHandler::HandleAddArticle(const base::ListValue* args) {
void DomDistillerHandler::HandleSelectArticle(const base::ListValue* args) {
std::string entry_id;
args->GetString(0, &entry_id);
-
- // TODO(nyquist): Do something here.
+ GURL url(article_scheme_ + std::string("://") + entry_id);
+ DCHECK(url.is_valid());
+ web_ui()->GetWebContents()->GetController().LoadURL(url,
+ content::Referrer(), content::PAGE_TRANSITION_GENERATED,
+ std::string());
}
void DomDistillerHandler::HandleRequestEntries(const base::ListValue* args) {
« no previous file with comments | « components/dom_distiller/content/dom_distiller_viewer_source.cc ('k') | content/browser/browser_url_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698