OLD | NEW |
---|---|
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 "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 BackgroundColorHoverButton(views::ButtonListener* listener, | 134 BackgroundColorHoverButton(views::ButtonListener* listener, |
135 const base::string16& text, | 135 const base::string16& text, |
136 const gfx::ImageSkia& icon) | 136 const gfx::ImageSkia& icon) |
137 : views::LabelButton(listener, text) { | 137 : views::LabelButton(listener, text) { |
138 SetImageLabelSpacing(views::kItemLabelSpacing); | 138 SetImageLabelSpacing(views::kItemLabelSpacing); |
139 SetBorder(views::Border::CreateEmptyBorder( | 139 SetBorder(views::Border::CreateEmptyBorder( |
140 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); | 140 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); |
141 SetMinSize(gfx::Size(0, | 141 SetMinSize(gfx::Size(0, |
142 kButtonHeight + views::kRelatedControlVerticalSpacing)); | 142 kButtonHeight + views::kRelatedControlVerticalSpacing)); |
143 SetImage(STATE_NORMAL, icon); | 143 SetImage(STATE_NORMAL, icon); |
144 SetFocusable(true); | |
144 } | 145 } |
145 | 146 |
146 virtual ~BackgroundColorHoverButton() {} | 147 virtual ~BackgroundColorHoverButton() {} |
147 | 148 |
148 private: | 149 private: |
149 // views::LabelButton: | 150 // views::LabelButton: |
150 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 151 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
151 if ((state() == STATE_PRESSED) || | 152 if ((state() == STATE_PRESSED) || |
152 (state() == STATE_HOVERED) || | 153 (state() == STATE_HOVERED) || |
153 HasFocus()) { | 154 HasFocus()) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 views::LabelButton::Layout(); | 196 views::LabelButton::Layout(); |
196 label()->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 197 label()->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
197 } | 198 } |
198 | 199 |
199 DISALLOW_COPY_AND_ASSIGN(RightAlignedIconLabelButton); | 200 DISALLOW_COPY_AND_ASSIGN(RightAlignedIconLabelButton); |
200 }; | 201 }; |
201 | 202 |
202 // EditableProfilePhoto ------------------------------------------------- | 203 // EditableProfilePhoto ------------------------------------------------- |
203 | 204 |
204 // A custom Image control that shows a "change" button when moused over. | 205 // A custom Image control that shows a "change" button when moused over. |
205 class EditableProfilePhoto : public views::ImageView { | 206 class EditableProfilePhoto : public views::LabelButton { |
206 public: | 207 public: |
207 EditableProfilePhoto(views::ButtonListener* listener, | 208 EditableProfilePhoto(views::ButtonListener* listener, |
208 const gfx::Image& icon, | 209 const gfx::Image& icon, |
209 bool is_editing_allowed, | 210 bool is_editing_allowed, |
210 const gfx::Rect& bounds) | 211 const gfx::Rect& bounds) |
211 : views::ImageView(), | 212 : views::LabelButton(listener, base::string16()), |
212 change_photo_button_(NULL) { | 213 photo_overlay_(NULL) { |
213 gfx::Image image = profiles::GetSizedAvatarIcon( | 214 gfx::Image image = profiles::GetSizedAvatarIcon( |
214 icon, true, kLargeImageSide, kLargeImageSide); | 215 icon, true, kLargeImageSide, kLargeImageSide); |
215 SetImage(image.ToImageSkia()); | 216 SetImage(views::LabelButton::STATE_NORMAL, *image.ToImageSkia()); |
217 SetBorder(views::Border::NullBorder()); | |
216 SetBoundsRect(bounds); | 218 SetBoundsRect(bounds); |
217 | 219 |
218 // Calculate the circular mask that will be used to display the photo. | 220 // Calculate the circular mask that will be used to display the photo. |
219 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), | 221 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), |
220 SkIntToScalar(bounds.height() / 2), | 222 SkIntToScalar(bounds.height() / 2), |
221 SkIntToScalar(bounds.width() / 2)); | 223 SkIntToScalar(bounds.width() / 2)); |
222 | 224 |
223 if (!is_editing_allowed) | 225 if (!is_editing_allowed) { |
226 SetEnabled(false); | |
224 return; | 227 return; |
228 } | |
225 | 229 |
230 SetFocusable(true); | |
226 set_notify_enter_exit_on_child(true); | 231 set_notify_enter_exit_on_child(true); |
227 | 232 |
228 // Button overlay that appears when hovering over the image. | 233 // Photo overlay that appears when hovering over the button. |
229 change_photo_button_ = new views::LabelButton(listener, base::string16()); | 234 photo_overlay_ = new views::ImageView(); |
230 change_photo_button_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | |
231 change_photo_button_->SetBorder(views::Border::NullBorder()); | |
232 | 235 |
233 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); | 236 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); |
234 change_photo_button_->set_background( | 237 photo_overlay_->set_background( |
235 views::Background::CreateSolidBackground(kBackgroundColor)); | 238 views::Background::CreateSolidBackground(kBackgroundColor)); |
236 change_photo_button_->SetImage(views::LabelButton::STATE_NORMAL, | 239 photo_overlay_->SetImage(*ui::ResourceBundle::GetSharedInstance(). |
237 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 240 GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_CAMERA)); |
238 IDR_ICON_PROFILES_EDIT_CAMERA)); | |
239 | 241 |
240 change_photo_button_->SetSize(bounds.size()); | 242 photo_overlay_->SetSize(bounds.size()); |
241 change_photo_button_->SetVisible(false); | 243 photo_overlay_->SetVisible(false); |
242 AddChildView(change_photo_button_); | 244 AddChildView(photo_overlay_); |
243 } | 245 } |
244 | 246 |
245 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 247 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
246 // Display the profile picture as a circle. | 248 // Display the profile picture as a circle. |
247 canvas->ClipPath(circular_mask_, true); | 249 canvas->ClipPath(circular_mask_, true); |
248 views::ImageView::OnPaint(canvas); | 250 views::LabelButton::OnPaint(canvas); |
249 } | 251 } |
250 | 252 |
251 virtual void PaintChildren(gfx::Canvas* canvas, | 253 virtual void PaintChildren(gfx::Canvas* canvas, |
252 const views::CullSet& cull_set) OVERRIDE { | 254 const views::CullSet& cull_set) OVERRIDE { |
253 // Display any children (the "change photo" overlay) as a circle. | 255 // Display any children (the "change photo" overlay) as a circle. |
254 canvas->ClipPath(circular_mask_, true); | 256 canvas->ClipPath(circular_mask_, true); |
255 View::PaintChildren(canvas, cull_set); | 257 View::PaintChildren(canvas, cull_set); |
256 } | 258 } |
257 | 259 |
258 views::LabelButton* change_photo_button() { return change_photo_button_; } | |
259 | |
260 private: | 260 private: |
261 // views::View: | 261 // views::CustomButton: |
262 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { | 262 virtual void StateChanged() OVERRIDE { |
263 if (change_photo_button_) | 263 bool show_overlay = |
264 change_photo_button_->SetVisible(true); | 264 (state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); |
265 if (photo_overlay_) | |
266 photo_overlay_->SetVisible(show_overlay); | |
265 } | 267 } |
266 | 268 |
267 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { | 269 virtual void OnFocus() OVERRIDE { |
268 if (change_photo_button_) | 270 views::LabelButton::OnFocus(); |
269 change_photo_button_->SetVisible(false); | 271 if (photo_overlay_) |
msw
2014/08/20 20:49:56
nit: maybe SetState(STATE_HOVERED)?
noms (inactive)
2014/08/20 21:11:48
Hmm, setting the state here and in OnBlur leads to
msw
2014/08/20 21:20:08
Ignore my suggestion if it works better as-is.
noms (inactive)
2014/08/20 21:44:18
Done.
| |
272 photo_overlay_->SetVisible(true); | |
273 } | |
274 | |
275 virtual void OnBlur() OVERRIDE { | |
276 views::LabelButton::OnBlur(); | |
277 if (photo_overlay_) | |
msw
2014/08/20 20:49:56
nit: maybe add |&& state() != STATE_HOVERED|
noms (inactive)
2014/08/20 21:11:48
Hmm, but it's definitely going to to be in a hover
msw
2014/08/20 21:20:08
You can ignore my comment above. Only address this
noms (inactive)
2014/08/20 21:44:18
Did this now that i didn't do the other one :)
Yay
| |
278 photo_overlay_->SetVisible(false); | |
270 } | 279 } |
271 | 280 |
272 gfx::Path circular_mask_; | 281 gfx::Path circular_mask_; |
273 | 282 |
274 // Button that is shown when hovering over the image view. Can be NULL if | 283 // Image that is shown when hovering over the image button. Can be NULL if |
275 // the photo isn't allowed to be edited (e.g. for guest profiles). | 284 // the photo isn't allowed to be edited (e.g. for guest profiles). |
276 views::LabelButton* change_photo_button_; | 285 views::ImageView* photo_overlay_; |
277 | 286 |
278 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); | 287 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); |
279 }; | 288 }; |
280 | 289 |
281 // EditableProfileName ------------------------------------------------- | 290 // EditableProfileName ------------------------------------------------- |
282 | 291 |
283 // A custom text control that turns into a textfield for editing when clicked. | 292 // A custom text control that turns into a textfield for editing when clicked. |
284 class EditableProfileName : public RightAlignedIconLabelButton, | 293 class EditableProfileName : public RightAlignedIconLabelButton, |
285 public views::ButtonListener { | 294 public views::ButtonListener { |
286 public: | 295 public: |
287 EditableProfileName(views::TextfieldController* controller, | 296 EditableProfileName(views::TextfieldController* controller, |
288 const base::string16& text, | 297 const base::string16& text, |
289 bool is_editing_allowed) | 298 bool is_editing_allowed) |
290 : RightAlignedIconLabelButton(this, text), | 299 : RightAlignedIconLabelButton(this, text), |
291 profile_name_textfield_(NULL) { | 300 profile_name_textfield_(NULL) { |
292 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 301 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
293 const gfx::FontList& medium_font_list = | 302 const gfx::FontList& medium_font_list = |
294 rb->GetFontList(ui::ResourceBundle::MediumFont); | 303 rb->GetFontList(ui::ResourceBundle::MediumFont); |
295 SetFontList(medium_font_list); | 304 SetFontList(medium_font_list); |
296 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 305 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
297 | 306 |
298 if (!is_editing_allowed) { | 307 if (!is_editing_allowed) { |
299 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); | 308 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); |
300 return; | 309 return; |
301 } | 310 } |
302 | 311 |
312 SetFocusable(true); | |
303 // Show an "edit" pencil icon when hovering over. In the default state, | 313 // Show an "edit" pencil icon when hovering over. In the default state, |
304 // we need to create an empty placeholder of the correct size, so that | 314 // we need to create an empty placeholder of the correct size, so that |
305 // the text doesn't jump around when the hovered icon appears. | 315 // the text doesn't jump around when the hovered icon appears. |
306 gfx::ImageSkia hover_image = | 316 gfx::ImageSkia hover_image = |
307 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); | 317 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); |
308 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); | 318 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); |
309 SetImage(STATE_HOVERED, hover_image); | 319 SetImage(STATE_HOVERED, hover_image); |
310 SetImage(STATE_PRESSED, | 320 SetImage(STATE_PRESSED, |
311 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); | 321 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); |
312 // To center the text, we need to offest it by the width of the icon we | 322 // To center the text, we need to offest it by the width of the icon we |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 // part of the new profile name typed in the textfield. | 365 // part of the new profile name typed in the textfield. |
356 return false; | 366 return false; |
357 } | 367 } |
358 | 368 |
359 virtual void Layout() OVERRIDE { | 369 virtual void Layout() OVERRIDE { |
360 if (profile_name_textfield_) | 370 if (profile_name_textfield_) |
361 profile_name_textfield_->SetBounds(0, 0, width(), height()); | 371 profile_name_textfield_->SetBounds(0, 0, width(), height()); |
362 RightAlignedIconLabelButton::Layout(); | 372 RightAlignedIconLabelButton::Layout(); |
363 } | 373 } |
364 | 374 |
375 virtual void OnFocus() OVERRIDE { | |
376 RightAlignedIconLabelButton::OnFocus(); | |
377 SetState(views::CustomButton::STATE_HOVERED); | |
msw
2014/08/20 20:49:56
nit: you may be able to remove "views::CustomButto
noms (inactive)
2014/08/20 21:44:18
Done.
| |
378 } | |
379 | |
380 virtual void OnBlur() OVERRIDE { | |
381 RightAlignedIconLabelButton::OnBlur(); | |
382 SetState(views::CustomButton::STATE_NORMAL); | |
383 } | |
384 | |
365 // Textfield that is shown when editing the profile name. Can be NULL if | 385 // Textfield that is shown when editing the profile name. Can be NULL if |
366 // the profile name isn't allowed to be edited (e.g. for guest profiles). | 386 // the profile name isn't allowed to be edited (e.g. for guest profiles). |
367 views::Textfield* profile_name_textfield_; | 387 views::Textfield* profile_name_textfield_; |
368 | 388 |
369 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); | 389 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); |
370 }; | 390 }; |
371 | 391 |
372 // A title card with one back button right aligned and one label center aligned. | 392 // A title card with one back button right aligned and one label center aligned. |
373 class TitleCard : public views::View { | 393 class TitleCard : public views::View { |
374 public: | 394 public: |
375 TitleCard(const base::string16& message, views::ButtonListener* listener, | 395 TitleCard(const base::string16& message, views::ButtonListener* listener, |
376 views::ImageButton** back_button) { | 396 views::ImageButton** back_button) { |
377 back_button_ = new views::ImageButton(listener); | 397 back_button_ = new views::ImageButton(listener); |
378 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, | 398 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, |
379 views::ImageButton::ALIGN_MIDDLE); | 399 views::ImageButton::ALIGN_MIDDLE); |
380 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 400 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
381 back_button_->SetImage(views::ImageButton::STATE_NORMAL, | 401 back_button_->SetImage(views::ImageButton::STATE_NORMAL, |
382 rb->GetImageSkiaNamed(IDR_BACK)); | 402 rb->GetImageSkiaNamed(IDR_BACK)); |
383 back_button_->SetImage(views::ImageButton::STATE_HOVERED, | 403 back_button_->SetImage(views::ImageButton::STATE_HOVERED, |
384 rb->GetImageSkiaNamed(IDR_BACK_H)); | 404 rb->GetImageSkiaNamed(IDR_BACK_H)); |
385 back_button_->SetImage(views::ImageButton::STATE_PRESSED, | 405 back_button_->SetImage(views::ImageButton::STATE_PRESSED, |
386 rb->GetImageSkiaNamed(IDR_BACK_P)); | 406 rb->GetImageSkiaNamed(IDR_BACK_P)); |
387 back_button_->SetImage(views::ImageButton::STATE_DISABLED, | 407 back_button_->SetImage(views::ImageButton::STATE_DISABLED, |
388 rb->GetImageSkiaNamed(IDR_BACK_D)); | 408 rb->GetImageSkiaNamed(IDR_BACK_D)); |
409 back_button_->SetFocusable(true); | |
389 *back_button = back_button_; | 410 *back_button = back_button_; |
390 | 411 |
391 title_label_ = new views::Label(message); | 412 title_label_ = new views::Label(message); |
392 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 413 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
393 const gfx::FontList& medium_font_list = | 414 const gfx::FontList& medium_font_list = |
394 rb->GetFontList(ui::ResourceBundle::MediumFont); | 415 rb->GetFontList(ui::ResourceBundle::MediumFont); |
395 title_label_->SetFontList(medium_font_list); | 416 title_label_->SetFontList(medium_font_list); |
396 | 417 |
397 AddChildView(back_button_); | 418 AddChildView(back_button_); |
398 AddChildView(title_label_); | 419 AddChildView(title_label_); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
722 std::string primary_account = | 743 std::string primary_account = |
723 SigninManagerFactory::GetForProfile(browser_->profile())-> | 744 SigninManagerFactory::GetForProfile(browser_->profile())-> |
724 GetAuthenticatedUsername(); | 745 GetAuthenticatedUsername(); |
725 // The account management view is only available with the | 746 // The account management view is only available with the |
726 // --enable-account-consistency flag. | 747 // --enable-account-consistency flag. |
727 bool account_management_available = !primary_account.empty() && | 748 bool account_management_available = !primary_account.empty() && |
728 switches::IsEnableAccountConsistency(); | 749 switches::IsEnableAccountConsistency(); |
729 ShowView(account_management_available ? | 750 ShowView(account_management_available ? |
730 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 751 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : |
731 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 752 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
732 } else if (current_profile_photo_ && | 753 } else if (sender == current_profile_photo_) { |
733 sender == current_profile_photo_->change_photo_button()) { | |
734 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 754 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
735 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); | 755 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
736 } else if (sender == signin_current_profile_link_) { | 756 } else if (sender == signin_current_profile_link_) { |
737 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 757 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
738 } else if (sender == add_person_button_) { | 758 } else if (sender == add_person_button_) { |
739 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 759 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
740 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); | 760 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); |
741 chrome::ShowUserManager(browser_->profile()->GetPath()); | 761 chrome::ShowUserManager(browser_->profile()->GetPath()); |
742 } else if (sender == disconnect_button_) { | 762 } else if (sender == disconnect_button_) { |
743 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 763 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1126 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); | 1146 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); |
1127 auth_error_email_button_ = | 1147 auth_error_email_button_ = |
1128 new RightAlignedIconLabelButton(this, avatar_item.sync_state); | 1148 new RightAlignedIconLabelButton(this, avatar_item.sync_state); |
1129 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); | 1149 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); |
1130 auth_error_email_button_->SetBorder(views::Border::NullBorder()); | 1150 auth_error_email_button_->SetBorder(views::Border::NullBorder()); |
1131 auth_error_email_button_->SetImage( | 1151 auth_error_email_button_->SetImage( |
1132 views::LabelButton::STATE_NORMAL, warning_image); | 1152 views::LabelButton::STATE_NORMAL, warning_image); |
1133 auth_error_email_button_->SetTextColor( | 1153 auth_error_email_button_->SetTextColor( |
1134 views::LabelButton::STATE_NORMAL, | 1154 views::LabelButton::STATE_NORMAL, |
1135 views::Link::GetDefaultEnabledColor()); | 1155 views::Link::GetDefaultEnabledColor()); |
1156 auth_error_email_button_->SetFocusable(true); | |
1136 layout->AddView(auth_error_email_button_); | 1157 layout->AddView(auth_error_email_button_); |
1137 } else { | 1158 } else { |
1138 views::Label* email_label = new views::Label(avatar_item.sync_state); | 1159 views::Label* email_label = new views::Label(avatar_item.sync_state); |
1139 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); | 1160 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); |
1140 email_label->SetEnabled(false); | 1161 email_label->SetEnabled(false); |
1141 layout->AddView(email_label); | 1162 layout->AddView(email_label); |
1142 } | 1163 } |
1143 } | 1164 } |
1144 } else { | 1165 } else { |
1145 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( | 1166 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1586 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1607 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1587 IncognitoModePrefs::DISABLED; | 1608 IncognitoModePrefs::DISABLED; |
1588 return incognito_available && !browser_->profile()->IsGuestSession(); | 1609 return incognito_available && !browser_->profile()->IsGuestSession(); |
1589 } | 1610 } |
1590 | 1611 |
1591 void ProfileChooserView::PostActionPerformed( | 1612 void ProfileChooserView::PostActionPerformed( |
1592 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1613 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1593 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1614 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1594 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1615 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1595 } | 1616 } |
OLD | NEW |