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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.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: Nits, minor refactoring 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/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index 947622c4bbf6d54027ee96fa2b8595998d81cf5d..114e65be4427a240409043b2e700e79e98055e49 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/ui/views/frame/browser_header_painter_ash.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/immersive_mode_controller.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/tab_icon_view.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
@@ -44,6 +43,10 @@
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+#if defined(ENABLE_MANAGED_USERS)
+#include "chrome/browser/ui/views/profiles/supervised_user_avatar_label.h"
+#endif
+
namespace {
// The avatar ends 2 px above the bottom of the tabstrip (which, given the
@@ -201,10 +204,15 @@ int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) {
// See if the point is actually within the avatar menu button or within
// the avatar label.
- if (hit_test == HTCAPTION && ((avatar_button() &&
- avatar_button()->GetMirroredBounds().Contains(point)) ||
- (avatar_label() && avatar_label()->GetMirroredBounds().Contains(point))))
+#if defined(ENABLE_MANAGED_USERS)
+ if (IsWithinAvatarMenuButton(hit_test, point) ||
Bernhard Bauer 2014/07/14 16:39:05 You could probably pull this check out of the #ifd
mckev 2014/07/14 23:50:03 Yep, certainly. Would you prefer it to still be e
Bernhard Bauer 2014/07/16 09:53:59 Yeah, it might make sense to inline this.
+ (supervised_user_avatar_label() &&
+ supervised_user_avatar_label()->GetMirroredBounds().Contains(point)))
+ return HTCLIENT;
+#else
+ if (IsWithinAvatarMenuButton(hit_test, point))
return HTCLIENT;
+#endif
// When the window is restored we want a large click target above the tabs
// to drag the window, so redirect clicks in the tab's shadow to caption.
@@ -221,6 +229,13 @@ int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) {
return hit_test;
}
+bool BrowserNonClientFrameViewAsh::IsWithinAvatarMenuButton(
+ const int hit_test,
+ const gfx::Point& point) const {
+ return hit_test == HTCAPTION && ((avatar_button() &&
+ avatar_button()->GetMirroredBounds().Contains(point)));
+}
+
void BrowserNonClientFrameViewAsh::GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) {
// Aura does not use window masks.

Powered by Google App Engine
This is Rietveld 408576698