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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 3574
3575 void WebViewImpl::setBaseBackgroundColor(WebColor color) { 3575 void WebViewImpl::setBaseBackgroundColor(WebColor color) {
3576 if (m_baseBackgroundColor == color) 3576 if (m_baseBackgroundColor == color)
3577 return; 3577 return;
3578 3578
3579 m_baseBackgroundColor = color; 3579 m_baseBackgroundColor = color;
3580 updateBaseBackgroundColor(); 3580 updateBaseBackgroundColor();
3581 } 3581 }
3582 3582
3583 void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) { 3583 void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) {
3584 if (m_baseBackgroundColorOverrideEnabled &&
3585 m_baseBackgroundColorOverride == color) {
3586 return;
3587 }
3588
3584 m_baseBackgroundColorOverrideEnabled = true; 3589 m_baseBackgroundColorOverrideEnabled = true;
3585 m_baseBackgroundColorOverride = color; 3590 m_baseBackgroundColorOverride = color;
3586 if (mainFrameImpl()) { 3591 if (mainFrameImpl()) {
3587 // Force lifecycle update to ensure we're good to call 3592 // Force lifecycle update to ensure we're good to call
3588 // FrameView::setBaseBackgroundColor(). 3593 // FrameView::setBaseBackgroundColor().
3589 mainFrameImpl() 3594 mainFrameImpl()
3590 ->frame() 3595 ->frame()
3591 ->view() 3596 ->view()
3592 ->updateLifecycleToCompositingCleanPlusScrolling(); 3597 ->updateLifecycleToCompositingCleanPlusScrolling();
3593 } 3598 }
3594 updateBaseBackgroundColor(); 3599 updateBaseBackgroundColor();
3595 } 3600 }
3596 3601
3597 void WebViewImpl::clearBaseBackgroundColorOverride() { 3602 void WebViewImpl::clearBaseBackgroundColorOverride() {
3603 if (!m_baseBackgroundColorOverrideEnabled)
3604 return;
3605
3598 m_baseBackgroundColorOverrideEnabled = false; 3606 m_baseBackgroundColorOverrideEnabled = false;
3599 if (mainFrameImpl()) { 3607 if (mainFrameImpl()) {
3600 // Force lifecycle update to ensure we're good to call 3608 // Force lifecycle update to ensure we're good to call
3601 // FrameView::setBaseBackgroundColor(). 3609 // FrameView::setBaseBackgroundColor().
3602 mainFrameImpl() 3610 mainFrameImpl()
3603 ->frame() 3611 ->frame()
3604 ->view() 3612 ->view()
3605 ->updateLifecycleToCompositingCleanPlusScrolling(); 3613 ->updateLifecycleToCompositingCleanPlusScrolling();
3606 } 3614 }
3607 updateBaseBackgroundColor(); 3615 updateBaseBackgroundColor();
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
4178 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4186 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4179 return nullptr; 4187 return nullptr;
4180 return focusedFrame; 4188 return focusedFrame;
4181 } 4189 }
4182 4190
4183 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4191 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4184 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4192 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4185 } 4193 }
4186 4194
4187 } // namespace blink 4195 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698