Don't preload rarely seen large images
[chromium-blink-merge.git] / components / guest_view / renderer / iframe_guest_view_container.cc
blobf26738304cccaa89374e12406b7ac54deb76a340
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/guest_view/renderer/iframe_guest_view_container.h"
7 #include "base/command_line.h"
8 #include "components/guest_view/common/guest_view_messages.h"
9 #include "content/public/common/content_switches.h"
10 #include "content/public/renderer/render_frame.h"
12 namespace guest_view {
14 IframeGuestViewContainer::IframeGuestViewContainer(
15 content::RenderFrame* render_frame)
16 : GuestViewContainer(render_frame) {
17 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
18 switches::kSitePerProcess));
19 // There is no BrowserPluginDelegate to wait for.
20 ready_ = true;
23 IframeGuestViewContainer::~IframeGuestViewContainer() {
26 bool IframeGuestViewContainer::OnMessage(const IPC::Message& message) {
27 // TODO(lazyboy): Do not send this message in --site-per-process.
28 if (message.type() == GuestViewMsg_GuestAttached::ID)
29 return true;
31 if (message.type() != GuestViewMsg_AttachToEmbedderFrame_ACK::ID)
32 return false;
34 OnHandleCallback(message);
35 return true;
38 } // namespace guest_view