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

Side by Side Diff: components/dom_distiller/content/browser/distiller_page_web_contents.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 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 unified diff | Download patch
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/content/browser/distiller_page_web_contents.h " 5 #include "components/dom_distiller/content/browser/distiller_page_web_contents.h "
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 gfx::Size DistillerPageWebContents::GetSizeForNewRenderView( 137 gfx::Size DistillerPageWebContents::GetSizeForNewRenderView(
138 content::WebContents* web_contents) const { 138 content::WebContents* web_contents) const {
139 gfx::Size size(render_view_size_); 139 gfx::Size size(render_view_size_);
140 if (size.IsEmpty()) 140 if (size.IsEmpty())
141 size = web_contents->GetContainerBounds().size(); 141 size = web_contents->GetContainerBounds().size();
142 // If size is still empty, set it to fullscreen so that document.offsetWidth 142 // If size is still empty, set it to fullscreen so that document.offsetWidth
143 // in the executed domdistiller.js won't be 0. 143 // in the executed domdistiller.js won't be 0.
144 if (size.IsEmpty()) { 144 if (size.IsEmpty()) {
145 DVLOG(1) << "Using fullscreen as default RenderView size"; 145 DVLOG(1) << "Using fullscreen as default RenderView size";
146 size = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().size(); 146 size = gfx::Screen::GetScreen()->GetPrimaryDisplay().size();
147 } 147 }
148 return size; 148 return size;
149 } 149 }
150 150
151 void DistillerPageWebContents::DocumentLoadedInFrame( 151 void DistillerPageWebContents::DocumentLoadedInFrame(
152 content::RenderFrameHost* render_frame_host) { 152 content::RenderFrameHost* render_frame_host) {
153 if (render_frame_host == 153 if (render_frame_host ==
154 source_page_handle_->web_contents()->GetMainFrame()) { 154 source_page_handle_->web_contents()->GetMainFrame()) {
155 ExecuteJavaScript(); 155 ExecuteJavaScript();
156 } 156 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (!javascript_start.is_null()) { 201 if (!javascript_start.is_null()) {
202 base::TimeDelta javascript_time = base::TimeTicks::Now() - javascript_start; 202 base::TimeDelta javascript_time = base::TimeTicks::Now() - javascript_start;
203 UMA_HISTOGRAM_TIMES("DomDistiller.Time.RunJavaScript", javascript_time); 203 UMA_HISTOGRAM_TIMES("DomDistiller.Time.RunJavaScript", javascript_time);
204 DVLOG(1) << "DomDistiller.Time.RunJavaScript = " << javascript_time; 204 DVLOG(1) << "DomDistiller.Time.RunJavaScript = " << javascript_time;
205 } 205 }
206 206
207 DistillerPage::OnDistillationDone(page_url, value); 207 DistillerPage::OnDistillationDone(page_url, value);
208 } 208 }
209 209
210 } // namespace dom_distiller 210 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/autofill/content/browser/risk/fingerprint.cc ('k') | components/metrics/ui/screen_info_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698