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

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

Issue 972973002: Revert of Propagate audible state from player to the containing tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 #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_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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // currently focused frame. 659 // currently focused frame.
660 void SelectRange(const gfx::Point& base, const gfx::Point& extent); 660 void SelectRange(const gfx::Point& base, const gfx::Point& extent);
661 661
662 // Notifies the main frame that it can continue navigation (if it was deferred 662 // Notifies the main frame that it can continue navigation (if it was deferred
663 // immediately at first response). 663 // immediately at first response).
664 void ResumeResponseDeferredAtStart(); 664 void ResumeResponseDeferredAtStart();
665 665
666 // Forces overscroll to be disabled (used by touch emulation). 666 // Forces overscroll to be disabled (used by touch emulation).
667 void SetForceDisableOverscrollContent(bool force_disable); 667 void SetForceDisableOverscrollContent(bool force_disable);
668 668
669 AudioStateProvider* audio_state_provider() { 669 AudioStreamMonitor* audio_stream_monitor() {
670 return audio_state_provider_.get(); 670 return &audio_stream_monitor_;
671 } 671 }
672 672
673 bool has_audio_power_save_blocker_for_testing() const { 673 bool has_audio_power_save_blocker_for_testing() const {
674 return audio_power_save_blocker_; 674 return audio_power_save_blocker_;
675 } 675 }
676 676
677 bool has_video_power_save_blocker_for_testing() const { 677 bool has_video_power_save_blocker_for_testing() const {
678 return video_power_save_blocker_; 678 return video_power_save_blocker_;
679 } 679 }
680 680
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 #endif 1015 #endif
1016 1016
1017 // Helper classes ------------------------------------------------------------ 1017 // Helper classes ------------------------------------------------------------
1018 1018
1019 // Tracking variables and associated power save blockers for media playback. 1019 // Tracking variables and associated power save blockers for media playback.
1020 ActiveMediaPlayerMap active_audio_players_; 1020 ActiveMediaPlayerMap active_audio_players_;
1021 ActiveMediaPlayerMap active_video_players_; 1021 ActiveMediaPlayerMap active_video_players_;
1022 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; 1022 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_;
1023 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; 1023 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_;
1024 1024
1025 // Tells whether this WebContents is actively producing sound.
1026 // Order is important: the |frame_tree_| destruction uses
1027 // |audio_state_provider_|.
1028 scoped_ptr<AudioStateProvider> audio_state_provider_;
1029
1030 // Manages the frame tree of the page and process swaps in each node. 1025 // Manages the frame tree of the page and process swaps in each node.
1031 FrameTree frame_tree_; 1026 FrameTree frame_tree_;
1032 1027
1033 // SavePackage, lazily created. 1028 // SavePackage, lazily created.
1034 scoped_refptr<SavePackage> save_package_; 1029 scoped_refptr<SavePackage> save_package_;
1035 1030
1036 // Data for loading state ---------------------------------------------------- 1031 // Data for loading state ----------------------------------------------------
1037 1032
1038 // Indicates whether we're currently loading a resource. 1033 // Indicates whether we're currently loading a resource.
1039 bool is_loading_; 1034 bool is_loading_;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 1229
1235 scoped_ptr<ScreenOrientationDispatcherHost> 1230 scoped_ptr<ScreenOrientationDispatcherHost>
1236 screen_orientation_dispatcher_host_; 1231 screen_orientation_dispatcher_host_;
1237 1232
1238 scoped_ptr<ManifestManagerHost> manifest_manager_host_; 1233 scoped_ptr<ManifestManagerHost> manifest_manager_host_;
1239 1234
1240 // The accessibility mode for all frames. This is queried when each frame 1235 // The accessibility mode for all frames. This is queried when each frame
1241 // is created, and broadcast to all frames when it changes. 1236 // is created, and broadcast to all frames when it changes.
1242 AccessibilityMode accessibility_mode_; 1237 AccessibilityMode accessibility_mode_;
1243 1238
1239 // Monitors power levels for audio streams associated with this WebContents.
1240 AudioStreamMonitor audio_stream_monitor_;
1241
1244 // Created on-demand to mute all audio output from this WebContents. 1242 // Created on-demand to mute all audio output from this WebContents.
1245 scoped_ptr<WebContentsAudioMuter> audio_muter_; 1243 scoped_ptr<WebContentsAudioMuter> audio_muter_;
1246 1244
1247 bool virtual_keyboard_requested_; 1245 bool virtual_keyboard_requested_;
1248 1246
1249 #if defined(ENABLE_BROWSER_CDMS) 1247 #if defined(ENABLE_BROWSER_CDMS)
1250 // Manages all the media player and CDM managers and forwards IPCs to them. 1248 // Manages all the media player and CDM managers and forwards IPCs to them.
1251 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; 1249 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_;
1252 #endif 1250 #endif
1253 1251
(...skipping 15 matching lines...) Expand all
1269 // Adds/removes a callback called on creation of each new WebContents. 1267 // Adds/removes a callback called on creation of each new WebContents.
1270 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1268 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1271 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1269 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1272 1270
1273 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1271 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1274 }; 1272 };
1275 1273
1276 } // namespace content 1274 } // namespace content
1277 1275
1278 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1276 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/media/media_web_contents_observer.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698