Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2021513002: Move willEnterFullscreen to WebRemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about user gestures Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 1940
1941 void WebViewImpl::resize(const WebSize& newSize) 1941 void WebViewImpl::resize(const WebSize& newSize)
1942 { 1942 {
1943 if (m_shouldAutoResize || m_size == newSize) 1943 if (m_shouldAutoResize || m_size == newSize)
1944 return; 1944 return;
1945 1945
1946 resizeWithTopControls( 1946 resizeWithTopControls(
1947 newSize, topControls().height(), topControls().shrinkViewport()); 1947 newSize, topControls().height(), topControls().shrinkViewport());
1948 } 1948 }
1949 1949
1950 void WebViewImpl::willEnterFullScreen(WebRemoteFrame* fullscreenFrame)
1951 {
1952 FrameOwner* owner = toWebRemoteFrameImpl(fullscreenFrame)->frame()->owner();
1953 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(owner);
1954
1955 // Let FullscreenController know that |ownerElement| is an ancestor of the
1956 // actual fullscreen element, so that it can be treated a little
1957 // differently:
1958 // - it will need :-webkit-full-screen-ancestor style in addition to
1959 // :-webkit-full-screen.
1960 // - it does not need to resend the ToggleFullscreen IPC to the browser
1961 // process.
1962 m_fullscreenController->setFullscreenIsForCrossProcessAncestor();
1963
1964 // Call requestFullscreen() on |ownerElement| to make it the provisional
1965 // fullscreen element in FullscreenController, and to prepare
1966 // fullscreenchange events that will need to fire on it and its (local)
1967 // ancestors. The events will be triggered if/when fullscreen is entered.
1968 // Note that requestFullscreen() requires a user gesture.
1969 //
1970 // TODO(alexmos): currently, this assumes prefixed requests, but in the
1971 // future, this should plumb in information about which request type
1972 // (prefixed or unprefixed) to use for firing fullscreen events.
1973 {
1974 WebScopedUserGesture userGesture;
1975 Fullscreen::from(ownerElement->document()).requestFullscreen(*ownerEleme nt, Fullscreen::PrefixedRequest);
1976 }
1977 }
1978
1979 void WebViewImpl::didEnterFullScreen() 1950 void WebViewImpl::didEnterFullScreen()
1980 { 1951 {
1981 m_fullscreenController->didEnterFullScreen(); 1952 m_fullscreenController->didEnterFullScreen();
1982 } 1953 }
1983 1954
1984 void WebViewImpl::didExitFullScreen() 1955 void WebViewImpl::didExitFullScreen()
1985 { 1956 {
1986 m_fullscreenController->didExitFullScreen(); 1957 m_fullscreenController->didExitFullScreen();
1987 } 1958 }
1988 1959
(...skipping 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after
4597 { 4568 {
4598 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4569 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4599 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4570 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4600 if (!page()) 4571 if (!page())
4601 return 1; 4572 return 1;
4602 4573
4603 return page()->deviceScaleFactor(); 4574 return page()->deviceScaleFactor();
4604 } 4575 }
4605 4576
4606 } // namespace blink 4577 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebRemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698