| 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 // Tracks whether this WebContents was ever set to be visible. Used to |
| 1173 // facilitate WebContents being loaded in the background by setting |
| 1174 // |should_normally_be_visible_|. Ensures WasShown() will trigger when first |
| 1175 // becoming visible to the user, and prevents premature unloading. |
| 1176 bool did_first_set_visible_; |
| 1177 |
| 1169 // See getter above. | 1178 // See getter above. |
| 1170 bool is_being_destroyed_; | 1179 bool is_being_destroyed_; |
| 1171 | 1180 |
| 1172 // Indicates whether we should notify about disconnection of this | 1181 // Indicates whether we should notify about disconnection of this |
| 1173 // WebContentsImpl. This is used to ensure disconnection notifications only | 1182 // WebContentsImpl. This is used to ensure disconnection notifications only |
| 1174 // happen if a connection notification has happened and that they happen only | 1183 // happen if a connection notification has happened and that they happen only |
| 1175 // once. | 1184 // once. |
| 1176 bool notify_disconnection_; | 1185 bool notify_disconnection_; |
| 1177 | 1186 |
| 1178 // Pointer to the JavaScript dialog manager, lazily assigned. Used because the | 1187 // 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. | 1350 // Adds/removes a callback called on creation of each new WebContents. |
| 1342 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1351 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1343 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1352 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1344 | 1353 |
| 1345 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1354 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1346 }; | 1355 }; |
| 1347 | 1356 |
| 1348 } // namespace content | 1357 } // namespace content |
| 1349 | 1358 |
| 1350 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1359 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |