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

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

Issue 2804983003: [blink] Use early returns in baseBackgroundColor(Override) setters. (Closed)
Patch Set: Revert compositing update fix, keep other changes. Created 3 years, 8 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 m_backgroundColorOverride = color; 295 m_backgroundColorOverride = color;
296 updateLayerTreeBackgroundColor(); 296 updateLayerTreeBackgroundColor();
297 } 297 }
298 298
299 void WebFrameWidgetImpl::clearBackgroundColorOverride() { 299 void WebFrameWidgetImpl::clearBackgroundColorOverride() {
300 m_backgroundColorOverrideEnabled = false; 300 m_backgroundColorOverrideEnabled = false;
301 updateLayerTreeBackgroundColor(); 301 updateLayerTreeBackgroundColor();
302 } 302 }
303 303
304 void WebFrameWidgetImpl::setBaseBackgroundColorOverride(WebColor color) { 304 void WebFrameWidgetImpl::setBaseBackgroundColorOverride(WebColor color) {
305 if (m_baseBackgroundColorOverrideEnabled &&
306 m_baseBackgroundColorOverride == color) {
307 return;
308 }
309
305 m_baseBackgroundColorOverrideEnabled = true; 310 m_baseBackgroundColorOverrideEnabled = true;
306 m_baseBackgroundColorOverride = color; 311 m_baseBackgroundColorOverride = color;
312 // Force lifecycle update to ensure we're good to call
313 // FrameView::setBaseBackgroundColor().
314 m_localRoot->frameView()->updateLifecycleToCompositingCleanPlusScrolling();
307 updateBaseBackgroundColor(); 315 updateBaseBackgroundColor();
308 } 316 }
309 317
310 void WebFrameWidgetImpl::clearBaseBackgroundColorOverride() { 318 void WebFrameWidgetImpl::clearBaseBackgroundColorOverride() {
319 if (!m_baseBackgroundColorOverrideEnabled)
320 return;
321
311 m_baseBackgroundColorOverrideEnabled = false; 322 m_baseBackgroundColorOverrideEnabled = false;
323 // Force lifecycle update to ensure we're good to call
324 // FrameView::setBaseBackgroundColor().
325 m_localRoot->frameView()->updateLifecycleToCompositingCleanPlusScrolling();
312 updateBaseBackgroundColor(); 326 updateBaseBackgroundColor();
313 } 327 }
314 328
315 void WebFrameWidgetImpl::layoutAndPaintAsync( 329 void WebFrameWidgetImpl::layoutAndPaintAsync(
316 WebLayoutAndPaintAsyncCallback* callback) { 330 WebLayoutAndPaintAsyncCallback* callback) {
317 m_layerTreeView->layoutAndPaintAsync(callback); 331 m_layerTreeView->layoutAndPaintAsync(callback);
318 } 332 }
319 333
320 void WebFrameWidgetImpl::compositeAndReadbackAsync( 334 void WebFrameWidgetImpl::compositeAndReadbackAsync(
321 WebCompositeAndReadbackAsyncCallback* callback) { 335 WebCompositeAndReadbackAsyncCallback* callback) {
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 return nullptr; 1172 return nullptr;
1159 } 1173 }
1160 1174
1161 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1175 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1162 if (!m_imeAcceptEvents) 1176 if (!m_imeAcceptEvents)
1163 return nullptr; 1177 return nullptr;
1164 return focusedLocalFrameInWidget(); 1178 return focusedLocalFrameInWidget();
1165 } 1179 }
1166 1180
1167 } // namespace blink 1181 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698