#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/webui/flags/flags_ui.h"
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/flags/flags_ui_handler.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/pref_names.h"
#include "components/flags_ui/flags_ui_constants.h"
#include "components/flags_ui/flags_ui_pref_names.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/grit/components_scaled_resources.h"
#include "components/grit/flags_ui_resources.h"
#include "components/grit/flags_ui_resources_map.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_branded_strings.h"
#include "components/strings/grit/components_strings.h"
#include "components/version_info/version_info.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 "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/webui_resources.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_switches.h"
#include "base/command_line.h"
#include "base/system/sys_info.h"
#include "chrome/browser/ash/login/session/user_session_manager.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/infobars/simple_alert_infobar_creator.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/ash/components/settings/cros_settings.h"
#include "components/account_id/account_id.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/simple_alert_infobar_delegate.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/user_manager/user_manager.h"
#include "components/vector_icons/vector_icons.h"
#endif
WebContents;
WebUIMessageHandler;
namespace {
content::WebUIDataSource* CreateAndAddFlagsUIHTMLSource(Profile* profile) { … }
void FinishInitialization(base::WeakPtr<FlagsUI> flags_ui,
Profile* profile,
FlagsUIHandler* dom_handler,
std::unique_ptr<flags_ui::FlagsStorage> storage,
flags_ui::FlagAccess access) { … }
}
void FlagsUI::AddStrings(content::WebUIDataSource* source) { … }
FlagsUIHandler* InitializeHandler(content::WebUI* web_ui,
Profile* profile,
base::WeakPtrFactory<FlagsUI>& weak_factory) { … }
FlagsUI::FlagsUI(content::WebUI* web_ui)
: … { … }
FlagsUI::~FlagsUI() { … }
base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes(
ui::ResourceScaleFactor scale_factor) { … }