Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: chrome/browser/ui/views/profiles/profile_indicator_icon.h

Issue 1972033002: Simplify some old avatar menu button code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reinstate ash browser test fix Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_
7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "ui/gfx/image/image.h"
13 #include "ui/views/view.h"
14
15 namespace gfx {
16 class Canvas;
17 }
18 class BrowserNonClientFrameView;
19 class BrowserView;
20 class Profile;
21
22 // ProfileIndicatorIcon
23 //
24 // A view used to show either the incognito avatar, or in the case of CrOS multi
25 // profile mode with teleported windows, a profile avatar. The icon set via
26 // SetIcon() will be resized and drawn inside a circle if it's too big to fit in
27 // the frame.
28 class ProfileIndicatorIcon : public views::View {
29 public:
30 ProfileIndicatorIcon();
31 ~ProfileIndicatorIcon() override;
32
33 // views::MenuButton:
34 void OnPaint(gfx::Canvas* canvas) override;
35
36 // Sets the image for the avatar button. Rectangular images, as opposed
37 // to Chrome avatar icons, will be resized and modified for the title bar.
38 void SetIcon(const gfx::Image& icon);
39
40 private:
41 gfx::Image base_icon_;
42 gfx::ImageSkia modified_icon_;
43 int old_height_;
44 DISALLOW_COPY_AND_ASSIGN(ProfileIndicatorIcon);
45 };
46
47 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698