OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) | 3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 } | 1845 } |
1846 | 1846 |
1847 void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C
ppVariant* result) | 1847 void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C
ppVariant* result) |
1848 { | 1848 { |
1849 if (arguments.size() > 0 && arguments[0].isString()) { | 1849 if (arguments.size() > 0 && arguments[0].isString()) { |
1850 string newVisibility = arguments[0].toString(); | 1850 string newVisibility = arguments[0].toString(); |
1851 if (newVisibility == "visible") | 1851 if (newVisibility == "visible") |
1852 m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible
, false); | 1852 m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible
, false); |
1853 else if (newVisibility == "hidden") | 1853 else if (newVisibility == "hidden") |
1854 m_shell->webView()->setVisibilityState(WebPageVisibilityStateHidden,
false); | 1854 m_shell->webView()->setVisibilityState(WebPageVisibilityStateHidden,
false); |
| 1855 else if (newVisibility == "prerender") |
| 1856 m_shell->webView()->setVisibilityState(WebPageVisibilityStatePrerend
er, false); |
1855 } | 1857 } |
1856 } | 1858 } |
1857 | 1859 |
1858 void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp
pVariant* result) | 1860 void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp
pVariant* result) |
1859 { | 1861 { |
1860 result->setNull(); | 1862 result->setNull(); |
1861 if (arguments.size() != 1 || !arguments[0].isString()) | 1863 if (arguments.size() != 1 || !arguments[0].isString()) |
1862 return; | 1864 return; |
1863 | 1865 |
1864 // Map a direction name to a WebTextDirection value. | 1866 // Map a direction name to a WebTextDirection value. |
1865 std::string directionName = arguments[0].toString(); | 1867 std::string directionName = arguments[0].toString(); |
1866 WebKit::WebTextDirection direction; | 1868 WebKit::WebTextDirection direction; |
1867 if (directionName == "auto") | 1869 if (directionName == "auto") |
1868 direction = WebKit::WebTextDirectionDefault; | 1870 direction = WebKit::WebTextDirectionDefault; |
1869 else if (directionName == "rtl") | 1871 else if (directionName == "rtl") |
1870 direction = WebKit::WebTextDirectionRightToLeft; | 1872 direction = WebKit::WebTextDirectionRightToLeft; |
1871 else if (directionName == "ltr") | 1873 else if (directionName == "ltr") |
1872 direction = WebKit::WebTextDirectionLeftToRight; | 1874 direction = WebKit::WebTextDirectionLeftToRight; |
1873 else | 1875 else |
1874 return; | 1876 return; |
1875 | 1877 |
1876 m_shell->webView()->setTextDirection(direction); | 1878 m_shell->webView()->setTextDirection(direction); |
1877 } | 1879 } |
OLD | NEW |