Chromium Code Reviews| 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::ImageButton { |
| 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::ImageButton(listener), |
| 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()); |
| 216 SetBoundsRect(bounds); | 217 SetBoundsRect(bounds); |
| 217 | 218 |
| 218 // Calculate the circular mask that will be used to display the photo. | 219 // Calculate the circular mask that will be used to display the photo. |
| 219 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), | 220 circular_mask_.addCircle(SkIntToScalar(bounds.width() / 2), |
| 220 SkIntToScalar(bounds.height() / 2), | 221 SkIntToScalar(bounds.height() / 2), |
| 221 SkIntToScalar(bounds.width() / 2)); | 222 SkIntToScalar(bounds.width() / 2)); |
| 222 | 223 |
| 223 if (!is_editing_allowed) | 224 if (!is_editing_allowed) { |
| 225 SetEnabled(false); | |
| 224 return; | 226 return; |
| 227 } | |
| 225 | 228 |
| 229 SetFocusable(true); | |
| 226 set_notify_enter_exit_on_child(true); | 230 set_notify_enter_exit_on_child(true); |
| 227 | 231 |
| 228 // Button overlay that appears when hovering over the image. | 232 // Photo overlay that appears when hovering over the button. |
| 229 change_photo_button_ = new views::LabelButton(listener, base::string16()); | 233 photo_overlay_ = new views::ImageView(); |
| 230 change_photo_button_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | |
| 231 change_photo_button_->SetBorder(views::Border::NullBorder()); | |
| 232 | 234 |
| 233 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); | 235 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); |
| 234 change_photo_button_->set_background( | 236 photo_overlay_->set_background( |
| 235 views::Background::CreateSolidBackground(kBackgroundColor)); | 237 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 236 change_photo_button_->SetImage(views::LabelButton::STATE_NORMAL, | 238 photo_overlay_->SetImage(*ui::ResourceBundle::GetSharedInstance(). |
| 237 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 239 GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_CAMERA)); |
| 238 IDR_ICON_PROFILES_EDIT_CAMERA)); | |
| 239 | 240 |
| 240 change_photo_button_->SetSize(bounds.size()); | 241 photo_overlay_->SetSize(bounds.size()); |
| 241 change_photo_button_->SetVisible(false); | 242 photo_overlay_->SetVisible(false); |
| 242 AddChildView(change_photo_button_); | 243 AddChildView(photo_overlay_); |
| 243 } | 244 } |
| 244 | 245 |
| 245 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 246 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
| 246 // Display the profile picture as a circle. | 247 // Display the profile picture as a circle. |
| 247 canvas->ClipPath(circular_mask_, true); | 248 canvas->ClipPath(circular_mask_, true); |
| 248 views::ImageView::OnPaint(canvas); | 249 views::ImageButton::OnPaint(canvas); |
| 249 } | 250 } |
| 250 | 251 |
| 251 virtual void PaintChildren(gfx::Canvas* canvas, | 252 virtual void PaintChildren(gfx::Canvas* canvas, |
| 252 const views::CullSet& cull_set) OVERRIDE { | 253 const views::CullSet& cull_set) OVERRIDE { |
| 253 // Display any children (the "change photo" overlay) as a circle. | 254 // Display any children (the "change photo" overlay) as a circle. |
| 254 canvas->ClipPath(circular_mask_, true); | 255 canvas->ClipPath(circular_mask_, true); |
| 255 View::PaintChildren(canvas, cull_set); | 256 View::PaintChildren(canvas, cull_set); |
| 256 } | 257 } |
| 257 | 258 |
| 258 views::LabelButton* change_photo_button() { return change_photo_button_; } | |
| 259 | |
| 260 private: | 259 private: |
| 261 // views::View: | 260 // views::View: |
| 262 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { | 261 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { |
|
msw
2014/08/20 19:29:25
nit: maybe overload StateChanged instead of OnMous
noms (inactive)
2014/08/20 20:25:32
Still need OnFocus/OnBlur because focusing on/away
| |
| 263 if (change_photo_button_) | 262 if (photo_overlay_) |
| 264 change_photo_button_->SetVisible(true); | 263 photo_overlay_->SetVisible(true); |
| 265 } | 264 } |
| 266 | 265 |
| 267 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { | 266 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { |
| 268 if (change_photo_button_) | 267 if (photo_overlay_) { |
| 269 change_photo_button_->SetVisible(false); | 268 GetFocusManager()->ClearFocus(); |
|
msw
2014/08/20 19:29:25
This seems very wrong (see my other comment).
noms (inactive)
2014/08/20 20:25:32
Done.
| |
| 269 photo_overlay_->SetVisible(false); | |
| 270 } | |
| 271 } | |
| 272 | |
| 273 virtual void OnFocus() OVERRIDE { | |
| 274 views::ImageButton::OnFocus(); | |
| 275 if (photo_overlay_) | |
| 276 photo_overlay_->SetVisible(true); | |
| 277 } | |
| 278 | |
| 279 virtual void OnBlur() OVERRIDE { | |
| 280 views::ImageButton::OnBlur(); | |
| 281 if (photo_overlay_) | |
| 282 photo_overlay_->SetVisible(false); | |
| 270 } | 283 } |
| 271 | 284 |
| 272 gfx::Path circular_mask_; | 285 gfx::Path circular_mask_; |
| 273 | 286 |
| 274 // Button that is shown when hovering over the image view. Can be NULL if | 287 // 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). | 288 // the photo isn't allowed to be edited (e.g. for guest profiles). |
| 276 views::LabelButton* change_photo_button_; | 289 views::ImageView* photo_overlay_; |
| 277 | 290 |
| 278 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); | 291 DISALLOW_COPY_AND_ASSIGN(EditableProfilePhoto); |
| 279 }; | 292 }; |
| 280 | 293 |
| 281 // EditableProfileName ------------------------------------------------- | 294 // EditableProfileName ------------------------------------------------- |
| 282 | 295 |
| 283 // A custom text control that turns into a textfield for editing when clicked. | 296 // A custom text control that turns into a textfield for editing when clicked. |
| 284 class EditableProfileName : public RightAlignedIconLabelButton, | 297 class EditableProfileName : public RightAlignedIconLabelButton, |
| 285 public views::ButtonListener { | 298 public views::ButtonListener { |
| 286 public: | 299 public: |
| 287 EditableProfileName(views::TextfieldController* controller, | 300 EditableProfileName(views::TextfieldController* controller, |
| 288 const base::string16& text, | 301 const base::string16& text, |
| 289 bool is_editing_allowed) | 302 bool is_editing_allowed) |
| 290 : RightAlignedIconLabelButton(this, text), | 303 : RightAlignedIconLabelButton(this, text), |
| 291 profile_name_textfield_(NULL) { | 304 profile_name_textfield_(NULL) { |
| 292 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 305 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 293 const gfx::FontList& medium_font_list = | 306 const gfx::FontList& medium_font_list = |
| 294 rb->GetFontList(ui::ResourceBundle::MediumFont); | 307 rb->GetFontList(ui::ResourceBundle::MediumFont); |
| 295 SetFontList(medium_font_list); | 308 SetFontList(medium_font_list); |
| 296 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 309 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 297 | 310 |
| 298 if (!is_editing_allowed) { | 311 if (!is_editing_allowed) { |
| 299 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); | 312 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); |
| 300 return; | 313 return; |
| 301 } | 314 } |
| 302 | 315 |
| 316 SetFocusable(true); | |
| 303 // Show an "edit" pencil icon when hovering over. In the default state, | 317 // 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 | 318 // 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. | 319 // the text doesn't jump around when the hovered icon appears. |
| 306 gfx::ImageSkia hover_image = | 320 gfx::ImageSkia hover_image = |
| 307 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); | 321 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); |
| 308 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); | 322 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); |
| 309 SetImage(STATE_HOVERED, hover_image); | 323 SetImage(STATE_HOVERED, hover_image); |
| 310 SetImage(STATE_PRESSED, | 324 SetImage(STATE_PRESSED, |
| 311 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); | 325 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); |
| 312 // To center the text, we need to offest it by the width of the icon we | 326 // 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. | 369 // part of the new profile name typed in the textfield. |
| 356 return false; | 370 return false; |
| 357 } | 371 } |
| 358 | 372 |
| 359 virtual void Layout() OVERRIDE { | 373 virtual void Layout() OVERRIDE { |
| 360 if (profile_name_textfield_) | 374 if (profile_name_textfield_) |
| 361 profile_name_textfield_->SetBounds(0, 0, width(), height()); | 375 profile_name_textfield_->SetBounds(0, 0, width(), height()); |
| 362 RightAlignedIconLabelButton::Layout(); | 376 RightAlignedIconLabelButton::Layout(); |
| 363 } | 377 } |
| 364 | 378 |
| 379 virtual void OnFocus() OVERRIDE { | |
| 380 RightAlignedIconLabelButton::OnFocus(); | |
| 381 SetState(views::CustomButton::STATE_HOVERED); | |
|
msw
2014/08/20 19:29:25
nit: This might be done for you, but I'm not sure.
noms (inactive)
2014/08/20 20:25:32
Sadly, no. OnFocus/Blur doesn't trigger a state ch
| |
| 382 } | |
| 383 | |
| 384 virtual void OnBlur() OVERRIDE { | |
| 385 RightAlignedIconLabelButton::OnBlur(); | |
| 386 SetState(views::CustomButton::STATE_NORMAL); | |
|
msw
2014/08/20 19:29:25
nit: This may already be accomplished by CustomBut
noms (inactive)
2014/08/20 20:25:32
Same as above.
On 2014/08/20 19:29:25, msw wrote:
| |
| 387 } | |
| 388 | |
| 365 // Textfield that is shown when editing the profile name. Can be NULL if | 389 // 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). | 390 // the profile name isn't allowed to be edited (e.g. for guest profiles). |
| 367 views::Textfield* profile_name_textfield_; | 391 views::Textfield* profile_name_textfield_; |
| 368 | 392 |
| 369 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); | 393 DISALLOW_COPY_AND_ASSIGN(EditableProfileName); |
| 370 }; | 394 }; |
| 371 | 395 |
| 372 // A title card with one back button right aligned and one label center aligned. | 396 // A title card with one back button right aligned and one label center aligned. |
| 373 class TitleCard : public views::View { | 397 class TitleCard : public views::View { |
| 374 public: | 398 public: |
| 375 TitleCard(const base::string16& message, views::ButtonListener* listener, | 399 TitleCard(const base::string16& message, views::ButtonListener* listener, |
| 376 views::ImageButton** back_button) { | 400 views::ImageButton** back_button) { |
| 377 back_button_ = new views::ImageButton(listener); | 401 back_button_ = new views::ImageButton(listener); |
| 378 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, | 402 back_button_->SetImageAlignment(views::ImageButton::ALIGN_LEFT, |
| 379 views::ImageButton::ALIGN_MIDDLE); | 403 views::ImageButton::ALIGN_MIDDLE); |
| 380 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 404 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 381 back_button_->SetImage(views::ImageButton::STATE_NORMAL, | 405 back_button_->SetImage(views::ImageButton::STATE_NORMAL, |
| 382 rb->GetImageSkiaNamed(IDR_BACK)); | 406 rb->GetImageSkiaNamed(IDR_BACK)); |
| 383 back_button_->SetImage(views::ImageButton::STATE_HOVERED, | 407 back_button_->SetImage(views::ImageButton::STATE_HOVERED, |
| 384 rb->GetImageSkiaNamed(IDR_BACK_H)); | 408 rb->GetImageSkiaNamed(IDR_BACK_H)); |
| 385 back_button_->SetImage(views::ImageButton::STATE_PRESSED, | 409 back_button_->SetImage(views::ImageButton::STATE_PRESSED, |
| 386 rb->GetImageSkiaNamed(IDR_BACK_P)); | 410 rb->GetImageSkiaNamed(IDR_BACK_P)); |
| 387 back_button_->SetImage(views::ImageButton::STATE_DISABLED, | 411 back_button_->SetImage(views::ImageButton::STATE_DISABLED, |
| 388 rb->GetImageSkiaNamed(IDR_BACK_D)); | 412 rb->GetImageSkiaNamed(IDR_BACK_D)); |
| 413 back_button_->SetFocusable(true); | |
| 389 *back_button = back_button_; | 414 *back_button = back_button_; |
| 390 | 415 |
| 391 title_label_ = new views::Label(message); | 416 title_label_ = new views::Label(message); |
| 392 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 417 title_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 393 const gfx::FontList& medium_font_list = | 418 const gfx::FontList& medium_font_list = |
| 394 rb->GetFontList(ui::ResourceBundle::MediumFont); | 419 rb->GetFontList(ui::ResourceBundle::MediumFont); |
| 395 title_label_->SetFontList(medium_font_list); | 420 title_label_->SetFontList(medium_font_list); |
| 396 | 421 |
| 397 AddChildView(back_button_); | 422 AddChildView(back_button_); |
| 398 AddChildView(title_label_); | 423 AddChildView(title_label_); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 722 std::string primary_account = | 747 std::string primary_account = |
| 723 SigninManagerFactory::GetForProfile(browser_->profile())-> | 748 SigninManagerFactory::GetForProfile(browser_->profile())-> |
| 724 GetAuthenticatedUsername(); | 749 GetAuthenticatedUsername(); |
| 725 // The account management view is only available with the | 750 // The account management view is only available with the |
| 726 // --enable-account-consistency flag. | 751 // --enable-account-consistency flag. |
| 727 bool account_management_available = !primary_account.empty() && | 752 bool account_management_available = !primary_account.empty() && |
| 728 switches::IsEnableAccountConsistency(); | 753 switches::IsEnableAccountConsistency(); |
| 729 ShowView(account_management_available ? | 754 ShowView(account_management_available ? |
| 730 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 755 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : |
| 731 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 756 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
| 732 } else if (current_profile_photo_ && | 757 } else if (sender == current_profile_photo_) { |
| 733 sender == current_profile_photo_->change_photo_button()) { | |
| 734 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 758 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
| 735 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); | 759 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
| 736 } else if (sender == signin_current_profile_link_) { | 760 } else if (sender == signin_current_profile_link_) { |
| 737 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 761 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
| 738 } else if (sender == add_person_button_) { | 762 } else if (sender == add_person_button_) { |
| 739 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 763 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
| 740 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); | 764 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); |
| 741 chrome::ShowUserManager(browser_->profile()->GetPath()); | 765 chrome::ShowUserManager(browser_->profile()->GetPath()); |
| 742 } else if (sender == disconnect_button_) { | 766 } else if (sender == disconnect_button_) { |
| 743 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 767 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1126 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); | 1150 IDR_ICON_PROFILES_ACCOUNT_BUTTON_ERROR).ToImageSkia(); |
| 1127 auth_error_email_button_ = | 1151 auth_error_email_button_ = |
| 1128 new RightAlignedIconLabelButton(this, avatar_item.sync_state); | 1152 new RightAlignedIconLabelButton(this, avatar_item.sync_state); |
| 1129 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); | 1153 auth_error_email_button_->SetElideBehavior(gfx::ELIDE_EMAIL); |
| 1130 auth_error_email_button_->SetBorder(views::Border::NullBorder()); | 1154 auth_error_email_button_->SetBorder(views::Border::NullBorder()); |
| 1131 auth_error_email_button_->SetImage( | 1155 auth_error_email_button_->SetImage( |
| 1132 views::LabelButton::STATE_NORMAL, warning_image); | 1156 views::LabelButton::STATE_NORMAL, warning_image); |
| 1133 auth_error_email_button_->SetTextColor( | 1157 auth_error_email_button_->SetTextColor( |
| 1134 views::LabelButton::STATE_NORMAL, | 1158 views::LabelButton::STATE_NORMAL, |
| 1135 views::Link::GetDefaultEnabledColor()); | 1159 views::Link::GetDefaultEnabledColor()); |
| 1160 auth_error_email_button_->SetFocusable(true); | |
| 1136 layout->AddView(auth_error_email_button_); | 1161 layout->AddView(auth_error_email_button_); |
| 1137 } else { | 1162 } else { |
| 1138 views::Label* email_label = new views::Label(avatar_item.sync_state); | 1163 views::Label* email_label = new views::Label(avatar_item.sync_state); |
| 1139 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); | 1164 email_label->SetElideBehavior(gfx::ELIDE_EMAIL); |
| 1140 email_label->SetEnabled(false); | 1165 email_label->SetEnabled(false); |
| 1141 layout->AddView(email_label); | 1166 layout->AddView(email_label); |
| 1142 } | 1167 } |
| 1143 } | 1168 } |
| 1144 } else { | 1169 } else { |
| 1145 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( | 1170 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile( |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1586 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1611 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1587 IncognitoModePrefs::DISABLED; | 1612 IncognitoModePrefs::DISABLED; |
| 1588 return incognito_available && !browser_->profile()->IsGuestSession(); | 1613 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1589 } | 1614 } |
| 1590 | 1615 |
| 1591 void ProfileChooserView::PostActionPerformed( | 1616 void ProfileChooserView::PostActionPerformed( |
| 1592 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1617 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1593 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1618 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1594 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1619 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1595 } | 1620 } |
| OLD | NEW |