| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROFILES_AVATAR_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Sets the image for the avatar button. Rectangular images, as opposed | 43 // Sets the image for the avatar button. Rectangular images, as opposed |
| 44 // to Chrome avatar icons, will be resized and modified for the title bar. | 44 // to Chrome avatar icons, will be resized and modified for the title bar. |
| 45 virtual void SetAvatarIcon(const gfx::Image& icon, bool is_rectangle); | 45 virtual void SetAvatarIcon(const gfx::Image& icon, bool is_rectangle); |
| 46 | 46 |
| 47 void set_button_on_right(bool button_on_right) { | 47 void set_button_on_right(bool button_on_right) { |
| 48 button_on_right_ = button_on_right; | 48 button_on_right_ = button_on_right; |
| 49 } | 49 } |
| 50 bool button_on_right() { return button_on_right_; } | 50 bool button_on_right() { return button_on_right_; } |
| 51 | 51 |
| 52 void ShowAvatarBubble(); | |
| 53 | |
| 54 private: | 52 private: |
| 55 // views::MenuButtonListener: | 53 // views::MenuButtonListener: |
| 56 virtual void OnMenuButtonClicked(views::View* source, | 54 virtual void OnMenuButtonClicked(views::View* source, |
| 57 const gfx::Point& point) OVERRIDE; | 55 const gfx::Point& point) OVERRIDE; |
| 58 | 56 |
| 59 Browser* browser_; | 57 Browser* browser_; |
| 60 bool disabled_; | 58 bool disabled_; |
| 61 scoped_ptr<ui::MenuModel> menu_model_; | 59 scoped_ptr<ui::MenuModel> menu_model_; |
| 62 | 60 |
| 63 // Use a scoped ptr because gfx::Image doesn't have a default constructor. | 61 // Use a scoped ptr because gfx::Image doesn't have a default constructor. |
| 64 scoped_ptr<gfx::Image> icon_; | 62 scoped_ptr<gfx::Image> icon_; |
| 65 gfx::ImageSkia button_icon_; | 63 gfx::ImageSkia button_icon_; |
| 66 bool is_rectangle_; | 64 bool is_rectangle_; |
| 67 int old_height_; | 65 int old_height_; |
| 68 // True if the avatar button is on the right side of the browser window. | 66 // True if the avatar button is on the right side of the browser window. |
| 69 bool button_on_right_; | 67 bool button_on_right_; |
| 70 | 68 |
| 71 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButton); | 69 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButton); |
| 72 }; | 70 }; |
| 73 | 71 |
| 74 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUTTON_H_ | 72 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUTTON_H_ |
| OLD | NEW |