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

Side by Side Diff: ash/system/user/tray_user.cc

Issue 11377005: Replace Label::Alignment with gfx::HorizontalAlignment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix remaining Label::Alignment references. Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/tray_caps_lock.cc ('k') | ash/wm/maximize_bubble_controller.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/user/tray_user.h" 5 #include "ash/system/user/tray_user.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "ash/system/tray/tray_item_view.h" 10 #include "ash/system/tray/tray_item_view.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 kUserInfoVerticalPadding, kTrayPopupPaddingBetweenItems)); 145 kUserInfoVerticalPadding, kTrayPopupPaddingBetweenItems));
146 container_->AddChildView(user_info_); 146 container_->AddChildView(user_info_);
147 147
148 if (login_ == ash::user::LOGGED_IN_KIOSK) { 148 if (login_ == ash::user::LOGGED_IN_KIOSK) {
149 views::Label* label = new views::Label; 149 views::Label* label = new views::Label;
150 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 150 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
151 label->SetText( 151 label->SetText(
152 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_KIOSK_LABEL)); 152 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_KIOSK_LABEL));
153 label->set_border(views::Border::CreateEmptyBorder( 153 label->set_border(views::Border::CreateEmptyBorder(
154 0, 4, 0, 1)); 154 0, 4, 0, 1));
155 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 155 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
156 user_info_->AddChildView(label); 156 user_info_->AddChildView(label);
157 return; 157 return;
158 } 158 }
159 159
160 RoundedImageView* image = new RoundedImageView(kProfileRoundedCornerRadius); 160 RoundedImageView* image = new RoundedImageView(kProfileRoundedCornerRadius);
161 image->SetImage(ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), 161 image->SetImage(ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
162 gfx::Size(kUserIconSize, kUserIconSize)); 162 gfx::Size(kUserIconSize, kUserIconSize));
163 user_info_->AddChildView(image); 163 user_info_->AddChildView(image);
164 164
165 views::View* user = new views::View; 165 views::View* user = new views::View;
166 user->SetLayoutManager(new views::BoxLayout( 166 user->SetLayoutManager(new views::BoxLayout(
167 views::BoxLayout::kVertical, 0, 5, 0)); 167 views::BoxLayout::kVertical, 0, 5, 0));
168 ash::SystemTrayDelegate* tray = 168 ash::SystemTrayDelegate* tray =
169 ash::Shell::GetInstance()->tray_delegate(); 169 ash::Shell::GetInstance()->tray_delegate();
170 username_ = new views::Label(tray->GetUserDisplayName()); 170 username_ = new views::Label(tray->GetUserDisplayName());
171 username_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 171 username_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
172 user->AddChildView(username_); 172 user->AddChildView(username_);
173 173
174 email_ = new views::Label(UTF8ToUTF16(tray->GetUserEmail())); 174 email_ = new views::Label(UTF8ToUTF16(tray->GetUserEmail()));
175 email_->SetFont(username_->font().DeriveFont(-1)); 175 email_->SetFont(username_->font().DeriveFont(-1));
176 email_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 176 email_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
177 email_->SetEnabled(false); 177 email_->SetEnabled(false);
178 user->AddChildView(email_); 178 user->AddChildView(email_);
179 179
180 user_info_->AddChildView(user); 180 user_info_->AddChildView(user);
181 } 181 }
182 182
183 // Overridden from views::ButtonListener. 183 // Overridden from views::ButtonListener.
184 virtual void ButtonPressed(views::Button* sender, 184 virtual void ButtonPressed(views::Button* sender,
185 const ui::Event& event) OVERRIDE { 185 const ui::Event& event) OVERRIDE {
186 CHECK(sender == signout_); 186 CHECK(sender == signout_);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // Check for null to avoid crbug.com/150944. 344 // Check for null to avoid crbug.com/150944.
345 if (avatar_) { 345 if (avatar_) {
346 avatar_->SetImage( 346 avatar_->SetImage(
347 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), 347 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
348 gfx::Size(kUserIconSize, kUserIconSize)); 348 gfx::Size(kUserIconSize, kUserIconSize));
349 } 349 }
350 } 350 }
351 351
352 } // namespace internal 352 } // namespace internal
353 } // namespace ash 353 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray_caps_lock.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698