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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "content/browser/frame_host/frame_tree.h" | 19 #include "content/browser/frame_host/frame_tree.h" |
20 #include "content/browser/frame_host/navigation_controller_delegate.h" | 20 #include "content/browser/frame_host/navigation_controller_delegate.h" |
21 #include "content/browser/frame_host/navigation_controller_impl.h" | 21 #include "content/browser/frame_host/navigation_controller_impl.h" |
22 #include "content/browser/frame_host/navigator_delegate.h" | 22 #include "content/browser/frame_host/navigator_delegate.h" |
23 #include "content/browser/frame_host/render_frame_host_delegate.h" | 23 #include "content/browser/frame_host/render_frame_host_delegate.h" |
24 #include "content/browser/frame_host/render_frame_host_manager.h" | 24 #include "content/browser/frame_host/render_frame_host_manager.h" |
25 #include "content/browser/media/audio_stream_monitor.h" | 25 #include "content/browser/media/audio_state_provider.h" |
26 #include "content/browser/renderer_host/render_view_host_delegate.h" | 26 #include "content/browser/renderer_host/render_view_host_delegate.h" |
27 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 27 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
28 #include "content/common/accessibility_mode_enums.h" | 28 #include "content/common/accessibility_mode_enums.h" |
29 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
30 #include "content/public/browser/color_chooser.h" | 30 #include "content/public/browser/color_chooser.h" |
31 #include "content/public/browser/notification_observer.h" | 31 #include "content/public/browser/notification_observer.h" |
32 #include "content/public/browser/notification_registrar.h" | 32 #include "content/public/browser/notification_registrar.h" |
33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
34 #include "content/public/common/renderer_preferences.h" | 34 #include "content/public/common/renderer_preferences.h" |
35 #include "content/public/common/resource_type.h" | 35 #include "content/public/common/resource_type.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 // currently focused frame. | 662 // currently focused frame. |
663 void SelectRange(const gfx::Point& base, const gfx::Point& extent); | 663 void SelectRange(const gfx::Point& base, const gfx::Point& extent); |
664 | 664 |
665 // Notifies the main frame that it can continue navigation (if it was deferred | 665 // Notifies the main frame that it can continue navigation (if it was deferred |
666 // immediately at first response). | 666 // immediately at first response). |
667 void ResumeResponseDeferredAtStart(); | 667 void ResumeResponseDeferredAtStart(); |
668 | 668 |
669 // Forces overscroll to be disabled (used by touch emulation). | 669 // Forces overscroll to be disabled (used by touch emulation). |
670 void SetForceDisableOverscrollContent(bool force_disable); | 670 void SetForceDisableOverscrollContent(bool force_disable); |
671 | 671 |
672 AudioStreamMonitor* audio_stream_monitor() { | 672 AudioStateProvider* audio_state_provider() { |
673 return &audio_stream_monitor_; | 673 return audio_state_provider_.get(); |
674 } | 674 } |
675 | 675 |
676 bool has_audio_power_save_blocker_for_testing() const { | 676 bool has_audio_power_save_blocker_for_testing() const { |
677 return audio_power_save_blocker_; | 677 return audio_power_save_blocker_; |
678 } | 678 } |
679 | 679 |
680 bool has_video_power_save_blocker_for_testing() const { | 680 bool has_video_power_save_blocker_for_testing() const { |
681 return video_power_save_blocker_; | 681 return video_power_save_blocker_; |
682 } | 682 } |
683 | 683 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 #endif | 1018 #endif |
1019 | 1019 |
1020 // Helper classes ------------------------------------------------------------ | 1020 // Helper classes ------------------------------------------------------------ |
1021 | 1021 |
1022 // Tracking variables and associated power save blockers for media playback. | 1022 // Tracking variables and associated power save blockers for media playback. |
1023 ActiveMediaPlayerMap active_audio_players_; | 1023 ActiveMediaPlayerMap active_audio_players_; |
1024 ActiveMediaPlayerMap active_video_players_; | 1024 ActiveMediaPlayerMap active_video_players_; |
1025 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; | 1025 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; |
1026 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 1026 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
1027 | 1027 |
| 1028 // Tells whether this WebContents is actively producing sound. |
| 1029 // Order is important: the |frame_tree_| destruction uses |
| 1030 // |audio_state_provider_|. |
| 1031 scoped_ptr<AudioStateProvider> audio_state_provider_; |
| 1032 |
1028 // Manages the frame tree of the page and process swaps in each node. | 1033 // Manages the frame tree of the page and process swaps in each node. |
1029 FrameTree frame_tree_; | 1034 FrameTree frame_tree_; |
1030 | 1035 |
1031 // SavePackage, lazily created. | 1036 // SavePackage, lazily created. |
1032 scoped_refptr<SavePackage> save_package_; | 1037 scoped_refptr<SavePackage> save_package_; |
1033 | 1038 |
1034 // Data for loading state ---------------------------------------------------- | 1039 // Data for loading state ---------------------------------------------------- |
1035 | 1040 |
1036 // Indicates whether we're currently loading a resource. | 1041 // Indicates whether we're currently loading a resource. |
1037 bool is_loading_; | 1042 bool is_loading_; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 | 1237 |
1233 scoped_ptr<ScreenOrientationDispatcherHost> | 1238 scoped_ptr<ScreenOrientationDispatcherHost> |
1234 screen_orientation_dispatcher_host_; | 1239 screen_orientation_dispatcher_host_; |
1235 | 1240 |
1236 scoped_ptr<ManifestManagerHost> manifest_manager_host_; | 1241 scoped_ptr<ManifestManagerHost> manifest_manager_host_; |
1237 | 1242 |
1238 // The accessibility mode for all frames. This is queried when each frame | 1243 // The accessibility mode for all frames. This is queried when each frame |
1239 // is created, and broadcast to all frames when it changes. | 1244 // is created, and broadcast to all frames when it changes. |
1240 AccessibilityMode accessibility_mode_; | 1245 AccessibilityMode accessibility_mode_; |
1241 | 1246 |
1242 // Monitors power levels for audio streams associated with this WebContents. | |
1243 AudioStreamMonitor audio_stream_monitor_; | |
1244 | |
1245 // Created on-demand to mute all audio output from this WebContents. | 1247 // Created on-demand to mute all audio output from this WebContents. |
1246 scoped_ptr<WebContentsAudioMuter> audio_muter_; | 1248 scoped_ptr<WebContentsAudioMuter> audio_muter_; |
1247 | 1249 |
1248 bool virtual_keyboard_requested_; | 1250 bool virtual_keyboard_requested_; |
1249 | 1251 |
1250 #if defined(ENABLE_BROWSER_CDMS) | 1252 #if defined(ENABLE_BROWSER_CDMS) |
1251 // Manages all the media player and CDM managers and forwards IPCs to them. | 1253 // Manages all the media player and CDM managers and forwards IPCs to them. |
1252 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; | 1254 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; |
1253 #endif | 1255 #endif |
1254 | 1256 |
(...skipping 15 matching lines...) Expand all Loading... |
1270 // Adds/removes a callback called on creation of each new WebContents. | 1272 // Adds/removes a callback called on creation of each new WebContents. |
1271 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1273 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1272 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1274 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1273 | 1275 |
1274 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1276 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1275 }; | 1277 }; |
1276 | 1278 |
1277 } // namespace content | 1279 } // namespace content |
1278 | 1280 |
1279 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1281 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |