#include "chrome/browser/ui/toolbar/cast/cast_contextual_menu.h"
#include <memory>
#include <string>
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/media_router/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "extensions/common/constants.h"
#include "ui/base/models/image_model.h"
#include "ui/base/models/menu_model_delegate.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
std::unique_ptr<CastContextualMenu> CastContextualMenu::Create(
Browser* browser,
Observer* observer) { … }
CastContextualMenu::CastContextualMenu(Browser* browser,
bool shown_by_policy,
Observer* observer)
: … { … }
CastContextualMenu::~CastContextualMenu() = default;
std::unique_ptr<ui::SimpleMenuModel>
CastContextualMenu::CreateMenuModel() { … }
bool CastContextualMenu::GetAlwaysShowActionPref() const { … }
void CastContextualMenu::SetAlwaysShowActionPref(bool always_show) { … }
bool CastContextualMenu::IsCommandIdChecked(int command_id) const { … }
bool CastContextualMenu::IsCommandIdEnabled(int command_id) const { … }
bool CastContextualMenu::IsCommandIdVisible(int command_id) const { … }
void CastContextualMenu::ExecuteCommand(int command_id,
int event_flags) { … }
void CastContextualMenu::OnMenuWillShow(ui::SimpleMenuModel* source) { … }
void CastContextualMenu::MenuClosed(ui::SimpleMenuModel* source) { … }
void CastContextualMenu::ToggleMediaRemoting() { … }
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
void CastContextualMenu::ReportIssue() {
ShowSingletonTab(
browser_,
GURL(base::StrCat({"chrome://", chrome::kChromeUICastFeedbackHost})));
}
#endif