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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1731373002: Allow to have a transparent UA dependent background. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decouple background color and transparency in RenderWidgetHostView Created 4 years, 9 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, 1375 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse,
1376 OnEnumerateDirectoryResponse) 1376 OnEnumerateDirectoryResponse)
1377 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) 1377 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse)
1378 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut, 1378 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut,
1379 OnSuppressDialogsUntilSwapOut) 1379 OnSuppressDialogsUntilSwapOut)
1380 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 1380 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
1381 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) 1381 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged)
1382 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) 1382 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
1383 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) 1383 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement)
1384 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) 1384 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque)
1385 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundColor, OnSetBackgroundColor)
1385 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, 1386 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode,
1386 OnEnablePreferredSizeChangedMode) 1387 OnEnablePreferredSizeChangedMode)
1387 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) 1388 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize)
1388 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) 1389 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize)
1389 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, 1390 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows,
1390 OnDisableScrollbarsForSmallWindows) 1391 OnDisableScrollbarsForSmallWindows)
1391 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) 1392 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
1392 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) 1393 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
1393 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) 1394 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt)
1394 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) 1395 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 webview()->clearFocusedElement(); 2781 webview()->clearFocusedElement();
2781 } 2782 }
2782 2783
2783 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { 2784 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) {
2784 if (frame_widget_) 2785 if (frame_widget_)
2785 frame_widget_->setIsTransparent(!opaque); 2786 frame_widget_->setIsTransparent(!opaque);
2786 if (compositor_) 2787 if (compositor_)
2787 compositor_->setHasTransparentBackground(!opaque); 2788 compositor_->setHasTransparentBackground(!opaque);
2788 } 2789 }
2789 2790
2791 void RenderViewImpl::OnSetBackgroundColor(SkColor color) {
2792 webview()->setBaseBackgroundColor(color);
2793 compositor_->setBackgroundColor(color);
2794 }
2795
2790 void RenderViewImpl::OnSetActive(bool active) { 2796 void RenderViewImpl::OnSetActive(bool active) {
2791 if (webview()) 2797 if (webview())
2792 webview()->setIsActive(active); 2798 webview()->setIsActive(active);
2793 2799
2794 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX) 2800 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX)
2795 std::set<WebPluginDelegateProxy*>::iterator plugin_it; 2801 std::set<WebPluginDelegateProxy*>::iterator plugin_it;
2796 for (plugin_it = plugin_delegates_.begin(); 2802 for (plugin_it = plugin_delegates_.begin();
2797 plugin_it != plugin_delegates_.end(); ++plugin_it) { 2803 plugin_it != plugin_delegates_.end(); ++plugin_it) {
2798 (*plugin_it)->SetWindowFocus(active); 2804 (*plugin_it)->SetWindowFocus(active);
2799 } 2805 }
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
3549 if (IsUseZoomForDSFEnabled()) { 3555 if (IsUseZoomForDSFEnabled()) {
3550 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3556 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3551 } else { 3557 } else {
3552 webview()->setDeviceScaleFactor(device_scale_factor_); 3558 webview()->setDeviceScaleFactor(device_scale_factor_);
3553 } 3559 }
3554 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3560 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3555 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3561 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3556 } 3562 }
3557 3563
3558 } // namespace content 3564 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698