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

Issue 7003080: Change profile menu button to avatar button (Closed)

Created:
9 years, 6 months ago by sail
Modified:
9 years, 6 months ago
CC:
chromium-reviews, dhollowa
Visibility:
Public.

Description

Change profile menu button to avatar button This change doesn't add any new functionality. It simply changes the profile menu button so that it now draws an avatar icon. Once this is checked in next steps will be to: - associate avatar icons to profiles - expand the profile menu BUG=None TEST=Ran on Windows and verified that things look ok. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88683 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88854

Patch Set 1 #

Total comments: 32

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Total comments: 2

Patch Set 4 : '' #

Total comments: 11

Patch Set 5 : Change profile menu button to avatar button #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -642 lines) Patch
D chrome/app/theme/profile_tag_center_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_center_mask.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_center_opaque.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_inactive_center_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_inactive_left_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_inactive_right_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_left_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_left_mask.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_left_opaque.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_right_aero.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_right_mask.png View Binary file 0 comments Download
D chrome/app/theme/profile_tag_right_opaque.png View Binary file 0 comments Download
M chrome/app/theme/theme_resources.grd View 1 2 3 4 1 chunk +1 line, -12 lines 0 comments Download
A + chrome/browser/ui/views/avatar_menu_button.h View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/browser/ui/views/avatar_menu_button.cc View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/glass_browser_frame_view.h View 1 2 3 4 4 chunks +7 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/frame/glass_browser_frame_view.cc View 1 2 3 4 12 chunks +59 lines, -125 lines 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view.h View 1 2 3 4 4 chunks +7 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view.cc View 1 2 3 4 12 chunks +56 lines, -114 lines 0 comments Download
D chrome/browser/ui/views/profile_menu_button.h View 1 2 3 4 1 chunk +0 lines, -61 lines 0 comments Download
D chrome/browser/ui/views/profile_menu_button.cc View 1 2 3 4 1 chunk +0 lines, -62 lines 0 comments Download
D chrome/browser/ui/views/profile_tag_view.h View 1 2 3 4 1 chunk +0 lines, -68 lines 0 comments Download
D chrome/browser/ui/views/profile_tag_view.cc View 1 2 3 4 1 chunk +0 lines, -144 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 4 chunks +4 lines, -6 lines 0 comments Download
M views/controls/button/text_button.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M views/controls/button/text_button.cc View 1 2 3 4 3 chunks +12 lines, -15 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
sail
9 years, 6 months ago (2011-06-09 03:39:13 UTC) #1
Miranda Callahan
Just a couple small things... http://codereview.chromium.org/7003080/diff/1/chrome/app/theme/theme_resources.grd File chrome/app/theme/theme_resources.grd (right): http://codereview.chromium.org/7003080/diff/1/chrome/app/theme/theme_resources.grd#newcode216 chrome/app/theme/theme_resources.grd:216: <include name="IDR_PROFILE_AVATAR_1" file="avatar_cupcake.png" type="BINDATA" ...
9 years, 6 months ago (2011-06-09 13:23:07 UTC) #2
sky
http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.h File chrome/browser/ui/views/avatar_menu_button.h (right): http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.h#newcode28 chrome/browser/ui/views/avatar_menu_button.h:28: AvatarMenuButton(const std::wstring& text, ui::MenuModel* menu_model); Document AvatarMenuButton takes ownership ...
9 years, 6 months ago (2011-06-09 15:46:46 UTC) #3
Peter Kasting
http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.cc File chrome/browser/ui/views/avatar_menu_button.cc (right): http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.cc#newcode26 chrome/browser/ui/views/avatar_menu_button.cc:26: if (base::i18n::IsRTL()) { You should not need to do ...
9 years, 6 months ago (2011-06-09 18:03:31 UTC) #4
sail
http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.cc File chrome/browser/ui/views/avatar_menu_button.cc (right): http://codereview.chromium.org/7003080/diff/1/chrome/browser/ui/views/avatar_menu_button.cc#newcode26 chrome/browser/ui/views/avatar_menu_button.cc:26: if (base::i18n::IsRTL()) { On 2011/06/09 18:03:31, Peter Kasting wrote: ...
9 years, 6 months ago (2011-06-10 00:56:20 UTC) #5
sky
http://codereview.chromium.org/7003080/diff/5002/chrome/browser/ui/views/avatar_menu_button.cc File chrome/browser/ui/views/avatar_menu_button.cc (right): http://codereview.chromium.org/7003080/diff/5002/chrome/browser/ui/views/avatar_menu_button.cc#newcode38 chrome/browser/ui/views/avatar_menu_button.cc:38: float scale = Don't you need to also worry ...
9 years, 6 months ago (2011-06-10 15:08:08 UTC) #6
sail
http://codereview.chromium.org/7003080/diff/5002/chrome/browser/ui/views/avatar_menu_button.cc File chrome/browser/ui/views/avatar_menu_button.cc (right): http://codereview.chromium.org/7003080/diff/5002/chrome/browser/ui/views/avatar_menu_button.cc#newcode38 chrome/browser/ui/views/avatar_menu_button.cc:38: float scale = On 2011/06/10 15:08:08, sky wrote: > ...
9 years, 6 months ago (2011-06-10 17:10:35 UTC) #7
sky
LGTM http://codereview.chromium.org/7003080/diff/1031/views/controls/button/text_button.cc File views/controls/button/text_button.cc (right): http://codereview.chromium.org/7003080/diff/1031/views/controls/button/text_button.cc#newcode682 views/controls/button/text_button.cc:682: SkBitmap icon = GetImageToPaint(); const SkBitmap&
9 years, 6 months ago (2011-06-10 17:11:59 UTC) #8
sail
http://codereview.chromium.org/7003080/diff/1031/views/controls/button/text_button.cc File views/controls/button/text_button.cc (right): http://codereview.chromium.org/7003080/diff/1031/views/controls/button/text_button.cc#newcode682 views/controls/button/text_button.cc:682: SkBitmap icon = GetImageToPaint(); On 2011/06/10 17:11:59, sky wrote: ...
9 years, 6 months ago (2011-06-10 17:18:22 UTC) #9
Peter Kasting
http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/avatar_menu_button.cc File chrome/browser/ui/views/avatar_menu_button.cc (right): http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/avatar_menu_button.cc#newcode12 chrome/browser/ui/views/avatar_menu_button.cc:12: // offset size depends on whether the frame is ...
9 years, 6 months ago (2011-06-10 20:37:21 UTC) #10
sail
9 years, 6 months ago (2011-06-10 21:23:38 UTC) #11
This change is half checked in right now. I'll address Peter's suggestions in a
separate change.

http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/avat...
File chrome/browser/ui/views/avatar_menu_button.cc (right):

http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/avat...
chrome/browser/ui/views/avatar_menu_button.cc:42: int scaled_height =
Round(height() / scale);
On 2011/06/10 20:37:21, Peter Kasting wrote:
> You want "*", not "/".

scaled_height is for the image so using / works. * is used below for computing
the dst_height.

http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/avat...
chrome/browser/ui/views/avatar_menu_button.cc:54: return gfx::Size(38, 31);
On 2011/06/10 20:37:21, Peter Kasting wrote:
> This seems kind of random.
> 
> I think your old way of getting the actual OTR icon was better, I just thought
> you should have explained it more.
> 
> I also think if you're going to do this in this class you should override
> GetPreferredSize() instead of making a new function.

I had to make it static because the avatar bounds need to be calculate even if
the button doesn't exist. I'll change it back to using the OTR icon size though.

http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/fram...
File chrome/browser/ui/views/frame/glass_browser_frame_view.cc (right):

http://codereview.chromium.org/7003080/diff/5008/chrome/browser/ui/views/fram...
chrome/browser/ui/views/frame/glass_browser_frame_view.cc:201: // See if the
point is within the avatar menu button.
On 2011/06/10 20:37:21, Peter Kasting wrote:
> There's a problem with moving this code up like you've done, which is that now
> the avatar takes precedence over the sysmenu region -- especially problematic
in
> a maximized window.
> 
> I think you need to move this back down to where it was (for both glass and
> opaque code), and, if that leaves us with too much of the avatar unclickable,
> move the avatar over a few pixels.

Will fix.
Regardless of where I put this check the avatar button always seems to get
precedence.  I talked to sky about this and he suggested I change the avatar hit
testing code to hit test against the opaque area of the avatar. Once I do this
it should interact better with the system menu.

Powered by Google App Engine
This is Rietveld 408576698