Added hit test for ChromeOS avatar when visible.

BUG=282594
TEST=Run ChromeOS with flags:
     --force-fieldtrials="ShowProfileSwitcher/AlwaysShow/"
     --multi-profiles

Review URL: https://chromiumcodereview.appspot.com/23583037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221857 0039d316-1c4b-4281-b951-d872f2087c98
parent fa42f2bf
...@@ -321,8 +321,6 @@ int FramePainter::NonClientHitTest(views::NonClientFrameView* view, ...@@ -321,8 +321,6 @@ int FramePainter::NonClientHitTest(views::NonClientFrameView* view,
if (!expanded_bounds.Contains(point)) if (!expanded_bounds.Contains(point))
return HTNOWHERE; return HTNOWHERE;
// No avatar button.
// Check the frame first, as we allow a small area overlapping the contents // Check the frame first, as we allow a small area overlapping the contents
// to be used for resize handles. // to be used for resize handles.
bool can_ever_resize = frame_->widget_delegate() ? bool can_ever_resize = frame_->widget_delegate() ?
......
...@@ -272,11 +272,6 @@ void AvatarMenuModel::Observe(int type, ...@@ -272,11 +272,6 @@ void AvatarMenuModel::Observe(int type,
// static // static
bool AvatarMenuModel::ShouldShowAvatarMenu() { bool AvatarMenuModel::ShouldShowAvatarMenu() {
#if defined(OS_CHROMEOS)
// On Chrome OS we use different UI for multi-profiles.
return false;
#endif
if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) == if (base::FieldTrialList::FindFullName(kShowProfileSwitcherFieldTrialName) ==
kAlwaysShowSwitcherGroupName) { kAlwaysShowSwitcherGroupName) {
// We should only be in this group when multi-profiles is enabled. // We should only be in this group when multi-profiles is enabled.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/immersive_fullscreen_configuration.h" #include "chrome/browser/ui/immersive_fullscreen_configuration.h"
#include "chrome/browser/ui/views/avatar_label.h"
#include "chrome/browser/ui/views/avatar_menu_button.h" #include "chrome/browser/ui/views/avatar_menu_button.h"
#include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
...@@ -154,6 +155,14 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds( ...@@ -154,6 +155,14 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds(
int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) { int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) {
int hit_test = frame_painter_->NonClientHitTest(this, point); int hit_test = frame_painter_->NonClientHitTest(this, 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))))
return HTCLIENT;
// When the window is restored we want a large click target above the tabs // 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. // to drag the window, so redirect clicks in the tab's shadow to caption.
if (hit_test == HTCLIENT && if (hit_test == HTCLIENT &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment