2019-07-24 23:01:08 +00:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#include "shell/browser/extensions/electron_navigation_ui_data.h"
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "content/public/browser/navigation_handle.h"
|
|
|
|
#include "extensions/common/constants.h"
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
ElectronNavigationUIData::ElectronNavigationUIData() = default;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
ElectronNavigationUIData::ElectronNavigationUIData(
|
2019-07-24 23:01:08 +00:00
|
|
|
content::NavigationHandle* navigation_handle) {
|
|
|
|
extension_data_ = std::make_unique<ExtensionNavigationUIData>(
|
|
|
|
navigation_handle, extension_misc::kUnknownTabId,
|
|
|
|
extension_misc::kUnknownWindowId);
|
|
|
|
}
|
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
ElectronNavigationUIData::~ElectronNavigationUIData() = default;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
std::unique_ptr<content::NavigationUIData> ElectronNavigationUIData::Clone() {
|
|
|
|
std::unique_ptr<ElectronNavigationUIData> copy =
|
|
|
|
std::make_unique<ElectronNavigationUIData>();
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
if (extension_data_)
|
|
|
|
copy->SetExtensionNavigationUIData(extension_data_->DeepCopy());
|
|
|
|
|
|
|
|
return std::move(copy);
|
|
|
|
}
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
void ElectronNavigationUIData::SetExtensionNavigationUIData(
|
2019-07-24 23:01:08 +00:00
|
|
|
std::unique_ptr<ExtensionNavigationUIData> extension_data) {
|
|
|
|
extension_data_ = std::move(extension_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace extensions
|