blob: 9bc4cddab519541eff4f7d8fde59ca49f52ae9b6 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include <memory>
#include <vector>
#include "base/macros.h"
#include "chrome/browser/profiles/profile_list.h"
class ProfileAttributesStorage;
// This model represents the profiles added to desktop Chrome (as opposed to
// Chrome OS). Profiles marked not to appear in the list will be omitted
// throughout.
class ProfileListDesktop : public ProfileList {
explicit ProfileListDesktop(ProfileAttributesStorage* profile_storage);
~ProfileListDesktop() override;
// ProfileList overrides:
size_t GetNumberOfItems() const override;
const AvatarMenu::Item& GetItemAt(size_t index) const override;
void RebuildMenu() override;
// Returns the menu index of the profile with |path| in the
// ProfileAttributesStorage. The profile with the |path| must exist, and it
// may not be marked as omitted from the menu.
size_t MenuIndexFromProfilePath(const base::FilePath& path) const override;
void ActiveProfilePathChanged(
const base::FilePath& active_profile_path) override;
// The storage that provides the profile attributes. Not owned.
ProfileAttributesStorage* profile_storage_;
// The path of the currently active profile.
base::FilePath active_profile_path_;
// List of built "menu items."
std::vector<std::unique_ptr<AvatarMenu::Item>> items_;