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

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

Issue 2383473002: [scheduler] Teach scheduler about audio state (Closed)
Patch Set: Switched approach to use WebContentsImpl::WasRecentlyAudible Created 4 years, 2 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 #include <memory> 9 #include <memory>
10 10
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 OnDisableScrollbarsForSmallWindows) 1344 OnDisableScrollbarsForSmallWindows)
1345 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) 1345 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
1346 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) 1346 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
1347 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) 1347 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt)
1348 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) 1348 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
1349 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) 1349 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu)
1350 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, 1350 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap,
1351 OnReleaseDisambiguationPopupBitmap) 1351 OnReleaseDisambiguationPopupBitmap)
1352 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) 1352 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
1353 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) 1353 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
1354 IPC_MESSAGE_HANDLER(ViewMsg_AudioStateChanged, OnAudioStateChanged)
1354 1355
1355 // Page messages. 1356 // Page messages.
1356 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect, 1357 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect,
1357 OnUpdateWindowScreenRect) 1358 OnUpdateWindowScreenRect)
1358 IPC_MESSAGE_HANDLER(PageMsg_SetZoomLevel, OnSetZoomLevel) 1359 IPC_MESSAGE_HANDLER(PageMsg_SetZoomLevel, OnSetZoomLevel)
1359 IPC_MESSAGE_HANDLER(PageMsg_SetDeviceScaleFactor, OnSetDeviceScaleFactor); 1360 IPC_MESSAGE_HANDLER(PageMsg_SetDeviceScaleFactor, OnSetDeviceScaleFactor);
1360 IPC_MESSAGE_HANDLER(PageMsg_WasHidden, OnPageWasHidden) 1361 IPC_MESSAGE_HANDLER(PageMsg_WasHidden, OnPageWasHidden)
1361 IPC_MESSAGE_HANDLER(PageMsg_WasShown, OnPageWasShown) 1362 IPC_MESSAGE_HANDLER(PageMsg_WasShown, OnPageWasShown)
1362 IPC_MESSAGE_HANDLER(PageMsg_SetHistoryOffsetAndLength, 1363 IPC_MESSAGE_HANDLER(PageMsg_SetHistoryOffsetAndLength,
1363 OnSetHistoryOffsetAndLength) 1364 OnSetHistoryOffsetAndLength)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 void RenderViewImpl::OnSetInitialFocus(bool reverse) { 1446 void RenderViewImpl::OnSetInitialFocus(bool reverse) {
1446 if (!webview()) 1447 if (!webview())
1447 return; 1448 return;
1448 webview()->setInitialFocus(reverse); 1449 webview()->setInitialFocus(reverse);
1449 } 1450 }
1450 1451
1451 void RenderViewImpl::OnUpdateWindowScreenRect(gfx::Rect window_screen_rect) { 1452 void RenderViewImpl::OnUpdateWindowScreenRect(gfx::Rect window_screen_rect) {
1452 RenderWidget::OnUpdateWindowScreenRect(window_screen_rect); 1453 RenderWidget::OnUpdateWindowScreenRect(window_screen_rect);
1453 } 1454 }
1454 1455
1456 void RenderViewImpl::OnAudioStateChanged(bool is_audio_playing) {
1457 webview()->audioStateChanged(is_audio_playing);
1458 }
1459
1455 /////////////////////////////////////////////////////////////////////////////// 1460 ///////////////////////////////////////////////////////////////////////////////
1456 1461
1457 void RenderViewImpl::SendUpdateState() { 1462 void RenderViewImpl::SendUpdateState() {
1458 // We don't use this path in OOPIF-enabled modes. 1463 // We don't use this path in OOPIF-enabled modes.
1459 DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries()); 1464 DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries());
1460 1465
1461 HistoryEntry* entry = history_controller_->GetCurrentEntry(); 1466 HistoryEntry* entry = history_controller_->GetCurrentEntry();
1462 if (!entry) 1467 if (!entry)
1463 return; 1468 return;
1464 1469
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 if (IsUseZoomForDSFEnabled()) { 3019 if (IsUseZoomForDSFEnabled()) {
3015 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3020 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3016 } else { 3021 } else {
3017 webview()->setDeviceScaleFactor(device_scale_factor_); 3022 webview()->setDeviceScaleFactor(device_scale_factor_);
3018 } 3023 }
3019 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3024 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3020 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3025 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3021 } 3026 }
3022 3027
3023 } // namespace content 3028 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698