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

Unified 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 side-by-side diff with in-line comments
Download patch
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..4c14ca3797351336d37e4cdd6655d7bb228fdca0
--- /dev/null
+++ b/chrome/browser/ui/views/profiles/profile_indicator_icon.h
@@ -0,0 +1,47 @@
+// Copyright 2016 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.
+
+#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:
+ ProfileIndicatorIcon();
+ ~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.
+ void SetIcon(const gfx::Image& icon);
+
+ private:
+ 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_

Powered by Google App Engine
This is Rietveld 408576698