Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 910073003: <webview>: Make contentWindow available prior to attachment (on display:none). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3161 } 3161 }
3162 } 3162 }
3163 3163
3164 void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id, 3164 void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id,
3165 bool result) { 3165 bool result) {
3166 Send(new ViewMsg_PpapiBrokerPermissionResult(routing_id, result)); 3166 Send(new ViewMsg_PpapiBrokerPermissionResult(routing_id, result));
3167 } 3167 }
3168 3168
3169 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, 3169 void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host,
3170 const IPC::Message& message) { 3170 const IPC::Message& message) {
3171 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin
3172 // specific messages for this WebContents. This means that any message from
3173 // a BrowserPlugin prior to this will be ignored.
3174 // For more info, see comment above classes BrowserPluginEmbedder and
3175 // BrowserPluginGuest.
3176 CHECK(!browser_plugin_embedder_.get()); 3171 CHECK(!browser_plugin_embedder_.get());
3177 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); 3172 CreateBrowserPluginEmbedderIfNecessary();
3178 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); 3173 browser_plugin_embedder_->OnMessageReceived(message, render_frame_host);
3179 } 3174 }
3180 #endif // defined(ENABLE_PLUGINS) 3175 #endif // defined(ENABLE_PLUGINS)
3181 3176
3182 void WebContentsImpl::OnDidDownloadImage( 3177 void WebContentsImpl::OnDidDownloadImage(
3183 int id, 3178 int id,
3184 int http_status_code, 3179 int http_status_code,
3185 const GURL& image_url, 3180 const GURL& image_url,
3186 const std::vector<SkBitmap>& bitmaps, 3181 const std::vector<SkBitmap>& bitmaps,
3187 const std::vector<gfx::Size>& original_bitmap_sizes) { 3182 const std::vector<gfx::Size>& original_bitmap_sizes) {
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
4451 4446
4452 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) { 4447 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) {
4453 CHECK(!browser_plugin_guest_); 4448 CHECK(!browser_plugin_guest_);
4454 browser_plugin_guest_.reset(guest); 4449 browser_plugin_guest_.reset(guest);
4455 } 4450 }
4456 4451
4457 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { 4452 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const {
4458 return browser_plugin_embedder_.get(); 4453 return browser_plugin_embedder_.get();
4459 } 4454 }
4460 4455
4456 void WebContentsImpl::CreateBrowserPluginEmbedderIfNecessary() {
4457 if (browser_plugin_embedder_)
4458 return;
4459 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this));
4460 }
4461
4461 void WebContentsImpl::ClearPowerSaveBlockers( 4462 void WebContentsImpl::ClearPowerSaveBlockers(
4462 RenderFrameHost* render_frame_host) { 4463 RenderFrameHost* render_frame_host) {
4463 RemoveAllMediaPlayerEntries(render_frame_host, &active_audio_players_); 4464 RemoveAllMediaPlayerEntries(render_frame_host, &active_audio_players_);
4464 RemoveAllMediaPlayerEntries(render_frame_host, &active_video_players_); 4465 RemoveAllMediaPlayerEntries(render_frame_host, &active_video_players_);
4465 MaybeReleasePowerSaveBlockers(); 4466 MaybeReleasePowerSaveBlockers();
4466 } 4467 }
4467 4468
4468 void WebContentsImpl::ClearAllPowerSaveBlockers() { 4469 void WebContentsImpl::ClearAllPowerSaveBlockers() {
4469 active_audio_players_.clear(); 4470 active_audio_players_.clear();
4470 active_video_players_.clear(); 4471 active_video_players_.clear();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
4544 node->render_manager()->ResumeResponseDeferredAtStart(); 4545 node->render_manager()->ResumeResponseDeferredAtStart();
4545 } 4546 }
4546 4547
4547 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4548 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4548 force_disable_overscroll_content_ = force_disable; 4549 force_disable_overscroll_content_ = force_disable;
4549 if (view_) 4550 if (view_)
4550 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4551 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4551 } 4552 }
4552 4553
4553 } // namespace content 4554 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698