#include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_view_controller.h"
#include <set>
#include <string>
#include <vector>
#include "base/callback_list.h"
#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/flag_descriptions.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_prefs.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.h"
#include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_item_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/common/buildflags.h"
#include "components/flags_ui/feature_entry.h"
#include "components/flags_ui/flags_state.h"
#include "components/flags_ui/flags_storage.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/user_education/common/new_badge_controller.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/settings/about_flags.h"
#include "chrome/browser/profiles/profile.h"
#else
#include "chrome/browser/browser_process.h"
#endif
namespace {
enum class ChromeLabsSelectedLab { … };
void EmitToHistogram(const std::u16string& selected_lab_state,
const std::string& internal_name) { … }
uint32_t GetCurrentDay() { … }
}
ChromeLabsViewController::ChromeLabsViewController(
const ChromeLabsModel* model,
ChromeLabsBubbleView* chrome_labs_bubble_view,
Browser* browser,
flags_ui::FlagsState* flags_state,
flags_ui::FlagsStorage* flags_storage)
: … { … }
int ChromeLabsViewController::GetIndexOfEnabledLabState(
const flags_ui::FeatureEntry* entry,
flags_ui::FlagsState* flags_state,
flags_ui::FlagsStorage* flags_storage) { … }
void ChromeLabsViewController::ParseModelDataAndAddLabs() { … }
void ChromeLabsViewController::RestartToApplyFlags() { … }
void ChromeLabsViewController::SetRestartCallback() { … }
user_education::DisplayNewBadge ChromeLabsViewController::ShouldLabShowNewBadge(
Profile* profile,
const LabInfo& lab) { … }
void ChromeLabsViewController::RestartToApplyFlagsForTesting() { … }