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

Side by Side Diff: components/dom_distiller/webui/dom_distiller_handler.cc

Issue 396503003: DomDistiller: fix 0 document width (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve patch conflicts Created 6 years, 5 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 service_->CreateDefaultDistillerPage(
69 web_ui()->GetWebContents()->GetContainerBounds().size()),
69 base::Bind(base::Bind(&DomDistillerHandler::OnArticleAdded, 70 base::Bind(base::Bind(&DomDistillerHandler::OnArticleAdded,
70 base::Unretained(this)))); 71 base::Unretained(this))));
71 } else { 72 } else {
72 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed"); 73 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed");
73 } 74 }
74 } 75 }
75 76
76 void DomDistillerHandler::HandleViewUrl(const base::ListValue* args) { 77 void DomDistillerHandler::HandleViewUrl(const base::ListValue* args) {
77 GURL view_url = GetViewUrlFromArgs(article_scheme_, args); 78 GURL view_url = GetViewUrlFromArgs(article_scheme_, args);
78 if (view_url.is_valid()) { 79 if (view_url.is_valid()) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void DomDistillerHandler::OnArticleAdded(bool article_available) { 123 void DomDistillerHandler::OnArticleAdded(bool article_available) {
123 // TODO(nyquist): Update this function. 124 // TODO(nyquist): Update this function.
124 if (article_available) { 125 if (article_available) {
125 HandleRequestEntries(NULL); 126 HandleRequestEntries(NULL);
126 } else { 127 } else {
127 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed"); 128 web_ui()->CallJavascriptFunction("domDistiller.onArticleAddFailed");
128 } 129 }
129 } 130 }
130 131
131 } // namespace dom_distiller 132 } // 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