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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2403363003: [Merge to 2883] Revert "[scheduler] Teach scheduler about audio state" (Closed)
Patch Set: 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/page_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 audio_muter_.reset(new WebContentsAudioMuter(this)); 1271 audio_muter_.reset(new WebContentsAudioMuter(this));
1272 audio_muter_->StartMuting(); 1272 audio_muter_->StartMuting();
1273 } else { 1273 } else {
1274 DCHECK(audio_muter_); 1274 DCHECK(audio_muter_);
1275 audio_muter_->StopMuting(); 1275 audio_muter_->StopMuting();
1276 } 1276 }
1277 1277
1278 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1278 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1279 DidUpdateAudioMutingState(mute)); 1279 DidUpdateAudioMutingState(mute));
1280 1280
1281 OnAudioStateChanged(!mute && audio_stream_monitor_.IsCurrentlyAudible()); 1281 // Notification for UI updates in response to the changed muting state.
1282 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
1282 } 1283 }
1283 1284
1284 bool WebContentsImpl::IsConnectedToBluetoothDevice() const { 1285 bool WebContentsImpl::IsConnectedToBluetoothDevice() const {
1285 return bluetooth_connected_device_count_ > 0; 1286 return bluetooth_connected_device_count_ > 0;
1286 } 1287 }
1287 1288
1288 bool WebContentsImpl::IsCrashed() const { 1289 bool WebContentsImpl::IsCrashed() const {
1289 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || 1290 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED ||
1290 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || 1291 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
1291 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || 1292 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 media_web_contents_observer_->MaybeUpdateAudibleState(); 1332 media_web_contents_observer_->MaybeUpdateAudibleState();
1332 } 1333 }
1333 1334
1334 if (delegate_) 1335 if (delegate_)
1335 delegate_->NavigationStateChanged(this, changed_flags); 1336 delegate_->NavigationStateChanged(this, changed_flags);
1336 1337
1337 if (GetOuterWebContents()) 1338 if (GetOuterWebContents())
1338 GetOuterWebContents()->NotifyNavigationStateChanged(changed_flags); 1339 GetOuterWebContents()->NotifyNavigationStateChanged(changed_flags);
1339 } 1340 }
1340 1341
1341 void WebContentsImpl::OnAudioStateChanged(bool is_audio_playing) {
1342 SendPageMessage(
1343 new PageMsg_AudioStateChanged(MSG_ROUTING_NONE, is_audio_playing));
1344
1345 // Notification for UI updates in response to the changed muting state.
1346 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
1347 }
1348
1349 base::TimeTicks WebContentsImpl::GetLastActiveTime() const { 1342 base::TimeTicks WebContentsImpl::GetLastActiveTime() const {
1350 return last_active_time_; 1343 return last_active_time_;
1351 } 1344 }
1352 1345
1353 void WebContentsImpl::SetLastActiveTime(base::TimeTicks last_active_time) { 1346 void WebContentsImpl::SetLastActiveTime(base::TimeTicks last_active_time) {
1354 last_active_time_ = last_active_time; 1347 last_active_time_ = last_active_time;
1355 } 1348 }
1356 1349
1357 void WebContentsImpl::WasShown() { 1350 void WebContentsImpl::WasShown() {
1358 controller_.SetActive(true); 1351 controller_.SetActive(true);
(...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after
5272 dialog_manager_ = dialog_manager; 5265 dialog_manager_ = dialog_manager;
5273 } 5266 }
5274 5267
5275 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5268 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5276 auto it = binding_sets_.find(interface_name); 5269 auto it = binding_sets_.find(interface_name);
5277 if (it != binding_sets_.end()) 5270 if (it != binding_sets_.end())
5278 binding_sets_.erase(it); 5271 binding_sets_.erase(it);
5279 } 5272 }
5280 5273
5281 } // namespace content 5274 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/page_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698