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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2796 return; | 2796 return; |
| 2797 } | 2797 } |
| 2798 if (!iter->second.is_null()) { | 2798 if (!iter->second.is_null()) { |
| 2799 iter->second.Run( | 2799 iter->second.Run( |
| 2800 id, http_status_code, image_url, bitmaps, original_bitmap_sizes); | 2800 id, http_status_code, image_url, bitmaps, original_bitmap_sizes); |
| 2801 } | 2801 } |
| 2802 image_download_map_.erase(id); | 2802 image_download_map_.erase(id); |
| 2803 } | 2803 } |
| 2804 | 2804 |
| 2805 void WebContentsImpl::OnUpdateFaviconURL( | 2805 void WebContentsImpl::OnUpdateFaviconURL( |
| 2806 int32 page_id, | |
| 2807 const std::vector<FaviconURL>& candidates) { | 2806 const std::vector<FaviconURL>& candidates) { |
| 2808 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2807 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2809 DidUpdateFaviconURL(page_id, candidates)); | 2808 DidUpdateFaviconURL(candidates)); |
| 2810 } | 2809 } |
| 2811 | 2810 |
| 2812 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, | 2811 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, |
| 2813 bool has_video, | 2812 bool has_video, |
| 2814 bool has_audio) { | 2813 bool has_audio) { |
| 2815 // Chrome OS does its own detection of audio and video. | 2814 // Chrome OS does its own detection of audio and video. |
| 2816 #if !defined(OS_CHROMEOS) | 2815 #if !defined(OS_CHROMEOS) |
| 2817 scoped_ptr<PowerSaveBlocker> blocker; | 2816 scoped_ptr<PowerSaveBlocker> blocker; |
| 2818 if (has_video) { | 2817 if (has_video) { |
| 2819 blocker = PowerSaveBlocker::Create( | 2818 blocker = PowerSaveBlocker::Create( |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 2835 } | 2834 } |
| 2836 | 2835 |
| 2837 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { | 2836 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { |
| 2838 // Chrome OS does its own detection of audio and video. | 2837 // Chrome OS does its own detection of audio and video. |
| 2839 #if !defined(OS_CHROMEOS) | 2838 #if !defined(OS_CHROMEOS) |
| 2840 delete power_save_blockers_[render_view_message_source_][player_cookie]; | 2839 delete power_save_blockers_[render_view_message_source_][player_cookie]; |
| 2841 power_save_blockers_[render_view_message_source_].erase(player_cookie); | 2840 power_save_blockers_[render_view_message_source_].erase(player_cookie); |
| 2842 #endif // !defined(OS_CHROMEOS) | 2841 #endif // !defined(OS_CHROMEOS) |
| 2843 } | 2842 } |
| 2844 | 2843 |
| 2845 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint(int32 page_id) { | 2844 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { |
| 2846 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2845 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2847 DidFirstVisuallyNonEmptyPaint(page_id)); | 2846 DidFirstVisuallyNonEmptyPaint()); |
| 2848 } | 2847 } |
| 2849 | 2848 |
| 2850 void WebContentsImpl::DidChangeVisibleSSLState() { | 2849 void WebContentsImpl::DidChangeVisibleSSLState() { |
| 2851 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2850 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2852 DidChangeVisibleSSLState()); | 2851 DidChangeVisibleSSLState()); |
| 2853 } | 2852 } |
| 2854 | 2853 |
| 2855 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { | 2854 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { |
| 2856 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2855 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2857 BeforeFormRepostWarningShow()); | 2856 BeforeFormRepostWarningShow()); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3446 GetRenderManager()->DidDisownOpener(render_frame_host->GetRenderViewHost()); | 3445 GetRenderManager()->DidDisownOpener(render_frame_host->GetRenderViewHost()); |
| 3447 } | 3446 } |
| 3448 | 3447 |
| 3449 void WebContentsImpl::DocumentAvailableInMainFrame( | 3448 void WebContentsImpl::DocumentAvailableInMainFrame( |
| 3450 RenderViewHost* render_view_host) { | 3449 RenderViewHost* render_view_host) { |
| 3451 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3450 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3452 DocumentAvailableInMainFrame()); | 3451 DocumentAvailableInMainFrame()); |
| 3453 } | 3452 } |
| 3454 | 3453 |
| 3455 void WebContentsImpl::DocumentOnLoadCompletedInMainFrame( | 3454 void WebContentsImpl::DocumentOnLoadCompletedInMainFrame( |
| 3456 RenderViewHost* render_view_host, | 3455 RenderViewHost* render_view_host) { |
| 3457 int32 page_id) { | |
| 3458 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3456 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3459 DocumentOnLoadCompletedInMainFrame(page_id)); | 3457 DocumentOnLoadCompletedInMainFrame()); |
| 3460 | 3458 |
| 3461 // TODO(avi): Remove. http://crbug.com/170921 | 3459 // TODO(avi): Remove. http://crbug.com/170921 |
| 3462 NotificationService::current()->Notify( | 3460 NotificationService::current()->Notify( |
| 3463 NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 3461 NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 3464 Source<WebContents>(this), | 3462 Source<WebContents>(this), |
| 3465 Details<int>(&page_id)); | 3463 NotificationService::NoDetails()); |
|
Charlie Reis
2014/05/02 22:33:22
I checked on code search and couldn't find anyone
| |
| 3466 } | 3464 } |
| 3467 | 3465 |
| 3468 void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) { | 3466 void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) { |
| 3469 // Tell the active RenderViewHost to run unload handlers and close, as long | 3467 // Tell the active RenderViewHost to run unload handlers and close, as long |
| 3470 // as the request came from a RenderViewHost in the same BrowsingInstance. | 3468 // as the request came from a RenderViewHost in the same BrowsingInstance. |
| 3471 // In most cases, we receive this from a swapped out RenderViewHost. | 3469 // In most cases, we receive this from a swapped out RenderViewHost. |
| 3472 // It is possible to receive it from one that has just been swapped in, | 3470 // It is possible to receive it from one that has just been swapped in, |
| 3473 // in which case we might as well deliver the message anyway. | 3471 // in which case we might as well deliver the message anyway. |
| 3474 if (rvh->GetSiteInstance()->IsRelatedSiteInstance(GetSiteInstance())) | 3472 if (rvh->GetSiteInstance()->IsRelatedSiteInstance(GetSiteInstance())) |
| 3475 GetRenderViewHost()->ClosePage(); | 3473 GetRenderViewHost()->ClosePage(); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3924 | 3922 |
| 3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3923 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 3926 if (!delegate_) | 3924 if (!delegate_) |
| 3927 return; | 3925 return; |
| 3928 const gfx::Size new_size = GetPreferredSize(); | 3926 const gfx::Size new_size = GetPreferredSize(); |
| 3929 if (new_size != old_size) | 3927 if (new_size != old_size) |
| 3930 delegate_->UpdatePreferredSize(this, new_size); | 3928 delegate_->UpdatePreferredSize(this, new_size); |
| 3931 } | 3929 } |
| 3932 | 3930 |
| 3933 } // namespace content | 3931 } // namespace content |
| OLD | NEW |