Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
index 6b3956817a13098feab249625e1cec74692ca786..c5ac9473c9e3a2cea0278e4b546d6eb3fa8f6a72 100644 |
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc |
@@ -18,7 +18,6 @@ |
#include "chrome/browser/ui/views/frame/browser_view.h" |
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" |
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view_platform_specific.h" |
-#include "chrome/browser/ui/views/profiles/avatar_label.h" |
#include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
#include "chrome/browser/ui/views/profiles/new_avatar_button.h" |
#include "chrome/browser/ui/views/tab_icon_view.h" |
@@ -53,6 +52,10 @@ |
#include "ui/views/window/frame_background.h" |
#include "ui/views/window/window_shape.h" |
+#if defined(ENABLE_MANAGED_USERS) |
+#include "chrome/browser/ui/views/profiles/supervised_user_avatar_label.h" |
+#endif |
+ |
#if defined(OS_LINUX) |
#include "ui/views/controls/menu/menu_runner.h" |
#endif |
@@ -205,18 +208,33 @@ gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( |
return layout_->GetWindowBoundsForClientBounds(client_bounds); |
} |
+bool OpaqueBrowserFrameView::IsWithinAvatarMenuButtons( |
+ const gfx::Point& point) const { |
+ if (avatar_button() && |
+ avatar_button()->GetMirroredBounds().Contains(point)) { |
+ return true; |
+ } |
+ if (new_avatar_button() && |
+ new_avatar_button()->GetMirroredBounds().Contains(point)) { |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { |
if (!bounds().Contains(point)) |
return HTNOWHERE; |
- // See if the point is within the avatar menu button or within the avatar |
- // label. |
- if ((avatar_button() && |
- avatar_button()->GetMirroredBounds().Contains(point)) || |
- (avatar_label() && avatar_label()->GetMirroredBounds().Contains(point)) || |
- (new_avatar_button() && |
- new_avatar_button()->GetMirroredBounds().Contains(point))) |
+ // See if the point is within the avatar menu button. |
+ if (IsWithinAvatarMenuButtons(point)) |
return HTCLIENT; |
+#if defined(ENABLE_MANAGED_USERS) |
+ // ...or within the avatar label, if it's a supervised user. |
+ if ((supervised_user_avatar_label() && |
+ supervised_user_avatar_label()->GetMirroredBounds().Contains(point))) |
+ return HTCLIENT; |
+#endif |
int frame_component = frame()->client_view()->NonClientHitTest(point); |