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

Side by Side Diff: ash/system/chromeos/session/logout_button_tray.cc

Issue 371633002: LabelButton: cache the last computed preferred size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_dialog_views.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/system/chromeos/session/logout_button_tray.h" 5 #include "ash/system/chromeos/session/logout_button_tray.h"
6 6
7 #include "ash/shelf/shelf_types.h" 7 #include "ash/shelf/shelf_types.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/chromeos/session/logout_confirmation_controller.h" 9 #include "ash/system/chromeos/session/logout_confirmation_controller.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); 79 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages));
80 border->SetPainter(false, views::Button::STATE_PRESSED, 80 border->SetPainter(false, views::Button::STATE_PRESSED,
81 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); 81 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages));
82 gfx::Insets insets = border->GetInsets(); 82 gfx::Insets insets = border->GetInsets();
83 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, 83 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding,
84 0, kLogoutButtonHorizontalExtraPadding); 84 0, kLogoutButtonHorizontalExtraPadding);
85 border->set_insets(insets); 85 border->set_insets(insets);
86 SetBorder(border.PassAs<views::Border>()); 86 SetBorder(border.PassAs<views::Border>());
87 set_animate_on_state_change(false); 87 set_animate_on_state_change(false);
88 88
89 set_min_size(gfx::Size(0, kShelfItemHeight)); 89 SetMinSize(gfx::Size(0, kShelfItemHeight));
90 } 90 }
91 91
92 LogoutButton::~LogoutButton() { 92 LogoutButton::~LogoutButton() {
93 } 93 }
94 94
95 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget) 95 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget)
96 : TrayBackgroundView(status_area_widget), 96 : TrayBackgroundView(status_area_widget),
97 button_(NULL), 97 button_(NULL),
98 login_status_(user::LOGGED_IN_NONE), 98 login_status_(user::LOGGED_IN_NONE),
99 show_logout_button_in_tray_(false) { 99 show_logout_button_in_tray_(false) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 UpdateVisibility(); 156 UpdateVisibility();
157 } 157 }
158 158
159 void LogoutButtonTray::UpdateVisibility() { 159 void LogoutButtonTray::UpdateVisibility() {
160 SetVisible(show_logout_button_in_tray_ && 160 SetVisible(show_logout_button_in_tray_ &&
161 login_status_ != user::LOGGED_IN_NONE && 161 login_status_ != user::LOGGED_IN_NONE &&
162 login_status_ != user::LOGGED_IN_LOCKED); 162 login_status_ != user::LOGGED_IN_LOCKED);
163 } 163 }
164 164
165 } // namespace ash 165 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698