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

Unified Diff: chrome/browser/extensions/api/reading_list_private/reading_list_private_api.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_distiller/lazy_dom_distiller_service.cc ('k') | components/dom_distiller/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7676c05fb260633092b87988220992ddcc446eba..c56fe86628ccf565660dedb1abcbfe27cc8b31a1 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
@@ -13,6 +13,7 @@
#include "chrome/common/extensions/api/reading_list_private.h"
#include "components/dom_distiller/core/article_entry.h"
#include "components/dom_distiller/core/dom_distiller_service.h"
+#include "content/public/browser/web_contents.h"
namespace extensions {
@@ -37,9 +38,13 @@ bool ReadingListPrivateAddEntryFunction::RunAsync() {
DomDistillerService* service =
DomDistillerServiceFactory::GetForBrowserContext(GetProfile());
+ gfx::Size render_view_size;
+ content::WebContents* web_contents = GetAssociatedWebContents();
+ if (web_contents)
+ render_view_size = web_contents->GetContainerBounds().size();
const std::string& id = service->AddToList(
url_to_add,
- service->CreateDefaultDistillerPage().Pass(),
+ service->CreateDefaultDistillerPage(render_view_size).Pass(),
base::Bind(&ReadingListPrivateAddEntryFunction::SendResponse, this));
Entry new_entry;
new_entry.id = id;
« no previous file with comments | « chrome/browser/dom_distiller/lazy_dom_distiller_service.cc ('k') | components/dom_distiller/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698