| 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_state_provider.h" | 25 #include "content/browser/media/audio_stream_monitor.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_view_host_impl.h" | 27 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 28 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 28 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 29 #include "content/common/accessibility_mode_enums.h" | 29 #include "content/common/accessibility_mode_enums.h" |
| 30 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
| 31 #include "content/public/browser/color_chooser.h" | 31 #include "content/public/browser/color_chooser.h" |
| 32 #include "content/public/browser/notification_observer.h" | 32 #include "content/public/browser/notification_observer.h" |
| 33 #include "content/public/browser/notification_registrar.h" | 33 #include "content/public/browser/notification_registrar.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/common/renderer_preferences.h" | 35 #include "content/public/common/renderer_preferences.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 // (but can be null if not applicable). | 673 // (but can be null if not applicable). |
| 674 void SetIsLoading(bool is_loading, | 674 void SetIsLoading(bool is_loading, |
| 675 bool to_different_document, | 675 bool to_different_document, |
| 676 LoadNotificationDetails* details) override; | 676 LoadNotificationDetails* details) override; |
| 677 | 677 |
| 678 typedef base::Callback<void(WebContents*)> CreatedCallback; | 678 typedef base::Callback<void(WebContents*)> CreatedCallback; |
| 679 | 679 |
| 680 // Forces overscroll to be disabled (used by touch emulation). | 680 // Forces overscroll to be disabled (used by touch emulation). |
| 681 void SetForceDisableOverscrollContent(bool force_disable); | 681 void SetForceDisableOverscrollContent(bool force_disable); |
| 682 | 682 |
| 683 AudioStateProvider* audio_state_provider() { | 683 AudioStreamMonitor* audio_stream_monitor() { |
| 684 return audio_state_provider_.get(); | 684 return &audio_stream_monitor_; |
| 685 } | 685 } |
| 686 | 686 |
| 687 bool has_audio_power_save_blocker_for_testing() const { | 687 bool has_audio_power_save_blocker_for_testing() const { |
| 688 return audio_power_save_blocker_; | 688 return audio_power_save_blocker_; |
| 689 } | 689 } |
| 690 | 690 |
| 691 bool has_video_power_save_blocker_for_testing() const { | 691 bool has_video_power_save_blocker_for_testing() const { |
| 692 return video_power_save_blocker_; | 692 return video_power_save_blocker_; |
| 693 } | 693 } |
| 694 | 694 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 #endif | 1045 #endif |
| 1046 | 1046 |
| 1047 // Helper classes ------------------------------------------------------------ | 1047 // Helper classes ------------------------------------------------------------ |
| 1048 | 1048 |
| 1049 // Tracking variables and associated power save blockers for media playback. | 1049 // Tracking variables and associated power save blockers for media playback. |
| 1050 ActiveMediaPlayerMap active_audio_players_; | 1050 ActiveMediaPlayerMap active_audio_players_; |
| 1051 ActiveMediaPlayerMap active_video_players_; | 1051 ActiveMediaPlayerMap active_video_players_; |
| 1052 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; | 1052 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; |
| 1053 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 1053 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
| 1054 | 1054 |
| 1055 // Tells whether this WebContents is actively producing sound. | |
| 1056 // Order is important: the |frame_tree_| destruction uses | |
| 1057 // |audio_state_provider_|. | |
| 1058 scoped_ptr<AudioStateProvider> audio_state_provider_; | |
| 1059 | |
| 1060 // Manages the frame tree of the page and process swaps in each node. | 1055 // Manages the frame tree of the page and process swaps in each node. |
| 1061 FrameTree frame_tree_; | 1056 FrameTree frame_tree_; |
| 1062 | 1057 |
| 1063 // If this WebContents is part of a "tree of WebContents", then this contains | 1058 // If this WebContents is part of a "tree of WebContents", then this contains |
| 1064 // information about the structure. | 1059 // information about the structure. |
| 1065 scoped_ptr<WebContentsTreeNode> node_; | 1060 scoped_ptr<WebContentsTreeNode> node_; |
| 1066 | 1061 |
| 1067 // SavePackage, lazily created. | 1062 // SavePackage, lazily created. |
| 1068 scoped_refptr<SavePackage> save_package_; | 1063 scoped_refptr<SavePackage> save_package_; |
| 1069 | 1064 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 | 1267 |
| 1273 scoped_ptr<ScreenOrientationDispatcherHost> | 1268 scoped_ptr<ScreenOrientationDispatcherHost> |
| 1274 screen_orientation_dispatcher_host_; | 1269 screen_orientation_dispatcher_host_; |
| 1275 | 1270 |
| 1276 scoped_ptr<ManifestManagerHost> manifest_manager_host_; | 1271 scoped_ptr<ManifestManagerHost> manifest_manager_host_; |
| 1277 | 1272 |
| 1278 // The accessibility mode for all frames. This is queried when each frame | 1273 // The accessibility mode for all frames. This is queried when each frame |
| 1279 // is created, and broadcast to all frames when it changes. | 1274 // is created, and broadcast to all frames when it changes. |
| 1280 AccessibilityMode accessibility_mode_; | 1275 AccessibilityMode accessibility_mode_; |
| 1281 | 1276 |
| 1277 // Monitors power levels for audio streams associated with this WebContents. |
| 1278 AudioStreamMonitor audio_stream_monitor_; |
| 1279 |
| 1282 // Created on-demand to mute all audio output from this WebContents. | 1280 // Created on-demand to mute all audio output from this WebContents. |
| 1283 scoped_ptr<WebContentsAudioMuter> audio_muter_; | 1281 scoped_ptr<WebContentsAudioMuter> audio_muter_; |
| 1284 | 1282 |
| 1285 bool virtual_keyboard_requested_; | 1283 bool virtual_keyboard_requested_; |
| 1286 | 1284 |
| 1287 #if defined(ENABLE_BROWSER_CDMS) | 1285 #if defined(ENABLE_BROWSER_CDMS) |
| 1288 // Manages all the media player and CDM managers and forwards IPCs to them. | 1286 // Manages all the media player and CDM managers and forwards IPCs to them. |
| 1289 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; | 1287 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; |
| 1290 #endif | 1288 #endif |
| 1291 | 1289 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1307 // Adds/removes a callback called on creation of each new WebContents. | 1305 // Adds/removes a callback called on creation of each new WebContents. |
| 1308 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1306 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1309 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1307 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1310 | 1308 |
| 1311 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1309 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1312 }; | 1310 }; |
| 1313 | 1311 |
| 1314 } // namespace content | 1312 } // namespace content |
| 1315 | 1313 |
| 1316 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1314 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |