chromium/chrome/browser/ui/webui/net_export_ui.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/webui/net_export_ui.h"

#include <stdint.h>

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/net/net_export_helper.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/url_constants.h"
#include "components/grit/dev_ui_components_resources.h"
#include "components/net_log/net_export_file_writer.h"
#include "components/net_log/net_export_ui_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "extensions/buildflags/buildflags.h"
#include "net/log/net_log_capture_mode.h"
#include "ui/shell_dialogs/select_file_dialog.h"
#include "ui/shell_dialogs/selected_file_info.h"

#if BUILDFLAG(IS_ANDROID)
#include "components/browser_ui/share/android/intent_helper.h"
#endif

BrowserThread;
WebContents;
WebUIMessageHandler;

namespace {

// May only be accessed on the UI thread
base::LazyInstance<base::FilePath>::Leaky
    last_save_dir =;

void CreateAndAddNetExportHTMLSource(Profile* profile) {}

// This class receives javascript messages from the renderer.
// Note that the WebUI infrastructure runs on the UI thread, therefore all of
// this class's public methods are expected to run on the UI thread.
class NetExportMessageHandler final
    : public WebUIMessageHandler,
      public ui::SelectFileDialog::Listener,
      public net_log::NetExportFileWriter::StateObserver {};

NetExportMessageHandler::NetExportMessageHandler()
    :{}

NetExportMessageHandler::~NetExportMessageHandler() {}

void NetExportMessageHandler::RegisterMessages() {}

// The net-export UI is not notified of state changes until this function runs.
// After this function, NotifyUIWithState() will be called on all |file_writer_|
// state changes.
void NetExportMessageHandler::OnEnableNotifyUIWithState(
    const base::Value::List& list) {}

void NetExportMessageHandler::OnStartNetLog(const base::Value::List& params) {}

void NetExportMessageHandler::OnStopNetLog(const base::Value::List& list) {}

void NetExportMessageHandler::OnSendNetLog(const base::Value::List& list) {}

void NetExportMessageHandler::OnShowFile(const base::Value::List& list) {}

void NetExportMessageHandler::FileSelected(const ui::SelectedFileInfo& file,
                                           int index) {}

void NetExportMessageHandler::FileSelectionCanceled() {}

void NetExportMessageHandler::OnNewState(const base::Value::Dict& state) {}

// static
void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) {}

void NetExportMessageHandler::StartNetLog(const base::FilePath& path) {}

void NetExportMessageHandler::ShowFileInShell(const base::FilePath& path) {}

// static
bool NetExportMessageHandler::UsingMobileUI() {}

void NetExportMessageHandler::NotifyUIWithState(
    const base::Value::Dict& state) {}

void NetExportMessageHandler::ShowSelectFileDialog(
    const base::FilePath& default_path) {}

}  // namespace

NetExportUI::NetExportUI(content::WebUI* web_ui) :{}