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" | |
150 #include "public/web/WebSelection.h" | 149 #include "public/web/WebSelection.h" |
151 #include "public/web/WebTextInputInfo.h" | 150 #include "public/web/WebTextInputInfo.h" |
152 #include "public/web/WebViewClient.h" | 151 #include "public/web/WebViewClient.h" |
153 #include "public/web/WebWindowFeatures.h" | 152 #include "public/web/WebWindowFeatures.h" |
154 #include "web/CompositionUnderlineVectorBuilder.h" | 153 #include "web/CompositionUnderlineVectorBuilder.h" |
155 #include "web/ContextFeaturesClientImpl.h" | 154 #include "web/ContextFeaturesClientImpl.h" |
156 #include "web/ContextMenuAllowedScope.h" | 155 #include "web/ContextMenuAllowedScope.h" |
157 #include "web/DatabaseClientImpl.h" | 156 #include "web/DatabaseClientImpl.h" |
158 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" | 157 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" |
159 #include "web/DevToolsEmulator.h" | 158 #include "web/DevToolsEmulator.h" |
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 | 1934 |
1936 void WebViewImpl::resize(const WebSize& newSize) | 1935 void WebViewImpl::resize(const WebSize& newSize) |
1937 { | 1936 { |
1938 if (m_shouldAutoResize || m_size == newSize) | 1937 if (m_shouldAutoResize || m_size == newSize) |
1939 return; | 1938 return; |
1940 | 1939 |
1941 resizeWithTopControls( | 1940 resizeWithTopControls( |
1942 newSize, topControls().height(), topControls().shrinkViewport()); | 1941 newSize, topControls().height(), topControls().shrinkViewport()); |
1943 } | 1942 } |
1944 | 1943 |
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 | |
1974 void WebViewImpl::didEnterFullScreen() | 1944 void WebViewImpl::didEnterFullScreen() |
1975 { | 1945 { |
1976 m_fullscreenController->didEnterFullScreen(); | 1946 m_fullscreenController->didEnterFullScreen(); |
1977 } | 1947 } |
1978 | 1948 |
1979 void WebViewImpl::didExitFullScreen() | 1949 void WebViewImpl::didExitFullScreen() |
1980 { | 1950 { |
1981 m_fullscreenController->didExitFullScreen(); | 1951 m_fullscreenController->didExitFullScreen(); |
1982 } | 1952 } |
1983 | 1953 |
1984 void WebViewImpl::didUpdateFullScreenSize() | |
1985 { | |
1986 m_fullscreenController->updateSize(); | |
1987 } | |
1988 | |
1989 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) | 1954 void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) |
1990 { | 1955 { |
1991 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM
onotonic); | 1956 TRACE_EVENT1("blink", "WebViewImpl::beginFrame", "frameTime", lastFrameTimeM
onotonic); |
1992 DCHECK(lastFrameTimeMonotonic); | 1957 DCHECK(lastFrameTimeMonotonic); |
1993 | 1958 |
1994 // Create synthetic wheel events as necessary for fling. | 1959 // Create synthetic wheel events as necessary for fling. |
1995 if (m_gestureAnimation) { | 1960 if (m_gestureAnimation) { |
1996 if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) | 1961 if (m_gestureAnimation->animate(lastFrameTimeMonotonic)) |
1997 scheduleAnimation(); | 1962 scheduleAnimation(); |
1998 else { | 1963 else { |
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4559 { | 4524 { |
4560 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4525 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4561 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4526 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4562 if (!page()) | 4527 if (!page()) |
4563 return 1; | 4528 return 1; |
4564 | 4529 |
4565 return page()->deviceScaleFactor(); | 4530 return page()->deviceScaleFactor(); |
4566 } | 4531 } |
4567 | 4532 |
4568 } // namespace blink | 4533 } // namespace blink |
OLD | NEW |