| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3160 } | 3160 } |
| 3161 } | 3161 } |
| 3162 | 3162 |
| 3163 void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id, | 3163 void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id, |
| 3164 bool result) { | 3164 bool result) { |
| 3165 Send(new ViewMsg_PpapiBrokerPermissionResult(routing_id, result)); | 3165 Send(new ViewMsg_PpapiBrokerPermissionResult(routing_id, result)); |
| 3166 } | 3166 } |
| 3167 | 3167 |
| 3168 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, | 3168 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, |
| 3169 const IPC::Message& message) { | 3169 const IPC::Message& message) { |
| 3170 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin | |
| 3171 // specific messages for this WebContents. This means that any message from | |
| 3172 // a BrowserPlugin prior to this will be ignored. | |
| 3173 // For more info, see comment above classes BrowserPluginEmbedder and | |
| 3174 // BrowserPluginGuest. | |
| 3175 CHECK(!browser_plugin_embedder_.get()); | 3170 CHECK(!browser_plugin_embedder_.get()); |
| 3176 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); | 3171 CreateBrowserPluginEmbedderIfNecessary(); |
| 3177 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); | 3172 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); |
| 3178 } | 3173 } |
| 3179 #endif // defined(ENABLE_PLUGINS) | 3174 #endif // defined(ENABLE_PLUGINS) |
| 3180 | 3175 |
| 3181 void WebContentsImpl::OnDidDownloadImage( | 3176 void WebContentsImpl::OnDidDownloadImage( |
| 3182 int id, | 3177 int id, |
| 3183 int http_status_code, | 3178 int http_status_code, |
| 3184 const GURL& image_url, | 3179 const GURL& image_url, |
| 3185 const std::vector<SkBitmap>& bitmaps, | 3180 const std::vector<SkBitmap>& bitmaps, |
| 3186 const std::vector<gfx::Size>& original_bitmap_sizes) { | 3181 const std::vector<gfx::Size>& original_bitmap_sizes) { |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4463 | 4458 |
| 4464 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) { | 4459 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) { |
| 4465 CHECK(!browser_plugin_guest_); | 4460 CHECK(!browser_plugin_guest_); |
| 4466 browser_plugin_guest_.reset(guest); | 4461 browser_plugin_guest_.reset(guest); |
| 4467 } | 4462 } |
| 4468 | 4463 |
| 4469 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { | 4464 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
| 4470 return browser_plugin_embedder_.get(); | 4465 return browser_plugin_embedder_.get(); |
| 4471 } | 4466 } |
| 4472 | 4467 |
| 4468 void WebContentsImpl::CreateBrowserPluginEmbedderIfNecessary() { |
| 4469 if (browser_plugin_embedder_) |
| 4470 return; |
| 4471 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
| 4472 } |
| 4473 |
| 4473 void WebContentsImpl::ClearPowerSaveBlockers( | 4474 void WebContentsImpl::ClearPowerSaveBlockers( |
| 4474 RenderFrameHost* render_frame_host) { | 4475 RenderFrameHost* render_frame_host) { |
| 4475 RemoveAllMediaPlayerEntries(render_frame_host, &active_audio_players_); | 4476 RemoveAllMediaPlayerEntries(render_frame_host, &active_audio_players_); |
| 4476 RemoveAllMediaPlayerEntries(render_frame_host, &active_video_players_); | 4477 RemoveAllMediaPlayerEntries(render_frame_host, &active_video_players_); |
| 4477 MaybeReleasePowerSaveBlockers(); | 4478 MaybeReleasePowerSaveBlockers(); |
| 4478 } | 4479 } |
| 4479 | 4480 |
| 4480 void WebContentsImpl::ClearAllPowerSaveBlockers() { | 4481 void WebContentsImpl::ClearAllPowerSaveBlockers() { |
| 4481 active_audio_players_.clear(); | 4482 active_audio_players_.clear(); |
| 4482 active_video_players_.clear(); | 4483 active_video_players_.clear(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4556 node->render_manager()->ResumeResponseDeferredAtStart(); | 4557 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4557 } | 4558 } |
| 4558 | 4559 |
| 4559 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4560 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4560 force_disable_overscroll_content_ = force_disable; | 4561 force_disable_overscroll_content_ = force_disable; |
| 4561 if (view_) | 4562 if (view_) |
| 4562 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4563 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4563 } | 4564 } |
| 4564 | 4565 |
| 4565 } // namespace content | 4566 } // namespace content |
| OLD | NEW |