Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 | 721 |
| 722 // Called by MediaWebContentsObserver when playback starts or stops. See the | 722 // Called by MediaWebContentsObserver when playback starts or stops. See the |
| 723 // WebContentsObserver function stubs for more details. | 723 // WebContentsObserver function stubs for more details. |
| 724 void MediaStartedPlaying(const WebContentsObserver::MediaPlayerId& id); | 724 void MediaStartedPlaying(const WebContentsObserver::MediaPlayerId& id); |
| 725 void MediaStoppedPlaying(const WebContentsObserver::MediaPlayerId& id); | 725 void MediaStoppedPlaying(const WebContentsObserver::MediaPlayerId& id); |
| 726 | 726 |
| 727 MediaWebContentsObserver* media_web_contents_observer() { | 727 MediaWebContentsObserver* media_web_contents_observer() { |
| 728 return media_web_contents_observer_.get(); | 728 return media_web_contents_observer_.get(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 // Update the web contents visibility. | |
| 732 void UpdateWebContentsVisibility(bool visible); | |
| 733 | |
| 731 private: | 734 private: |
| 732 friend class WebContentsObserver; | 735 friend class WebContentsObserver; |
| 733 friend class WebContents; // To implement factory methods. | 736 friend class WebContents; // To implement factory methods. |
| 734 | 737 |
| 735 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials); | 738 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials); |
| 736 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle); | 739 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle); |
| 737 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending); | 740 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending); |
| 738 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, | 741 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, |
| 739 CrossSiteCantPreemptAfterUnload); | 742 CrossSiteCantPreemptAfterUnload); |
| 740 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContents); | 743 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContents); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1159 // Data for misc internal state ---------------------------------------------- | 1162 // Data for misc internal state ---------------------------------------------- |
| 1160 | 1163 |
| 1161 // When > 0, the WebContents is currently being captured (e.g., for | 1164 // When > 0, the WebContents is currently being captured (e.g., for |
| 1162 // screenshots or mirroring); and the underlying RenderWidgetHost should not | 1165 // screenshots or mirroring); and the underlying RenderWidgetHost should not |
| 1163 // be told it is hidden. | 1166 // be told it is hidden. |
| 1164 int capturer_count_; | 1167 int capturer_count_; |
| 1165 | 1168 |
| 1166 // Tracks whether RWHV should be visible once capturer_count_ becomes zero. | 1169 // Tracks whether RWHV should be visible once capturer_count_ becomes zero. |
| 1167 bool should_normally_be_visible_; | 1170 bool should_normally_be_visible_; |
| 1168 | 1171 |
| 1172 // Background tabs are loaded with |should_normally_be_visible_| set, so that | |
| 1173 // they actually load something, but then need to receive an initial | |
| 1174 // WasShown() message when first switching to that tab. | |
|
Avi (use Gerrit)
2016/02/26 17:50:23
This is a rationale of _why_ we need this, but it'
tapted
2016/02/29 06:49:00
Done. Clarified it a bit. When it was just used fo
| |
| 1175 bool is_or_was_visible_; | |
| 1176 | |
| 1169 // See getter above. | 1177 // See getter above. |
| 1170 bool is_being_destroyed_; | 1178 bool is_being_destroyed_; |
| 1171 | 1179 |
| 1172 // Indicates whether we should notify about disconnection of this | 1180 // Indicates whether we should notify about disconnection of this |
| 1173 // WebContentsImpl. This is used to ensure disconnection notifications only | 1181 // WebContentsImpl. This is used to ensure disconnection notifications only |
| 1174 // happen if a connection notification has happened and that they happen only | 1182 // happen if a connection notification has happened and that they happen only |
| 1175 // once. | 1183 // once. |
| 1176 bool notify_disconnection_; | 1184 bool notify_disconnection_; |
| 1177 | 1185 |
| 1178 // Pointer to the JavaScript dialog manager, lazily assigned. Used because the | 1186 // Pointer to the JavaScript dialog manager, lazily assigned. Used because the |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1341 // Adds/removes a callback called on creation of each new WebContents. | 1349 // Adds/removes a callback called on creation of each new WebContents. |
| 1342 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1350 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1343 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1351 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1344 | 1352 |
| 1345 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1353 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1346 }; | 1354 }; |
| 1347 | 1355 |
| 1348 } // namespace content | 1356 } // namespace content |
| 1349 | 1357 |
| 1350 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1358 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |