Skip to content

Commit

Permalink
Added hit test for ChromeOS avatar when visible.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelpg@chromium.org committed Sep 7, 2013
1 parent fa42f2b commit 7064131
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions ash/wm/frame_painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ int FramePainter::NonClientHitTest(views::NonClientFrameView* view,
if (!expanded_bounds.Contains(point))
return HTNOWHERE;

// No avatar button.

// Check the frame first, as we allow a small area overlapping the contents
// to be used for resize handles.
bool can_ever_resize = frame_->widget_delegate() ?
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/profiles/avatar_menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ void AvatarMenuModel::Observe(int type,

// static
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) ==
kAlwaysShowSwitcherGroupName) {
// We should only be in this group when multi-profiles is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/browser.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/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
Expand Down Expand Up @@ -154,6 +155,14 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds(

int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& 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
// to drag the window, so redirect clicks in the tab's shadow to caption.
if (hit_test == HTCLIENT &&
Expand Down

0 comments on commit 7064131

Please sign in to comment.