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

Side by Side Diff: Source/core/dom/ViewportDescription.cpp

Issue 460393003: Cleanup namespace usage in Source/core/{dom/* & fileapi/*} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix Error and Rebase Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/RenderedDocumentMarker.h ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 if (!mainFrame || !mainFrame->host() || !mainFrame->view() || !mainFrame->do cument()) 217 if (!mainFrame || !mainFrame->host() || !mainFrame->view() || !mainFrame->do cument())
218 return; 218 return;
219 219
220 // Avoid chrome:// pages like the new-tab page (on Android new tab is non-ht tp). 220 // Avoid chrome:// pages like the new-tab page (on Android new tab is non-ht tp).
221 if (!mainFrame->document()->url().protocolIsInHTTPFamily()) 221 if (!mainFrame->document()->url().protocolIsInHTTPFamily())
222 return; 222 return;
223 223
224 if (!isSpecifiedByAuthor()) { 224 if (!isSpecifiedByAuthor()) {
225 if (mainFrame->document()->isMobileDocument()) 225 if (mainFrame->document()->isMobileDocument())
226 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagTy pe", XhtmlMobileProfile, TypeCount); 226 Platform::current()->histogramEnumeration("Viewport.MetaTagType", Xh tmlMobileProfile, TypeCount);
227 else 227 else
228 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagTy pe", NoViewportTag, TypeCount); 228 Platform::current()->histogramEnumeration("Viewport.MetaTagType", No ViewportTag, TypeCount);
229 229
230 return; 230 return;
231 } 231 }
232 232
233 if (isMetaViewportType()) { 233 if (isMetaViewportType()) {
234 if (maxWidth.type() == blink::Fixed) { 234 if (maxWidth.type() == blink::Fixed) {
235 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagTy pe", ConstantWidth, TypeCount); 235 Platform::current()->histogramEnumeration("Viewport.MetaTagType", Co nstantWidth, TypeCount);
236 236
237 if (mainFrame->view()) { 237 if (mainFrame->view()) {
238 // To get an idea of how "far" the viewport is from the device's ideal width, we 238 // To get an idea of how "far" the viewport is from the device's ideal width, we
239 // report the zoom level that we'd need to be at for the entire page to be visible. 239 // report the zoom level that we'd need to be at for the entire page to be visible.
240 int viewportWidth = maxWidth.intValue(); 240 int viewportWidth = maxWidth.intValue();
241 int windowWidth = mainFrame->document()->settings()->pinchVirtua lViewportEnabled() 241 int windowWidth = mainFrame->document()->settings()->pinchVirtua lViewportEnabled()
242 ? mainFrame->host()->pinchViewport().size().width() 242 ? mainFrame->host()->pinchViewport().size().width()
243 : mainFrame->view()->frameRect().width(); 243 : mainFrame->view()->frameRect().width();
244 int overviewZoomPercent = 100 * windowWidth / static_cast<float> (viewportWidth); 244 int overviewZoomPercent = 100 * windowWidth / static_cast<float> (viewportWidth);
245 blink::Platform::current()->histogramSparse("Viewport.OverviewZo om", overviewZoomPercent); 245 Platform::current()->histogramSparse("Viewport.OverviewZoom", ov erviewZoomPercent);
246 } 246 }
247 247
248 } else if (maxWidth.type() == blink::DeviceWidth || maxWidth.type() == b link::ExtendToZoom) { 248 } else if (maxWidth.type() == blink::DeviceWidth || maxWidth.type() == b link::ExtendToZoom) {
249 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagTy pe", DeviceWidth, TypeCount); 249 Platform::current()->histogramEnumeration("Viewport.MetaTagType", De viceWidth, TypeCount);
250 } else { 250 } else {
251 // Overflow bucket for cases we may be unaware of. 251 // Overflow bucket for cases we may be unaware of.
252 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagTy pe", MetaWidthOther, TypeCount); 252 Platform::current()->histogramEnumeration("Viewport.MetaTagType", Me taWidthOther, TypeCount);
253 } 253 }
254 } else if (type == ViewportDescription::HandheldFriendlyMeta) { 254 } else if (type == ViewportDescription::HandheldFriendlyMeta) {
255 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaHandheldFriendly, TypeCount); 255 Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaHa ndheldFriendly, TypeCount);
256 } else if (type == ViewportDescription::MobileOptimizedMeta) { 256 } else if (type == ViewportDescription::MobileOptimizedMeta) {
257 blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", MobileOptimizedMeta, TypeCount); 257 Platform::current()->histogramEnumeration("Viewport.MetaTagType", Mobile OptimizedMeta, TypeCount);
258 } 258 }
259 #endif 259 #endif
260 } 260 }
261 261
262 } // namespace blink 262 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/RenderedDocumentMarker.h ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698