OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 #include "public/web/WebFrame.h" | 139 #include "public/web/WebFrame.h" |
140 #include "public/web/WebFrameClient.h" | 140 #include "public/web/WebFrameClient.h" |
141 #include "public/web/WebHitTestResult.h" | 141 #include "public/web/WebHitTestResult.h" |
142 #include "public/web/WebInputElement.h" | 142 #include "public/web/WebInputElement.h" |
143 #include "public/web/WebMeaningfulLayout.h" | 143 #include "public/web/WebMeaningfulLayout.h" |
144 #include "public/web/WebMediaPlayerAction.h" | 144 #include "public/web/WebMediaPlayerAction.h" |
145 #include "public/web/WebNode.h" | 145 #include "public/web/WebNode.h" |
146 #include "public/web/WebPlugin.h" | 146 #include "public/web/WebPlugin.h" |
147 #include "public/web/WebPluginAction.h" | 147 #include "public/web/WebPluginAction.h" |
148 #include "public/web/WebRange.h" | 148 #include "public/web/WebRange.h" |
| 149 #include "public/web/WebScopedUserGesture.h" |
149 #include "public/web/WebSelection.h" | 150 #include "public/web/WebSelection.h" |
150 #include "public/web/WebTextInputInfo.h" | 151 #include "public/web/WebTextInputInfo.h" |
151 #include "public/web/WebViewClient.h" | 152 #include "public/web/WebViewClient.h" |
152 #include "public/web/WebWindowFeatures.h" | 153 #include "public/web/WebWindowFeatures.h" |
153 #include "web/CompositionUnderlineVectorBuilder.h" | 154 #include "web/CompositionUnderlineVectorBuilder.h" |
154 #include "web/ContextFeaturesClientImpl.h" | 155 #include "web/ContextFeaturesClientImpl.h" |
155 #include "web/ContextMenuAllowedScope.h" | 156 #include "web/ContextMenuAllowedScope.h" |
156 #include "web/DatabaseClientImpl.h" | 157 #include "web/DatabaseClientImpl.h" |
157 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" | 158 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" |
158 #include "web/DevToolsEmulator.h" | 159 #include "web/DevToolsEmulator.h" |
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 | 1935 |
1935 void WebViewImpl::resize(const WebSize& newSize) | 1936 void WebViewImpl::resize(const WebSize& newSize) |
1936 { | 1937 { |
1937 if (m_shouldAutoResize || m_size == newSize) | 1938 if (m_shouldAutoResize || m_size == newSize) |
1938 return; | 1939 return; |
1939 | 1940 |
1940 resizeWithTopControls( | 1941 resizeWithTopControls( |
1941 newSize, topControls().height(), topControls().shrinkViewport()); | 1942 newSize, topControls().height(), topControls().shrinkViewport()); |
1942 } | 1943 } |
1943 | 1944 |
| 1945 void WebViewImpl::willEnterFullScreen(WebRemoteFrame* fullscreenFrame) |
| 1946 { |
| 1947 FrameOwner* owner = toWebRemoteFrameImpl(fullscreenFrame)->frame()->owner(); |
| 1948 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner); |
| 1949 |
| 1950 // Let FullscreenController know that |ownerElement| is an ancestor of the |
| 1951 // actual fullscreen element, so that it can be treated a little |
| 1952 // differently: |
| 1953 // - it will need :-webkit-full-screen-ancestor style in addition to |
| 1954 // :-webkit-full-screen. |
| 1955 // - it does not need to resend the ToggleFullscreen IPC to the browser |
| 1956 // process. |
| 1957 m_fullscreenController->setFullscreenIsForCrossProcessAncestor(); |
| 1958 |
| 1959 // Call requestFullscreen() on |ownerElement| to make it the provisional |
| 1960 // fullscreen element in FullscreenController, and to prepare |
| 1961 // fullscreenchange events that will need to fire on it and its (local) |
| 1962 // ancestors. The events will be triggered if/when fullscreen is entered. |
| 1963 // Note that requestFullscreen() requires a user gesture. |
| 1964 // |
| 1965 // TODO(alexmos): currently, this assumes prefixed requests, but in the |
| 1966 // future, this should plumb in information about which request type |
| 1967 // (prefixed or unprefixed) to use for firing fullscreen events. |
| 1968 { |
| 1969 WebScopedUserGesture userGesture; |
| 1970 Fullscreen::from(ownerElement->document()).requestFullscreen(*ownerEleme
nt, Fullscreen::PrefixedRequest); |
| 1971 } |
| 1972 } |
| 1973 |
1944 void WebViewImpl::didEnterFullScreen() | 1974 void WebViewImpl::didEnterFullScreen() |
1945 { | 1975 { |
1946 m_fullscreenController->didEnterFullScreen(); | 1976 m_fullscreenController->didEnterFullScreen(); |
1947 } | 1977 } |
1948 | 1978 |
1949 void WebViewImpl::didExitFullScreen() | 1979 void WebViewImpl::didExitFullScreen() |
1950 { | 1980 { |
1951 m_fullscreenController->didExitFullScreen(); | 1981 m_fullscreenController->didExitFullScreen(); |
1952 } | 1982 } |
1953 | 1983 |
| 1984 void WebViewImpl::didUpdateFullScreenSize() |
| 1985 { |
| 1986 m_fullscreenController->updateSize(); |
| 1987 } |
| 1988 |
1954 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) | 1989 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) |
1955 { | 1990 { |
1956 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM
onotonic); | 1991 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM
onotonic); |
1957 DCHECK(lastFrameTimeMonotonic); | 1992 DCHECK(lastFrameTimeMonotonic); |
1958 | 1993 |
1959 // Create synthetic wheel events as necessary for fling. | 1994 // Create synthetic wheel events as necessary for fling. |
1960 if (m_gestureAnimation) { | 1995 if (m_gestureAnimation) { |
1961 if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) | 1996 if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) |
1962 scheduleAnimation(); | 1997 scheduleAnimation(); |
1963 else { | 1998 else { |
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4524 { | 4559 { |
4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4560 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4561 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4527 if (!page()) | 4562 if (!page()) |
4528 return 1; | 4563 return 1; |
4529 | 4564 |
4530 return page()->deviceScaleFactor(); | 4565 return page()->deviceScaleFactor(); |
4531 } | 4566 } |
4532 | 4567 |
4533 } // namespace blink | 4568 } // namespace blink |
OLD | NEW |