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 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 2806 int32 page_id, |
2807 const std::vector<FaviconURL>& candidates) { | 2807 const std::vector<FaviconURL>& candidates) { |
| 2808 // TODO(creis): It is not safe to use page_id here. It looks unused, so clear |
| 2809 // it out. |
| 2810 int32 unused = -1; |
2808 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2811 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2809 DidUpdateFaviconURL(page_id, candidates)); | 2812 DidUpdateFaviconURL(unused, candidates)); |
2810 } | 2813 } |
2811 | 2814 |
2812 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, | 2815 void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, |
2813 bool has_video, | 2816 bool has_video, |
2814 bool has_audio) { | 2817 bool has_audio) { |
2815 // Chrome OS does its own detection of audio and video. | 2818 // Chrome OS does its own detection of audio and video. |
2816 #if !defined(OS_CHROMEOS) | 2819 #if !defined(OS_CHROMEOS) |
2817 scoped_ptr<PowerSaveBlocker> blocker; | 2820 scoped_ptr<PowerSaveBlocker> blocker; |
2818 if (has_video) { | 2821 if (has_video) { |
2819 blocker = PowerSaveBlocker::Create( | 2822 blocker = PowerSaveBlocker::Create( |
(...skipping 16 matching lines...) Expand all Loading... |
2836 | 2839 |
2837 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { | 2840 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { |
2838 // Chrome OS does its own detection of audio and video. | 2841 // Chrome OS does its own detection of audio and video. |
2839 #if !defined(OS_CHROMEOS) | 2842 #if !defined(OS_CHROMEOS) |
2840 delete power_save_blockers_[render_view_message_source_][player_cookie]; | 2843 delete power_save_blockers_[render_view_message_source_][player_cookie]; |
2841 power_save_blockers_[render_view_message_source_].erase(player_cookie); | 2844 power_save_blockers_[render_view_message_source_].erase(player_cookie); |
2842 #endif // !defined(OS_CHROMEOS) | 2845 #endif // !defined(OS_CHROMEOS) |
2843 } | 2846 } |
2844 | 2847 |
2845 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint(int32 page_id) { | 2848 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint(int32 page_id) { |
| 2849 // TODO(creis): This shouldn't have a page_id. It's unused, so remove it. |
| 2850 int32 unused = -1; |
2846 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2851 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2847 DidFirstVisuallyNonEmptyPaint(page_id)); | 2852 DidFirstVisuallyNonEmptyPaint(unused)); |
2848 } | 2853 } |
2849 | 2854 |
2850 void WebContentsImpl::DidChangeVisibleSSLState() { | 2855 void WebContentsImpl::DidChangeVisibleSSLState() { |
2851 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2856 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2852 DidChangeVisibleSSLState()); | 2857 DidChangeVisibleSSLState()); |
2853 } | 2858 } |
2854 | 2859 |
2855 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { | 2860 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { |
2856 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2861 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2857 BeforeFormRepostWarningShow()); | 2862 BeforeFormRepostWarningShow()); |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 | 3929 |
3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3930 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3926 if (!delegate_) | 3931 if (!delegate_) |
3927 return; | 3932 return; |
3928 const gfx::Size new_size = GetPreferredSize(); | 3933 const gfx::Size new_size = GetPreferredSize(); |
3929 if (new_size != old_size) | 3934 if (new_size != old_size) |
3930 delegate_->UpdatePreferredSize(this, new_size); | 3935 delegate_->UpdatePreferredSize(this, new_size); |
3931 } | 3936 } |
3932 | 3937 |
3933 } // namespace content | 3938 } // namespace content |
OLD | NEW |