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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2908933002: Make PageSizeType an enum class. (Closed)
Patch Set: Created 3 years, 6 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 /* 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, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2422 DoubleSize& page_size, 2422 DoubleSize& page_size,
2423 int& margin_top, 2423 int& margin_top,
2424 int& margin_right, 2424 int& margin_right,
2425 int& margin_bottom, 2425 int& margin_bottom,
2426 int& margin_left) { 2426 int& margin_left) {
2427 RefPtr<ComputedStyle> style = StyleForPage(page_index); 2427 RefPtr<ComputedStyle> style = StyleForPage(page_index);
2428 2428
2429 double width = page_size.Width(); 2429 double width = page_size.Width();
2430 double height = page_size.Height(); 2430 double height = page_size.Height();
2431 switch (style->GetPageSizeType()) { 2431 switch (style->GetPageSizeType()) {
2432 case PAGE_SIZE_AUTO: 2432 case PageSizeType::kAuto:
2433 break; 2433 break;
2434 case PAGE_SIZE_AUTO_LANDSCAPE: 2434 case PageSizeType::kLandscape:
2435 if (width < height) 2435 if (width < height)
2436 std::swap(width, height); 2436 std::swap(width, height);
2437 break; 2437 break;
2438 case PAGE_SIZE_AUTO_PORTRAIT: 2438 case PageSizeType::kPortrait:
2439 if (width > height) 2439 if (width > height)
2440 std::swap(width, height); 2440 std::swap(width, height);
2441 break; 2441 break;
2442 case PAGE_SIZE_RESOLVED: { 2442 case PageSizeType::kResolved: {
2443 FloatSize size = style->PageSize(); 2443 FloatSize size = style->PageSize();
2444 width = size.Width(); 2444 width = size.Width();
2445 height = size.Height(); 2445 height = size.Height();
2446 break; 2446 break;
2447 } 2447 }
2448 default: 2448 default:
2449 NOTREACHED(); 2449 NOTREACHED();
2450 } 2450 }
2451 page_size = DoubleSize(width, height); 2451 page_size = DoubleSize(width, height);
2452 2452
(...skipping 4397 matching lines...) Expand 10 before | Expand all | Expand 10 after
6850 } 6850 }
6851 6851
6852 void showLiveDocumentInstances() { 6852 void showLiveDocumentInstances() {
6853 WeakDocumentSet& set = liveDocumentSet(); 6853 WeakDocumentSet& set = liveDocumentSet();
6854 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6854 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6855 for (blink::Document* document : set) 6855 for (blink::Document* document : set)
6856 fprintf(stderr, "- Document %p URL: %s\n", document, 6856 fprintf(stderr, "- Document %p URL: %s\n", document,
6857 document->Url().GetString().Utf8().data()); 6857 document->Url().GetString().Utf8().data());
6858 } 6858 }
6859 #endif 6859 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698