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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h

Issue 2877333002: Make EWordBreak an enum class. (Closed)
Patch Set: Release Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutText.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) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 } 1478 }
1479 1479
1480 NOTREACHED(); 1480 NOTREACHED();
1481 return EVerticalAlign::kTop; 1481 return EVerticalAlign::kTop;
1482 } 1482 }
1483 1483
1484 template <> 1484 template <>
1485 inline CSSIdentifierValue::CSSIdentifierValue(EWordBreak e) 1485 inline CSSIdentifierValue::CSSIdentifierValue(EWordBreak e)
1486 : CSSValue(kIdentifierClass) { 1486 : CSSValue(kIdentifierClass) {
1487 switch (e) { 1487 switch (e) {
1488 case kNormalWordBreak: 1488 case EWordBreak::kNormal:
1489 value_id_ = CSSValueNormal; 1489 value_id_ = CSSValueNormal;
1490 break; 1490 break;
1491 case kBreakAllWordBreak: 1491 case EWordBreak::kBreakAll:
1492 value_id_ = CSSValueBreakAll; 1492 value_id_ = CSSValueBreakAll;
1493 break; 1493 break;
1494 case kBreakWordBreak: 1494 case EWordBreak::kBreakWord:
1495 value_id_ = CSSValueBreakWord; 1495 value_id_ = CSSValueBreakWord;
1496 break; 1496 break;
1497 case kKeepAllWordBreak: 1497 case EWordBreak::kKeepAll:
1498 value_id_ = CSSValueKeepAll; 1498 value_id_ = CSSValueKeepAll;
1499 break; 1499 break;
1500 } 1500 }
1501 } 1501 }
1502 1502
1503 template <> 1503 template <>
1504 inline EWordBreak CSSIdentifierValue::ConvertTo() const { 1504 inline EWordBreak CSSIdentifierValue::ConvertTo() const {
1505 switch (value_id_) { 1505 switch (value_id_) {
1506 case CSSValueBreakAll: 1506 case CSSValueBreakAll:
1507 return kBreakAllWordBreak; 1507 return EWordBreak::kBreakAll;
1508 case CSSValueBreakWord: 1508 case CSSValueBreakWord:
1509 return kBreakWordBreak; 1509 return EWordBreak::kBreakWord;
1510 case CSSValueNormal: 1510 case CSSValueNormal:
1511 return kNormalWordBreak; 1511 return EWordBreak::kNormal;
1512 case CSSValueKeepAll: 1512 case CSSValueKeepAll:
1513 return kKeepAllWordBreak; 1513 return EWordBreak::kKeepAll;
1514 default: 1514 default:
1515 break; 1515 break;
1516 } 1516 }
1517 1517
1518 NOTREACHED(); 1518 NOTREACHED();
1519 return kNormalWordBreak; 1519 return EWordBreak::kNormal;
1520 } 1520 }
1521 1521
1522 template <> 1522 template <>
1523 inline CSSIdentifierValue::CSSIdentifierValue(EOverflowWrap e) 1523 inline CSSIdentifierValue::CSSIdentifierValue(EOverflowWrap e)
1524 : CSSValue(kIdentifierClass) { 1524 : CSSValue(kIdentifierClass) {
1525 switch (e) { 1525 switch (e) {
1526 case EOverflowWrap::kNormal: 1526 case EOverflowWrap::kNormal:
1527 value_id_ = CSSValueNormal; 1527 value_id_ = CSSValueNormal;
1528 break; 1528 break;
1529 case EOverflowWrap::kBreakWord: 1529 case EOverflowWrap::kBreakWord:
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 default: 3320 default:
3321 break; 3321 break;
3322 } 3322 }
3323 NOTREACHED(); 3323 NOTREACHED();
3324 return kContainsNone; 3324 return kContainsNone;
3325 } 3325 }
3326 3326
3327 } // namespace blink 3327 } // namespace blink
3328 3328
3329 #endif 3329 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698