Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/profile_indicator_icon.h |
| diff --git a/chrome/browser/ui/views/profiles/profile_indicator_icon.h b/chrome/browser/ui/views/profiles/profile_indicator_icon.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3cb374812dbffe6aab3cb0b31eff5ae9534a0570 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/profiles/profile_indicator_icon.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
Peter Kasting
2016/05/17 03:51:43
Nit: 2016
Evan Stade
2016/05/17 18:13:09
Done.
|
| +// 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_PROFILE_INDICATOR_ICON_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/macros.h" |
| +#include "ui/gfx/image/image.h" |
| +#include "ui/views/view.h" |
| + |
| +namespace gfx { |
| +class Canvas; |
| +} |
| +class BrowserNonClientFrameView; |
| +class BrowserView; |
| +class Profile; |
| + |
| +// ProfileIndicatorIcon |
| +// |
| +// A view used to show either the incognito avatar, or in the case of CrOS multi |
| +// profile mode with teleported windows, a profile avatar. The icon set via |
| +// SetIcon() will be resized and drawn inside a circle if it's too big to fit in |
| +// the frame. |
| +class ProfileIndicatorIcon : public views::View { |
| + public: |
| + // Creates a new button for the given browser view. |
| + explicit ProfileIndicatorIcon(BrowserView* browser_view); |
| + |
| + ~ProfileIndicatorIcon() override; |
| + |
| + // views::MenuButton: |
| + void OnPaint(gfx::Canvas* canvas) override; |
| + |
| + // Sets the image for the avatar button. Rectangular images, as opposed |
| + // to Chrome avatar icons, will be resized and modified for the title bar. |
| + virtual void SetIcon(const gfx::Image& icon); |
| + |
| + private: |
| + BrowserView* browser_view_; |
| + |
|
Peter Kasting
2016/05/17 03:51:43
Nit: Unnecessary blank line
Evan Stade
2016/05/17 18:13:09
Done.
|
| + gfx::Image base_icon_; |
| + gfx::ImageSkia modified_icon_; |
| + int old_height_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ProfileIndicatorIcon); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_ |