| 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/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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 audio_muter_.reset(new WebContentsAudioMuter(this)); | 1273 audio_muter_.reset(new WebContentsAudioMuter(this)); |
| 1274 audio_muter_->StartMuting(); | 1274 audio_muter_->StartMuting(); |
| 1275 } else { | 1275 } else { |
| 1276 DCHECK(audio_muter_); | 1276 DCHECK(audio_muter_); |
| 1277 audio_muter_->StopMuting(); | 1277 audio_muter_->StopMuting(); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1280 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 1281 DidUpdateAudioMutingState(mute)); | 1281 DidUpdateAudioMutingState(mute)); |
| 1282 | 1282 |
| 1283 OnAudioStateChanged(!mute && audio_stream_monitor_.IsCurrentlyAudible()); | 1283 // Notification for UI updates in response to the changed muting state. |
| 1284 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); |
| 1284 } | 1285 } |
| 1285 | 1286 |
| 1286 bool WebContentsImpl::IsConnectedToBluetoothDevice() const { | 1287 bool WebContentsImpl::IsConnectedToBluetoothDevice() const { |
| 1287 return bluetooth_connected_device_count_ > 0; | 1288 return bluetooth_connected_device_count_ > 0; |
| 1288 } | 1289 } |
| 1289 | 1290 |
| 1290 bool WebContentsImpl::IsCrashed() const { | 1291 bool WebContentsImpl::IsCrashed() const { |
| 1291 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || | 1292 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || |
| 1292 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || | 1293 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || |
| 1293 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || | 1294 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 media_web_contents_observer_->MaybeUpdateAudibleState(); | 1334 media_web_contents_observer_->MaybeUpdateAudibleState(); |
| 1334 } | 1335 } |
| 1335 | 1336 |
| 1336 if (delegate_) | 1337 if (delegate_) |
| 1337 delegate_->NavigationStateChanged(this, changed_flags); | 1338 delegate_->NavigationStateChanged(this, changed_flags); |
| 1338 | 1339 |
| 1339 if (GetOuterWebContents()) | 1340 if (GetOuterWebContents()) |
| 1340 GetOuterWebContents()->NotifyNavigationStateChanged(changed_flags); | 1341 GetOuterWebContents()->NotifyNavigationStateChanged(changed_flags); |
| 1341 } | 1342 } |
| 1342 | 1343 |
| 1343 void WebContentsImpl::OnAudioStateChanged(bool is_audio_playing) { | |
| 1344 SendPageMessage( | |
| 1345 new PageMsg_AudioStateChanged(MSG_ROUTING_NONE, is_audio_playing)); | |
| 1346 | |
| 1347 // Notification for UI updates in response to the changed muting state. | |
| 1348 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); | |
| 1349 } | |
| 1350 | |
| 1351 base::TimeTicks WebContentsImpl::GetLastActiveTime() const { | 1344 base::TimeTicks WebContentsImpl::GetLastActiveTime() const { |
| 1352 return last_active_time_; | 1345 return last_active_time_; |
| 1353 } | 1346 } |
| 1354 | 1347 |
| 1355 void WebContentsImpl::SetLastActiveTime(base::TimeTicks last_active_time) { | 1348 void WebContentsImpl::SetLastActiveTime(base::TimeTicks last_active_time) { |
| 1356 last_active_time_ = last_active_time; | 1349 last_active_time_ = last_active_time; |
| 1357 } | 1350 } |
| 1358 | 1351 |
| 1359 void WebContentsImpl::WasShown() { | 1352 void WebContentsImpl::WasShown() { |
| 1360 controller_.SetActive(true); | 1353 controller_.SetActive(true); |
| (...skipping 3923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 dialog_manager_ = dialog_manager; | 5277 dialog_manager_ = dialog_manager; |
| 5285 } | 5278 } |
| 5286 | 5279 |
| 5287 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5280 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5288 auto it = binding_sets_.find(interface_name); | 5281 auto it = binding_sets_.find(interface_name); |
| 5289 if (it != binding_sets_.end()) | 5282 if (it != binding_sets_.end()) |
| 5290 binding_sets_.erase(it); | 5283 binding_sets_.erase(it); |
| 5291 } | 5284 } |
| 5292 | 5285 |
| 5293 } // namespace content | 5286 } // namespace content |
| OLD | NEW |