OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 10 matching lines...) Expand all Loading... |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ViewportStyle_h | 26 #ifndef ViewportStyle_h |
27 #define ViewportStyle_h | 27 #define ViewportStyle_h |
28 | 28 |
29 #include "wtf/text/WTFString.h" | 29 #include "wtf/text/WTFString.h" |
30 | 30 |
| 31 namespace blink { |
| 32 namespace FrameTestHelpers { |
| 33 class ReplaceViewportUAStylesheet; |
| 34 } |
| 35 } |
| 36 |
31 namespace WebCore { | 37 namespace WebCore { |
32 | 38 |
33 class ViewportStyle { | 39 class ViewportStyle { |
34 public: | 40 public: |
35 static String viewportStyleSheet(); | 41 static String viewportStyleSheet() |
| 42 { |
| 43 if (!styleOverrideString().isEmpty()) |
| 44 return styleOverrideString(); |
| 45 |
| 46 return platformStyleSheet(); |
| 47 } |
| 48 |
| 49 private: |
| 50 // Implemented in platform-dependent files to return the viewport style to |
| 51 // use on specific platforms. |
| 52 static String platformStyleSheet(); |
| 53 |
| 54 // Allows tests to override the platform specific stylesheet |
| 55 friend class blink::FrameTestHelpers::ReplaceViewportUAStylesheet; |
| 56 static String& styleOverrideString() |
| 57 { |
| 58 static String &styleString = *new String(); |
| 59 return styleString; |
| 60 } |
36 }; | 61 }; |
37 | 62 |
38 } // namespace WebCore | 63 } // namespace WebCore |
39 | 64 |
40 #endif // ViewportStyle_h | 65 #endif // ViewportStyle_h |
OLD | NEW |