| Index: content/browser/frame_host/navigation_handle_factory.cc
|
| diff --git a/content/browser/frame_host/navigation_handle_factory.cc b/content/browser/frame_host/navigation_handle_factory.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c2157b00bbb42d8a87febcd5ffebfd29f8da0631
|
| --- /dev/null
|
| +++ b/content/browser/frame_host/navigation_handle_factory.cc
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/frame_host/navigation_handle_factory.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "content/browser/frame_host/navigation_handle_impl.h"
|
| +
|
| +namespace content {
|
| +
|
| +namespace {
|
| +
|
| +NavigationHandleFactory* g_factory = nullptr;
|
| +
|
| +}
|
| +
|
| +// static
|
| +scoped_ptr<NavigationHandleImpl> NavigationHandleFactory::Create(
|
| + const GURL& url,
|
| + const GURL& validated_url,
|
| + bool is_main_frame,
|
| + NavigatorDelegate* delegate) {
|
| + if (g_factory)
|
| + return g_factory->CreateHandle(url, validated_url, is_main_frame, delegate);
|
| +
|
| + return scoped_ptr<NavigationHandleImpl>(
|
| + new NavigationHandleImpl(url, validated_url, is_main_frame, delegate));
|
| +}
|
| +
|
| +// static
|
| +void NavigationHandleFactory::SetFactoryForTesting(
|
| + NavigationHandleFactory* factory) {
|
| + DCHECK(g_factory == nullptr || factory == nullptr);
|
| + g_factory = factory;
|
| +}
|
| +
|
| +NavigationHandleFactory::~NavigationHandleFactory() {}
|
| +
|
| +} // namespace content
|
|
|