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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1833383002: Correctly layout the profile name button, and disable the button listener for supervised user. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 4f5bbbca35eb4e8b5f24d1077e8dd5e4683d79de..27e484dc981e2f774037de56361eb69377ca70fc 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -390,7 +390,10 @@ class EditableProfileName : public views::View,
const base::string16& text,
bool is_editing_allowed)
: button_(new RightAlignedIconLabelButton(this, text)),
- profile_name_textfield_(new views::Textfield()) {
+ profile_name_textfield_(new views::Textfield()),
+ is_editing_allowed_(is_editing_allowed) {
+ SetLayoutManager(
+ new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
Peter Kasting 2016/03/28 04:17:13 Nit: Add blank line below
Shu Chen 2016/03/28 07:33:30 Done.
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
const gfx::FontList& medium_font_list =
rb->GetFontList(ui::ResourceBundle::MediumFont);
@@ -430,8 +433,6 @@ class EditableProfileName : public views::View,
profile_name_textfield_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
profile_name_textfield_->SetVisible(false);
Peter Kasting 2016/03/28 04:17:14 Nit: Remove this line
Shu Chen 2016/03/28 07:33:30 Done.
- SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
AddChildView(profile_name_textfield_);
}
@@ -448,6 +449,8 @@ class EditableProfileName : public views::View,
private:
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override {
+ if (!is_editing_allowed_)
+ return;
button_->SetVisible(false);
profile_name_textfield_->SetVisible(true);
profile_name_textfield_->SetText(button_->GetText());
@@ -471,6 +474,8 @@ class EditableProfileName : public views::View,
// the profile name isn't allowed to be edited (e.g. for guest profiles).
views::Textfield* profile_name_textfield_;
+ bool is_editing_allowed_;
Peter Kasting 2016/03/28 04:17:13 Hmm. Maybe instead of adding this, we should use
Shu Chen 2016/03/28 07:33:30 Done.
+
DISALLOW_COPY_AND_ASSIGN(EditableProfileName);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698