This source file includes following definitions.
- Create
- AddNewProfile
- EditProfile
- ShouldShowAddNewProfileLink
- ShouldShowEditProfileLink
- ActiveBrowserChanged
#include "chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.h"
#include "ash/multi_profile_uma.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/profiles/profile_info_util.h"
#include "chrome/browser/ui/browser.h"
AvatarMenuActions* AvatarMenuActions::Create() {
return new chromeos::AvatarMenuActionsChromeOS();
}
namespace chromeos {
AvatarMenuActionsChromeOS::AvatarMenuActionsChromeOS() {
}
AvatarMenuActionsChromeOS::~AvatarMenuActionsChromeOS() {
}
void AvatarMenuActionsChromeOS::AddNewProfile(ProfileMetrics::ProfileAdd type) {
ash::MultiProfileUMA::RecordSigninUser(
ash::MultiProfileUMA::SIGNIN_USER_BY_BROWSER_FRAME);
ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin();
}
void AvatarMenuActionsChromeOS::EditProfile(Profile* profile, size_t index) {
NOTIMPLEMENTED();
}
bool AvatarMenuActionsChromeOS::ShouldShowAddNewProfileLink() const {
return (!browser_ || !browser_->profile()->IsManaged()) &&
UserManager::Get()->GetUsersAdmittedForMultiProfile().size();
}
bool AvatarMenuActionsChromeOS::ShouldShowEditProfileLink() const {
return false;
}
void AvatarMenuActionsChromeOS::ActiveBrowserChanged(Browser* browser) {
browser_ = browser;
}
}