OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 public views::MenuButtonListener { | 32 public views::MenuButtonListener { |
33 public: | 33 public: |
34 // Creates a new button. If |incognito| is true and we're not in managed mode, | 34 // Creates a new button. If |incognito| is true and we're not in managed mode, |
35 // clicking on the button will cause the profile menu to be displayed. | 35 // clicking on the button will cause the profile menu to be displayed. |
36 AvatarMenuButton(Browser* browser, bool incognito); | 36 AvatarMenuButton(Browser* browser, bool incognito); |
37 | 37 |
38 virtual ~AvatarMenuButton(); | 38 virtual ~AvatarMenuButton(); |
39 | 39 |
40 // views::MenuButton: | 40 // views::MenuButton: |
41 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 41 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
42 virtual bool HitTest(const gfx::Point& point) const OVERRIDE; | 42 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
43 | 43 |
44 virtual void SetAvatarIcon(const gfx::Image& icon, | 44 virtual void SetAvatarIcon(const gfx::Image& icon, |
45 bool is_gaia_picture); | 45 bool is_gaia_picture); |
46 | 46 |
47 void ShowAvatarBubble(); | 47 void ShowAvatarBubble(); |
48 | 48 |
49 private: | 49 private: |
50 // views::MenuButtonListener: | 50 // views::MenuButtonListener: |
51 virtual void OnMenuButtonClicked(views::View* source, | 51 virtual void OnMenuButtonClicked(views::View* source, |
52 const gfx::Point& point) OVERRIDE; | 52 const gfx::Point& point) OVERRIDE; |
53 | 53 |
54 void ButtonClicked(); | 54 void ButtonClicked(); |
55 | 55 |
56 Browser* browser_; | 56 Browser* browser_; |
57 bool incognito_; | 57 bool incognito_; |
58 scoped_ptr<ui::MenuModel> menu_model_; | 58 scoped_ptr<ui::MenuModel> menu_model_; |
59 | 59 |
60 // Use a scoped ptr because gfx::Image doesn't have a default constructor. | 60 // Use a scoped ptr because gfx::Image doesn't have a default constructor. |
61 scoped_ptr<gfx::Image> icon_; | 61 scoped_ptr<gfx::Image> icon_; |
62 gfx::ImageSkia button_icon_; | 62 gfx::ImageSkia button_icon_; |
63 bool is_gaia_picture_; | 63 bool is_gaia_picture_; |
64 int old_height_; | 64 int old_height_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButton); | 66 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButton); |
67 }; | 67 }; |
68 | 68 |
69 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ | 69 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUTTON_H_ |
OLD | NEW |