#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 {
base::LazyInstance<base::FilePath>::Leaky
last_save_dir = …;
void CreateAndAddNetExportHTMLSource(Profile* profile) { … }
class NetExportMessageHandler final
: public WebUIMessageHandler,
public ui::SelectFileDialog::Listener,
public net_log::NetExportFileWriter::StateObserver { … };
NetExportMessageHandler::NetExportMessageHandler()
: … { … }
NetExportMessageHandler::~NetExportMessageHandler() { … }
void NetExportMessageHandler::RegisterMessages() { … }
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) { … }
void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) { … }
void NetExportMessageHandler::StartNetLog(const base::FilePath& path) { … }
void NetExportMessageHandler::ShowFileInShell(const base::FilePath& path) { … }
bool NetExportMessageHandler::UsingMobileUI() { … }
void NetExportMessageHandler::NotifyUIWithState(
const base::Value::Dict& state) { … }
void NetExportMessageHandler::ShowSelectFileDialog(
const base::FilePath& default_path) { … }
}
NetExportUI::NetExportUI(content::WebUI* web_ui) : … { … }