Ignore non-active fullscreen windows for shelf state.
[chromium-blink-merge.git] / content / browser / renderer_host / render_view_host_factory.cc
blobfe51c7efe69e2e70e569af6e945298fb88e7ea93
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
3 // found in the LICENSE file.
5 #include "content/browser/renderer_host/render_view_host_factory.h"
7 #include "base/logging.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h"
10 namespace content {
12 // static
13 RenderViewHostFactory* RenderViewHostFactory::factory_ = NULL;
15 // static
16 RenderViewHost* RenderViewHostFactory::Create(
17 SiteInstance* instance,
18 RenderViewHostDelegate* delegate,
19 RenderFrameHostDelegate* frame_delegate,
20 RenderWidgetHostDelegate* widget_delegate,
21 int routing_id,
22 int main_frame_routing_id,
23 bool swapped_out,
24 bool hidden) {
25 if (factory_) {
26 return factory_->CreateRenderViewHost(instance, delegate, frame_delegate,
27 widget_delegate, routing_id,
28 main_frame_routing_id, swapped_out);
30 return new RenderViewHostImpl(instance, delegate, frame_delegate,
31 widget_delegate, routing_id,
32 main_frame_routing_id, swapped_out, hidden);
35 // static
36 void RenderViewHostFactory::RegisterFactory(RenderViewHostFactory* factory) {
37 DCHECK(!factory_) << "Can't register two factories at once.";
38 factory_ = factory;
41 // static
42 void RenderViewHostFactory::UnregisterFactory() {
43 DCHECK(factory_) << "No factory to unregister.";
44 factory_ = NULL;
47 } // namespace content