OLD | NEW |
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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 host_zoom_map->SetTemporaryZoomLevel( | 1761 host_zoom_map->SetTemporaryZoomLevel( |
1762 GetProcess()->GetID(), GetRoutingID(), zoom_level); | 1762 GetProcess()->GetID(), GetRoutingID(), zoom_level); |
1763 } | 1763 } |
1764 } | 1764 } |
1765 | 1765 |
1766 void RenderViewHostImpl::OnMediaNotification(int64 player_cookie, | 1766 void RenderViewHostImpl::OnMediaNotification(int64 player_cookie, |
1767 bool has_video, | 1767 bool has_video, |
1768 bool has_audio, | 1768 bool has_audio, |
1769 bool is_playing) { | 1769 bool is_playing) { |
1770 if (is_playing) { | 1770 if (is_playing) { |
1771 content::PowerSaveBlocker* blocker = NULL; | 1771 PowerSaveBlocker* blocker = NULL; |
1772 if (has_video) { | 1772 if (has_video) { |
1773 blocker = new content::PowerSaveBlocker( | 1773 blocker = new PowerSaveBlocker( |
1774 content::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 1774 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
1775 "Playing video"); | 1775 "Playing video"); |
1776 } else if (has_audio) { | 1776 } else if (has_audio) { |
1777 blocker = new content::PowerSaveBlocker( | 1777 blocker = new PowerSaveBlocker( |
1778 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, | 1778 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, |
1779 "Playing audio"); | 1779 "Playing audio"); |
1780 } | 1780 } |
1781 | 1781 |
1782 if (blocker) | 1782 if (blocker) |
1783 power_save_blockers_[player_cookie] = blocker; | 1783 power_save_blockers_[player_cookie] = blocker; |
1784 } else { | 1784 } else { |
1785 delete power_save_blockers_[player_cookie]; | 1785 delete power_save_blockers_[player_cookie]; |
1786 power_save_blockers_.erase(player_cookie); | 1786 power_save_blockers_.erase(player_cookie); |
1787 } | 1787 } |
1788 } | 1788 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 // can cause navigations to be ignored in OnMsgNavigate. | 1851 // can cause navigations to be ignored in OnMsgNavigate. |
1852 is_waiting_for_beforeunload_ack_ = false; | 1852 is_waiting_for_beforeunload_ack_ = false; |
1853 is_waiting_for_unload_ack_ = false; | 1853 is_waiting_for_unload_ack_ = false; |
1854 } | 1854 } |
1855 | 1855 |
1856 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1856 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1857 STLDeleteValues(&power_save_blockers_); | 1857 STLDeleteValues(&power_save_blockers_); |
1858 } | 1858 } |
1859 | 1859 |
1860 } // namespace content | 1860 } // namespace content |
OLD | NEW |