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 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 5 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | |
11 #include "build/build_config.h" | 10 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/profiles/avatar_menu.h" | 13 #include "chrome/browser/profiles/avatar_menu.h" |
15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 15 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
17 #include "chrome/browser/profiles/profile_info_cache.h" | 16 #include "chrome/browser/profiles/profile_info_cache.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/profiles/profile_metrics.h" | 18 #include "chrome/browser/profiles/profile_metrics.h" |
20 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
22 #include "chrome/browser/ui/views/frame/browser_view.h" | 21 #include "chrome/browser/ui/views/frame/browser_view.h" |
23 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 22 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 23 #include "components/prefs/pref_service.h" |
24 #include "components/signin/core/common/profile_management_switches.h" | 24 #include "components/signin/core/common/profile_management_switches.h" |
25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
28 #include "ui/gfx/canvas.h" | 28 #include "ui/gfx/canvas.h" |
29 #include "ui/views/view_targeter.h" | 29 #include "ui/views/view_targeter.h" |
30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
31 | 31 |
32 static inline int Round(double x) { | 32 static inline int Round(double x) { |
33 return static_cast<int>(x + 0.5); | 33 return static_cast<int>(x + 0.5); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return enabled_ && | 148 return enabled_ && |
149 views::ViewTargeterDelegate::DoesIntersectRect(target, rect); | 149 views::ViewTargeterDelegate::DoesIntersectRect(target, rect); |
150 } | 150 } |
151 | 151 |
152 // views::MenuButtonListener implementation | 152 // views::MenuButtonListener implementation |
153 void AvatarMenuButton::OnMenuButtonClicked(views::View* source, | 153 void AvatarMenuButton::OnMenuButtonClicked(views::View* source, |
154 const gfx::Point& point) { | 154 const gfx::Point& point) { |
155 if (enabled_) | 155 if (enabled_) |
156 chrome::ShowAvatarMenu(browser_view_->browser()); | 156 chrome::ShowAvatarMenu(browser_view_->browser()); |
157 } | 157 } |
OLD | NEW |