Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 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 // Creates a new button for the given browser view. | |
| 31 explicit ProfileIndicatorIcon(BrowserView* browser_view); | |
| 32 | |
| 33 ~ProfileIndicatorIcon() override; | |
| 34 | |
| 35 // views::MenuButton: | |
| 36 void OnPaint(gfx::Canvas* canvas) override; | |
| 37 | |
| 38 // Sets the image for the avatar button. Rectangular images, as opposed | |
| 39 // to Chrome avatar icons, will be resized and modified for the title bar. | |
| 40 virtual void SetIcon(const gfx::Image& icon); | |
| 41 | |
| 42 private: | |
| 43 BrowserView* browser_view_; | |
| 44 | |
|
Peter Kasting
2016/05/17 03:51:43
Nit: Unnecessary blank line
Evan Stade
2016/05/17 18:13:09
Done.
| |
| 45 gfx::Image base_icon_; | |
| 46 gfx::ImageSkia modified_icon_; | |
| 47 int old_height_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(ProfileIndicatorIcon); | |
| 50 }; | |
| 51 | |
| 52 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_ | |
| OLD | NEW |