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

Side by Side Diff: third_party/WebKit/Source/core/frame/FullscreenController.cpp

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Re-add feature flag Created 3 years, 5 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) 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 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (Document* document = ToLocalFrame(frame)->GetDocument()) { 123 if (Document* document = ToLocalFrame(frame)->GetDocument()) {
124 if (Fullscreen* fullscreen = Fullscreen::FromIfExists(*document)) 124 if (Fullscreen* fullscreen = Fullscreen::FromIfExists(*document))
125 fullscreen->DidExitFullscreen(); 125 fullscreen->DidExitFullscreen();
126 } 126 }
127 127
128 // Skip over all descendant frames. 128 // Skip over all descendant frames.
129 while (next_frame && next_frame->Tree().IsDescendantOf(frame)) 129 while (next_frame && next_frame->Tree().IsDescendantOf(frame))
130 next_frame = next_frame->Tree().TraverseNext(); 130 next_frame = next_frame->Tree().TraverseNext();
131 frame = next_frame; 131 frame = next_frame;
132 } 132 }
133 web_view_base_->LayerTreeView()->SetIsFullscreen(false);
133 } 134 }
134 135
135 void FullscreenController::EnterFullscreen(LocalFrame& frame) { 136 void FullscreenController::EnterFullscreen(LocalFrame& frame) {
136 // If already fullscreen or exiting fullscreen, synchronously call 137 // If already fullscreen or exiting fullscreen, synchronously call
137 // |DidEnterFullscreen()|. When exiting, the coming |DidExitFullscreen()| call 138 // |DidEnterFullscreen()|. When exiting, the coming |DidExitFullscreen()| call
138 // will again notify all frames. 139 // will again notify all frames.
139 if (state_ == State::kFullscreen || state_ == State::kExitingFullscreen) { 140 if (state_ == State::kFullscreen || state_ == State::kExitingFullscreen) {
140 State old_state = state_; 141 State old_state = state_;
141 state_ = State::kEnteringFullscreen; 142 state_ = State::kEnteringFullscreen;
142 DidEnterFullscreen(); 143 DidEnterFullscreen();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (!frame->IsLocalFrame()) 247 if (!frame->IsLocalFrame())
247 continue; 248 continue;
248 if (Document* document = ToLocalFrame(frame)->GetDocument()) { 249 if (Document* document = ToLocalFrame(frame)->GetDocument()) {
249 if (Fullscreen* fullscreen = Fullscreen::FromIfExists(*document)) { 250 if (Fullscreen* fullscreen = Fullscreen::FromIfExists(*document)) {
250 if (LayoutFullScreen* layout_object = 251 if (LayoutFullScreen* layout_object =
251 fullscreen->FullScreenLayoutObject()) 252 fullscreen->FullScreenLayoutObject())
252 layout_object->UpdateStyle(); 253 layout_object->UpdateStyle();
253 } 254 }
254 } 255 }
255 } 256 }
257 if (state_ == State::kFullscreen)
258 web_view_base_->LayerTreeView()->SetIsFullscreen(true);
256 } 259 }
257 260
258 void FullscreenController::DidUpdateLayout() { 261 void FullscreenController::DidUpdateLayout() {
259 if (state_ != State::kNeedsScrollAndScaleRestore) 262 if (state_ != State::kNeedsScrollAndScaleRestore)
260 return; 263 return;
261 264
262 web_view_base_->SetPageScaleFactor(initial_page_scale_factor_); 265 web_view_base_->SetPageScaleFactor(initial_page_scale_factor_);
263 if (web_view_base_->MainFrame()->IsWebLocalFrame()) { 266 if (web_view_base_->MainFrame()->IsWebLocalFrame()) {
264 web_view_base_->MainFrame()->ToWebLocalFrame()->SetScrollOffset( 267 web_view_base_->MainFrame()->ToWebLocalFrame()->SetScrollOffset(
265 WebSize(initial_scroll_offset_)); 268 WebSize(initial_scroll_offset_));
(...skipping 23 matching lines...) Expand all
289 // again to ensure the final constraints pick up the latest contents size. 292 // again to ensure the final constraints pick up the latest contents size.
290 web_view_base_->DidChangeContentsSize(); 293 web_view_base_->DidChangeContentsSize();
291 if (web_view_base_->MainFrameImpl() && 294 if (web_view_base_->MainFrameImpl() &&
292 web_view_base_->MainFrameImpl()->GetFrameView()) 295 web_view_base_->MainFrameImpl()->GetFrameView())
293 web_view_base_->MainFrameImpl()->GetFrameView()->SetNeedsLayout(); 296 web_view_base_->MainFrameImpl()->GetFrameView()->SetNeedsLayout();
294 297
295 web_view_base_->UpdateMainFrameLayoutSize(); 298 web_view_base_->UpdateMainFrameLayoutSize();
296 } 299 }
297 300
298 } // namespace blink 301 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698