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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 upload_size_(0), | 331 upload_size_(0), |
| 332 upload_position_(0), | 332 upload_position_(0), |
| 333 is_resume_pending_(false), | 333 is_resume_pending_(false), |
| 334 displayed_insecure_content_(false), | 334 displayed_insecure_content_(false), |
| 335 has_accessed_initial_document_(false), | 335 has_accessed_initial_document_(false), |
| 336 theme_color_(SK_ColorTRANSPARENT), | 336 theme_color_(SK_ColorTRANSPARENT), |
| 337 last_sent_theme_color_(SK_ColorTRANSPARENT), | 337 last_sent_theme_color_(SK_ColorTRANSPARENT), |
| 338 did_first_visually_non_empty_paint_(false), | 338 did_first_visually_non_empty_paint_(false), |
| 339 capturer_count_(0), | 339 capturer_count_(0), |
| 340 should_normally_be_visible_(true), | 340 should_normally_be_visible_(true), |
| 341 is_or_was_visible_(false), | |
| 341 is_being_destroyed_(false), | 342 is_being_destroyed_(false), |
| 342 notify_disconnection_(false), | 343 notify_disconnection_(false), |
| 343 dialog_manager_(NULL), | 344 dialog_manager_(NULL), |
| 344 is_showing_before_unload_dialog_(false), | 345 is_showing_before_unload_dialog_(false), |
| 345 last_active_time_(base::TimeTicks::Now()), | 346 last_active_time_(base::TimeTicks::Now()), |
| 346 closed_by_user_gesture_(false), | 347 closed_by_user_gesture_(false), |
| 347 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), | 348 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), |
| 348 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), | 349 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), |
| 349 zoom_scroll_remainder_(0), | 350 zoom_scroll_remainder_(0), |
| 350 render_view_message_source_(NULL), | 351 render_view_message_source_(NULL), |
| (...skipping 4440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4791 void WebContentsImpl::MediaStartedPlaying( | 4792 void WebContentsImpl::MediaStartedPlaying( |
| 4792 const WebContentsObserver::MediaPlayerId& id) { | 4793 const WebContentsObserver::MediaPlayerId& id) { |
| 4793 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4794 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4794 } | 4795 } |
| 4795 | 4796 |
| 4796 void WebContentsImpl::MediaStoppedPlaying( | 4797 void WebContentsImpl::MediaStoppedPlaying( |
| 4797 const WebContentsObserver::MediaPlayerId& id) { | 4798 const WebContentsObserver::MediaPlayerId& id) { |
| 4798 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4799 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4799 } | 4800 } |
| 4800 | 4801 |
| 4802 void WebContentsImpl::UpdateWebContentsVisibility(bool visible) { | |
| 4803 if (!is_or_was_visible_) { | |
|
Avi (use Gerrit)
2016/02/26 17:50:23
I'm still struggling here.
This variable starts a
tapted
2016/02/29 06:49:00
Done.
| |
| 4804 // We should not hide the web contents before it was shown the first time, | |
|
Avi (use Gerrit)
2016/02/26 17:50:23
"we"?
// If this WebContents has not yet been set
tapted
2016/02/29 06:49:00
Done.
| |
| 4805 // since resources would immediately be destroyed and only re-created after | |
| 4806 // content got loaded. In this state the window content is undefined and can | |
| 4807 // show garbage. | |
| 4808 // However - the page load mechanism requires an activation call through a | |
| 4809 // visibility call to (re)load. | |
| 4810 if (visible) { | |
| 4811 is_or_was_visible_ = true; | |
| 4812 WasShown(); | |
| 4813 } | |
| 4814 return; | |
| 4815 } | |
| 4816 if (visible == should_normally_be_visible_) | |
| 4817 return; | |
| 4818 | |
| 4819 if (visible) | |
| 4820 WasShown(); | |
| 4821 else | |
| 4822 WasHidden(); | |
| 4823 } | |
| 4824 | |
| 4801 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4825 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 4802 JavaScriptDialogManager* dialog_manager) { | 4826 JavaScriptDialogManager* dialog_manager) { |
| 4803 dialog_manager_ = dialog_manager; | 4827 dialog_manager_ = dialog_manager; |
| 4804 } | 4828 } |
| 4805 | 4829 |
| 4806 } // namespace content | 4830 } // namespace content |
| OLD | NEW |