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

Side by Side Diff: chrome/browser/ui/gtk/avatar_menu_button_gtk.cc

Issue 8872004: GTK: More changes from raw widget->allocation to using the accessor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/avatar_menu_button_gtk.h" 5 #include "chrome/browser/ui/gtk/avatar_menu_button_gtk.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "chrome/browser/profiles/profile_metrics.h" 8 #include "chrome/browser/profiles/profile_metrics.h"
9 #include "chrome/browser/profiles/profile_info_util.h" 9 #include "chrome/browser/profiles/profile_info_util.h"
10 #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h" 10 #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void AvatarMenuButtonGtk::ShowAvatarBubble() { 60 void AvatarMenuButtonGtk::ShowAvatarBubble() {
61 // Only show the avatar bubble if the avatar button is in the title bar. 61 // Only show the avatar bubble if the avatar button is in the title bar.
62 if (gtk_widget_get_parent_window(widget_.get())) 62 if (gtk_widget_get_parent_window(widget_.get()))
63 new AvatarMenuBubbleGtk(browser_, widget_.get(), arrow_location_, NULL); 63 new AvatarMenuBubbleGtk(browser_, widget_.get(), arrow_location_, NULL);
64 } 64 }
65 65
66 void AvatarMenuButtonGtk::UpdateButtonIcon() { 66 void AvatarMenuButtonGtk::UpdateButtonIcon() {
67 if (!icon_.get()) 67 if (!icon_.get())
68 return; 68 return;
69 69
70 old_height_ = widget()->allocation.height; 70 GtkAllocation allocation;
71 gtk_widget_get_allocation(widget(), &allocation);
72 old_height_ = allocation.height;
71 gfx::Image icon = profiles::GetAvatarIconForTitleBar(*icon_, is_gaia_picture_, 73 gfx::Image icon = profiles::GetAvatarIconForTitleBar(*icon_, is_gaia_picture_,
72 profiles::kAvatarIconWidth, old_height_); 74 profiles::kAvatarIconWidth, old_height_);
73 gtk_image_set_from_pixbuf(GTK_IMAGE(image_), icon.ToGdkPixbuf()); 75 gtk_image_set_from_pixbuf(GTK_IMAGE(image_), icon.ToGdkPixbuf());
74 gtk_misc_set_alignment(GTK_MISC(image_), 0.0, 1.0); 76 gtk_misc_set_alignment(GTK_MISC(image_), 0.0, 1.0);
75 gtk_widget_set_size_request(image_, -1, 0); 77 gtk_widget_set_size_request(image_, -1, 0);
76 } 78 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698