Index: Source/core/css/ViewportStyle.h |
diff --git a/Source/core/css/ViewportStyle.h b/Source/core/css/ViewportStyle.h |
index 903ad0fe81c180def8cb398c337f5fc8e1224d4e..44d42d5dc81a6a92af1362d79d52c3e930dbb674 100644 |
--- a/Source/core/css/ViewportStyle.h |
+++ b/Source/core/css/ViewportStyle.h |
@@ -28,11 +28,36 @@ |
#include "wtf/text/WTFString.h" |
+namespace blink { |
+namespace FrameTestHelpers { |
+class ReplaceViewportUAStylesheet; |
+} |
+} |
+ |
namespace WebCore { |
class ViewportStyle { |
public: |
- static String viewportStyleSheet(); |
+ static String viewportStyleSheet() |
+ { |
+ if (!styleOverrideString().isEmpty()) |
+ return styleOverrideString(); |
+ |
+ return platformStyleSheet(); |
+ } |
+ |
+private: |
+ // Implemented in platform-dependent files to return the viewport style to |
+ // use on specific platforms. |
+ static String platformStyleSheet(); |
+ |
+ // Allows tests to override the platform specific stylesheet |
+ friend class blink::FrameTestHelpers::ReplaceViewportUAStylesheet; |
+ static String& styleOverrideString() |
+ { |
+ static String &styleString = *new String(); |
+ return styleString; |
+ } |
}; |
} // namespace WebCore |