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