Index: chrome/browser/ui/views/avatar_menu_button.h |
=================================================================== |
--- chrome/browser/ui/views/avatar_menu_button.h (revision 88024) |
+++ chrome/browser/ui/views/avatar_menu_button.h (working copy) |
@@ -2,8 +2,8 @@ |
// 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_PROFILE_MENU_BUTTON_H_ |
-#define CHROME_BROWSER_UI_VIEWS_PROFILE_MENU_BUTTON_H_ |
+#ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |
+#define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |
#pragma once |
#include <string> |
@@ -13,49 +13,31 @@ |
#include "views/controls/button/menu_button.h" |
#include "views/controls/menu/view_menu_delegate.h" |
-class Profile; |
-class ProfileMenuModel; |
- |
namespace gfx { |
class Canvas; |
} |
-namespace ui { |
-class Accelerator; |
-} |
- |
-// ProfileMenuButton |
+// AvatarMenuButton |
// |
-// Shows the button for the multiprofile menu with an image layered |
-// underneath that displays the profile tag. |
+// A button used to show either the incognito avatar or the profile avatar. |
+// The button can optionally have a menu attached to it. |
-class ProfileMenuButton : public views::MenuButton, |
- public views::ViewMenuDelegate { |
+class AvatarMenuButton : public views::MenuButton, |
+ public views::ViewMenuDelegate { |
public: |
- // DefaultActiveTextShadow is a darkened blue color that works with Windows |
- // default theme background coloring. |
- static const SkColor kDefaultActiveTextShadow = 0xFF708DB3; |
- // InactiveTextShadow is a light gray for inactive default themed buttons. |
- static const SkColor kDefaultInactiveTextShadow = SK_ColorLTGRAY; |
- // DarkTextShadow is used to shadow names on themed browser frames. |
- static const SkColor kDarkTextShadow = SK_ColorGRAY; |
- // Space between window controls and end of profile tag. |
- static const int kProfileTagHorizontalSpacing = 5; |
+ AvatarMenuButton(const std::wstring& text, ui::MenuModel* menu_model); |
sky
2011/06/09 15:46:46
Document AvatarMenuButton takes ownership of the m
sail
2011/06/10 00:56:20
Done.
|
- ProfileMenuButton(const std::wstring& text, Profile* profile); |
+ virtual ~AvatarMenuButton(); |
- virtual ~ProfileMenuButton(); |
+ virtual void OnPaint(gfx::Canvas* canvas); |
Peter Kasting
2011/06/09 18:03:31
Nit: OVERRIDE?
May want to add "// views::MenuBut
sail
2011/06/10 00:56:20
Done.
|
- // Override MenuButton to clamp text at kMaxTextWidth. |
- virtual void SetText(const std::wstring& text) OVERRIDE; |
- |
private: |
// Overridden from views::ViewMenuDelegate: |
Peter Kasting
2011/06/09 18:03:31
Nit: Feel free to remove "Overridden from" and tra
sail
2011/06/10 00:56:20
Done.
|
virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; |
- scoped_ptr<ProfileMenuModel> profile_menu_model_; |
+ scoped_ptr<ui::MenuModel> menu_model_; |
- DISALLOW_COPY_AND_ASSIGN(ProfileMenuButton); |
+ DISALLOW_COPY_AND_ASSIGN(AvatarMenuButton); |
}; |
-#endif // CHROME_BROWSER_UI_VIEWS_PROFILE_MENU_BUTTON_H_ |
+#endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |