Chromium Code Reviews| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 m_tabsToLinks(false), | 366 m_tabsToLinks(false), |
| 367 m_layerTreeView(nullptr), | 367 m_layerTreeView(nullptr), |
| 368 m_rootLayer(nullptr), | 368 m_rootLayer(nullptr), |
| 369 m_rootGraphicsLayer(nullptr), | 369 m_rootGraphicsLayer(nullptr), |
| 370 m_visualViewportContainerLayer(nullptr), | 370 m_visualViewportContainerLayer(nullptr), |
| 371 m_matchesHeuristicsForGpuRasterization(false), | 371 m_matchesHeuristicsForGpuRasterization(false), |
| 372 m_flingModifier(0), | 372 m_flingModifier(0), |
| 373 m_flingSourceDevice(WebGestureDeviceUninitialized), | 373 m_flingSourceDevice(WebGestureDeviceUninitialized), |
| 374 m_fullscreenController(FullscreenController::create(this)), | 374 m_fullscreenController(FullscreenController::create(this)), |
| 375 m_baseBackgroundColor(Color::white), | 375 m_baseBackgroundColor(Color::white), |
| 376 m_baseBackgroundColorOverride(Color::transparent), | |
| 376 m_backgroundColorOverride(Color::transparent), | 377 m_backgroundColorOverride(Color::transparent), |
| 377 m_zoomFactorOverride(0), | 378 m_zoomFactorOverride(0), |
| 378 m_userGestureObserved(false), | 379 m_userGestureObserved(false), |
| 379 m_shouldDispatchFirstVisuallyNonEmptyLayout(false), | 380 m_shouldDispatchFirstVisuallyNonEmptyLayout(false), |
| 380 m_shouldDispatchFirstLayoutAfterFinishedParsing(false), | 381 m_shouldDispatchFirstLayoutAfterFinishedParsing(false), |
| 381 m_shouldDispatchFirstLayoutAfterFinishedLoading(false), | 382 m_shouldDispatchFirstLayoutAfterFinishedLoading(false), |
| 382 m_displayMode(WebDisplayModeBrowser), | 383 m_displayMode(WebDisplayModeBrowser), |
| 383 m_elasticOverscroll(FloatSize()), | 384 m_elasticOverscroll(FloatSize()), |
| 384 m_mutator(nullptr), | 385 m_mutator(nullptr), |
| 385 m_scheduler(WTF::wrapUnique(Platform::current() | 386 m_scheduler(WTF::wrapUnique(Platform::current() |
| (...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3565 | 3566 |
| 3566 bool WebViewImpl::isTransparent() const { | 3567 bool WebViewImpl::isTransparent() const { |
| 3567 return m_isTransparent; | 3568 return m_isTransparent; |
| 3568 } | 3569 } |
| 3569 | 3570 |
| 3570 WebInputMethodControllerImpl* WebViewImpl::getActiveWebInputMethodController() | 3571 WebInputMethodControllerImpl* WebViewImpl::getActiveWebInputMethodController() |
| 3571 const { | 3572 const { |
| 3572 return WebInputMethodControllerImpl::fromFrame(focusedLocalFrameInWidget()); | 3573 return WebInputMethodControllerImpl::fromFrame(focusedLocalFrameInWidget()); |
| 3573 } | 3574 } |
| 3574 | 3575 |
| 3576 Color WebViewImpl::baseBackgroundColor() const { | |
| 3577 return alphaChannel(m_baseBackgroundColorOverride) | |
| 3578 ? m_baseBackgroundColorOverride | |
| 3579 : m_baseBackgroundColor; | |
| 3580 } | |
| 3581 | |
| 3575 void WebViewImpl::setBaseBackgroundColor(WebColor color) { | 3582 void WebViewImpl::setBaseBackgroundColor(WebColor color) { |
| 3576 if (m_baseBackgroundColor == color) | 3583 if (m_baseBackgroundColor == color) |
| 3577 return; | 3584 return; |
| 3578 | 3585 |
| 3579 m_baseBackgroundColor = color; | 3586 m_baseBackgroundColor = color; |
| 3587 updateBaseBackgroundColor(); | |
| 3588 } | |
| 3580 | 3589 |
| 3590 void WebViewImpl::setBaseBackgroundColorOverride(WebColor color) { | |
| 3591 m_baseBackgroundColorOverride = color; | |
| 3592 updateBaseBackgroundColor(); | |
| 3593 } | |
| 3594 | |
| 3595 void WebViewImpl::updateBaseBackgroundColor() { | |
| 3596 WebColor color = alphaChannel(m_baseBackgroundColorOverride) | |
|
dgozman
2017/01/26 00:04:17
Use baseBackgroundColor().
Eric Seckler
2017/02/06 23:54:37
Done.
| |
| 3597 ? m_baseBackgroundColorOverride | |
| 3598 : m_baseBackgroundColor; | |
| 3581 if (m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()) | 3599 if (m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()) |
| 3582 m_page->deprecatedLocalMainFrame()->view()->setBaseBackgroundColor(color); | 3600 m_page->deprecatedLocalMainFrame()->view()->setBaseBackgroundColor(color); |
| 3583 } | 3601 } |
| 3584 | 3602 |
| 3585 void WebViewImpl::setIsActive(bool active) { | 3603 void WebViewImpl::setIsActive(bool active) { |
| 3586 if (page()) | 3604 if (page()) |
| 3587 page()->focusController().setActive(active); | 3605 page()->focusController().setActive(active); |
| 3588 } | 3606 } |
| 3589 | 3607 |
| 3590 bool WebViewImpl::isActive() const { | 3608 bool WebViewImpl::isActive() const { |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4187 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4205 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4188 return nullptr; | 4206 return nullptr; |
| 4189 return focusedFrame; | 4207 return focusedFrame; |
| 4190 } | 4208 } |
| 4191 | 4209 |
| 4192 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4210 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4193 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4211 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4194 } | 4212 } |
| 4195 | 4213 |
| 4196 } // namespace blink | 4214 } // namespace blink |
| OLD | NEW |