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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 render_frame_message_source_(NULL), | 351 render_frame_message_source_(NULL), |
352 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), | 352 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), |
353 fullscreen_widget_had_focus_at_shutdown_(false), | 353 fullscreen_widget_had_focus_at_shutdown_(false), |
354 is_subframe_(false), | 354 is_subframe_(false), |
355 force_disable_overscroll_content_(false), | 355 force_disable_overscroll_content_(false), |
356 last_dialog_suppressed_(false), | 356 last_dialog_suppressed_(false), |
357 geolocation_service_context_(new GeolocationServiceContext()), | 357 geolocation_service_context_(new GeolocationServiceContext()), |
358 accessibility_mode_( | 358 accessibility_mode_( |
359 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 359 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
360 audio_stream_monitor_(this), | 360 audio_stream_monitor_(this), |
| 361 bluetooth_device_connected_(false), |
361 virtual_keyboard_requested_(false), | 362 virtual_keyboard_requested_(false), |
362 page_scale_factor_is_one_(true), | 363 page_scale_factor_is_one_(true), |
363 loading_weak_factory_(this), | 364 loading_weak_factory_(this), |
364 weak_factory_(this) { | 365 weak_factory_(this) { |
365 frame_tree_.SetFrameRemoveListener( | 366 frame_tree_.SetFrameRemoveListener( |
366 base::Bind(&WebContentsImpl::OnFrameRemoved, | 367 base::Bind(&WebContentsImpl::OnFrameRemoved, |
367 base::Unretained(this))); | 368 base::Unretained(this))); |
368 #if defined(OS_ANDROID) | 369 #if defined(OS_ANDROID) |
369 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); | 370 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); |
370 #else | 371 #else |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 audio_muter_->StopMuting(); | 1118 audio_muter_->StopMuting(); |
1118 } | 1119 } |
1119 | 1120 |
1120 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1121 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
1121 DidUpdateAudioMutingState(mute)); | 1122 DidUpdateAudioMutingState(mute)); |
1122 | 1123 |
1123 // Notification for UI updates in response to the changed muting state. | 1124 // Notification for UI updates in response to the changed muting state. |
1124 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); | 1125 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); |
1125 } | 1126 } |
1126 | 1127 |
| 1128 bool WebContentsImpl::IsBluetoothDeviceConnected() const { |
| 1129 return bluetooth_device_connected_; |
| 1130 } |
| 1131 |
| 1132 void WebContentsImpl::SetBluetoothDeviceConnected(bool connected) { |
| 1133 bluetooth_device_connected_ = connected; |
| 1134 // Notification for UI updates in response to the connected device. |
| 1135 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); |
| 1136 } |
| 1137 |
1127 bool WebContentsImpl::IsCrashed() const { | 1138 bool WebContentsImpl::IsCrashed() const { |
1128 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || | 1139 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || |
1129 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || | 1140 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || |
1130 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || | 1141 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
1131 #if defined(OS_CHROMEOS) | 1142 #if defined(OS_CHROMEOS) |
1132 crashed_status_ == | 1143 crashed_status_ == |
1133 base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM || | 1144 base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM || |
1134 #endif | 1145 #endif |
1135 crashed_status_ == base::TERMINATION_STATUS_LAUNCH_FAILED | 1146 crashed_status_ == base::TERMINATION_STATUS_LAUNCH_FAILED |
1136 ); | 1147 ); |
(...skipping 3688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4825 else | 4836 else |
4826 WasHidden(); | 4837 WasHidden(); |
4827 } | 4838 } |
4828 | 4839 |
4829 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4840 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
4830 JavaScriptDialogManager* dialog_manager) { | 4841 JavaScriptDialogManager* dialog_manager) { |
4831 dialog_manager_ = dialog_manager; | 4842 dialog_manager_ = dialog_manager; |
4832 } | 4843 } |
4833 | 4844 |
4834 } // namespace content | 4845 } // namespace content |
OLD | NEW |