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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/profiles/avatar_menu.h" | 11 #include "chrome/browser/profiles/avatar_menu.h" |
12 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 12 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
13 #include "chrome/browser/profiles/profile_metrics.h" | 13 #include "chrome/browser/profiles/profile_metrics.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/views/frame/browser_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_view.h" |
16 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" | 16 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
17 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 17 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "chrome/common/profile_management_switches.h" | 19 #include "components/signin/core/common/profile_management_switches.h" |
20 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
21 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
23 | 23 |
24 static inline int Round(double x) { | 24 static inline int Round(double x) { |
25 return static_cast<int>(x + 0.5); | 25 return static_cast<int>(x + 0.5); |
26 } | 26 } |
27 | 27 |
28 // static | 28 // static |
29 const char AvatarMenuButton::kViewClassName[] = "AvatarMenuButton"; | 29 const char AvatarMenuButton::kViewClassName[] = "AvatarMenuButton"; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 this, arrow, views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds, | 111 this, arrow, views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds, |
112 browser_); | 112 browser_); |
113 } else { | 113 } else { |
114 AvatarMenuBubbleView::ShowBubble( | 114 AvatarMenuBubbleView::ShowBubble( |
115 this, arrow, views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds, | 115 this, arrow, views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds, |
116 browser_); | 116 browser_); |
117 } | 117 } |
118 | 118 |
119 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); | 119 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); |
120 } | 120 } |
OLD | NEW |