| 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 88814b06df20556a57fd11f143767374f491e8a2..479d51e6fb3ff2d151e479bb2341e0c26e540422 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"
|
| @@ -52,6 +51,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
|
| @@ -204,18 +207,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);
|
|
|
|
|