OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profile_chooser_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/profile_info_util.h" | 9 #include "chrome/browser/profiles/profile_info_util.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 575 |
576 bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender, | 576 bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender, |
577 const ui::KeyEvent& key_event) { | 577 const ui::KeyEvent& key_event) { |
578 views::Textfield* name_textfield = | 578 views::Textfield* name_textfield = |
579 current_profile_name_->profile_name_textfield(); | 579 current_profile_name_->profile_name_textfield(); |
580 DCHECK(sender == name_textfield); | 580 DCHECK(sender == name_textfield); |
581 | 581 |
582 if (key_event.key_code() == ui::VKEY_RETURN || | 582 if (key_event.key_code() == ui::VKEY_RETURN || |
583 key_event.key_code() == ui::VKEY_TAB) { | 583 key_event.key_code() == ui::VKEY_TAB) { |
584 // Pressing Tab/Enter commits the new profile name, unless it's empty. | 584 // Pressing Tab/Enter commits the new profile name, unless it's empty. |
585 base::string16 new_profile_name = name_textfield->text(); | 585 base::string16 new_profile_name = name_textfield->GetText(); |
586 if (new_profile_name.empty()) | 586 if (new_profile_name.empty()) |
587 return true; | 587 return true; |
588 | 588 |
589 const AvatarMenu::Item& active_item = avatar_menu_->GetItemAt( | 589 const AvatarMenu::Item& active_item = avatar_menu_->GetItemAt( |
590 avatar_menu_->GetActiveProfileIndex()); | 590 avatar_menu_->GetActiveProfileIndex()); |
591 Profile* profile = g_browser_process->profile_manager()->GetProfile( | 591 Profile* profile = g_browser_process->profile_manager()->GetProfile( |
592 active_item.profile_path); | 592 active_item.profile_path); |
593 DCHECK(profile); | 593 DCHECK(profile); |
594 | 594 |
595 if (profile->IsManaged()) | 595 if (profile->IsManaged()) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 email_button->set_menu_marker( | 838 email_button->set_menu_marker( |
839 rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia()); | 839 rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia()); |
840 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 840 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
841 } | 841 } |
842 layout->StartRow(1, 0); | 842 layout->StartRow(1, 0); |
843 layout->AddView(email_button); | 843 layout->AddView(email_button); |
844 | 844 |
845 // Save the original email address, as the button text could be elided. | 845 // Save the original email address, as the button text could be elided. |
846 current_profile_accounts_map_[email_button] = account; | 846 current_profile_accounts_map_[email_button] = account; |
847 } | 847 } |
OLD | NEW |