// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_TOOLBAR_BUTTON_DELEGATE_H_ #define CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_TOOLBAR_BUTTON_DELEGATE_H_ #include <optional> #include <string> #include "base/callback_list.h" #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "ui/base/models/image_model.h" class Browser; class Profile; class AvatarToolbarButton; enum class AvatarDelayType; namespace ui { class ColorProvider; } // Internal structures. namespace internal { class StateManager; enum class ButtonState; } // namespace internal namespace gfx { class Canvas; class Rect; } // namespace gfx // Handles the business logic for AvatarToolbarButton. // Listens to Chrome and Profile changes in order to compute the proper state of // the button. This state is used to compute the information requested by // the button to be shown, such as Text and color, Icon, tooltip text etc... // The different states that can be reached: // - Regular state: regular browsing session. // - Private mode: Incognito or Guest browser sessions. // - Identity name shown: the identity name is shown for a short period of time. // This can be triggered by identity changes in Chrome or when an IPH is // showing. // - Explicit modifications override: such as displaying specific text when // intercept bubbles are displayed. // - Sync paused/error state. class AvatarToolbarButtonDelegate : public signin::IdentityManager::Observer { … }; #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_TOOLBAR_BUTTON_DELEGATE_H_