Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1629)

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 355233002: Fix build when ENABLE_MANAGED_USERS is not defined (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More bauerb comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698