Commit 1007920e authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename user_dropdown_ to dropdown_

As the comment in login_user_view.h by jdufault@, rename user_dropdown_
to dropdown_.
Signed-off-by: default avatarZhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: Id490ce8cb0a899da78d6fbab1cd2bfacd6169227
Reviewed-on: https://chromium-review.googlesource.com/1170157Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582487}
parent c52ab914
...@@ -318,7 +318,7 @@ views::View* LoginUserView::TestApi::tap_button() const { ...@@ -318,7 +318,7 @@ views::View* LoginUserView::TestApi::tap_button() const {
} }
views::View* LoginUserView::TestApi::dropdown() const { views::View* LoginUserView::TestApi::dropdown() const {
return view_->user_dropdown_; return view_->dropdown_;
} }
LoginBubble* LoginUserView::TestApi::menu() const { LoginBubble* LoginUserView::TestApi::menu() const {
...@@ -370,14 +370,14 @@ LoginUserView::LoginUserView( ...@@ -370,14 +370,14 @@ LoginUserView::LoginUserView(
2 * (kDistanceBetweenUsernameAndDropdownDp + kDropdownIconSizeDp); 2 * (kDistanceBetweenUsernameAndDropdownDp + kDropdownIconSizeDp);
user_label_ = new UserLabel(style, label_width); user_label_ = new UserLabel(style, label_width);
if (show_dropdown) { if (show_dropdown) {
user_dropdown_ = new LoginButton(this); dropdown_ = new LoginButton(this);
user_dropdown_->set_has_ink_drop_action_on_click(false); dropdown_->set_has_ink_drop_action_on_click(false);
user_dropdown_->SetPreferredSize( dropdown_->SetPreferredSize(
gfx::Size(kDropdownIconSizeDp, kDropdownIconSizeDp)); gfx::Size(kDropdownIconSizeDp, kDropdownIconSizeDp));
user_dropdown_->SetImage( dropdown_->SetImage(
views::Button::STATE_NORMAL, views::Button::STATE_NORMAL,
gfx::CreateVectorIcon(kLockScreenDropdownIcon, SK_ColorWHITE)); gfx::CreateVectorIcon(kLockScreenDropdownIcon, SK_ColorWHITE));
user_dropdown_->SetFocusBehavior(FocusBehavior::ALWAYS); dropdown_->SetFocusBehavior(FocusBehavior::ALWAYS);
} }
if (show_domain) if (show_domain)
user_domain_ = new UserDomainInfoView(); user_domain_ = new UserDomainInfoView();
...@@ -406,8 +406,8 @@ LoginUserView::LoginUserView( ...@@ -406,8 +406,8 @@ LoginUserView::LoginUserView(
}; };
setup_layer(user_image_); setup_layer(user_image_);
setup_layer(user_label_); setup_layer(user_label_);
if (user_dropdown_) if (dropdown_)
setup_layer(user_dropdown_); setup_layer(dropdown_);
if (user_domain_) if (user_domain_)
setup_layer(user_domain_); setup_layer(user_domain_);
...@@ -463,8 +463,8 @@ void LoginUserView::UpdateForUser(const mojom::LoginUserInfoPtr& user, ...@@ -463,8 +463,8 @@ void LoginUserView::UpdateForUser(const mojom::LoginUserInfoPtr& user,
make_opacity_sequence()); make_opacity_sequence());
user_label_->layer()->GetAnimator()->StartAnimation( user_label_->layer()->GetAnimator()->StartAnimation(
make_opacity_sequence()); make_opacity_sequence());
if (user_dropdown_) { if (dropdown_) {
user_dropdown_->layer()->GetAnimator()->StartAnimation( dropdown_->layer()->GetAnimator()->StartAnimation(
make_opacity_sequence()); make_opacity_sequence());
} }
if (user_domain_) { if (user_domain_) {
...@@ -517,14 +517,14 @@ void LoginUserView::RequestFocus() { ...@@ -517,14 +517,14 @@ void LoginUserView::RequestFocus() {
void LoginUserView::ButtonPressed(views::Button* sender, void LoginUserView::ButtonPressed(views::Button* sender,
const ui::Event& event) { const ui::Event& event) {
// Handle click on the dropdown arrow. // Handle click on the dropdown arrow.
if (sender == user_dropdown_) { if (sender == dropdown_) {
DCHECK(user_dropdown_); DCHECK(dropdown_);
if (!user_menu_->IsVisible()) { if (!user_menu_->IsVisible()) {
user_menu_->ShowUserMenu( user_menu_->ShowUserMenu(
base::UTF8ToUTF16(current_user_->basic_user_info->display_name), base::UTF8ToUTF16(current_user_->basic_user_info->display_name),
base::UTF8ToUTF16(current_user_->basic_user_info->display_email), base::UTF8ToUTF16(current_user_->basic_user_info->display_email),
current_user_->basic_user_info->type, current_user_->is_device_owner, current_user_->basic_user_info->type, current_user_->is_device_owner,
user_dropdown_ /*anchor_view*/, user_dropdown_ /*bubble_opener*/, dropdown_ /*anchor_view*/, dropdown_ /*bubble_opener*/,
current_user_->can_remove /*show_remove_user*/, current_user_->can_remove /*show_remove_user*/,
on_remove_warning_shown_, on_remove_); on_remove_warning_shown_, on_remove_);
} else { } else {
...@@ -545,8 +545,8 @@ void LoginUserView::OnHover(bool has_hover) { ...@@ -545,8 +545,8 @@ void LoginUserView::OnHover(bool has_hover) {
void LoginUserView::UpdateCurrentUserState() { void LoginUserView::UpdateCurrentUserState() {
auto email = base::UTF8ToUTF16(current_user_->basic_user_info->display_email); auto email = base::UTF8ToUTF16(current_user_->basic_user_info->display_email);
tap_button_->SetAccessibleName(email); tap_button_->SetAccessibleName(email);
if (user_dropdown_) { if (dropdown_) {
user_dropdown_->SetAccessibleName(l10n_util::GetStringFUTF16( dropdown_->SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_ASH_LOGIN_POD_MENU_BUTTON_ACCESSIBLE_NAME, email)); IDS_ASH_LOGIN_POD_MENU_BUTTON_ACCESSIBLE_NAME, email));
} }
...@@ -591,10 +591,10 @@ void LoginUserView::UpdateOpacity() { ...@@ -591,10 +591,10 @@ void LoginUserView::UpdateOpacity() {
is_opaque_ ? kOpaqueUserViewOpacity : kTransparentUserViewOpacity; is_opaque_ ? kOpaqueUserViewOpacity : kTransparentUserViewOpacity;
user_image_->layer()->SetOpacity(target_opacity); user_image_->layer()->SetOpacity(target_opacity);
user_label_->layer()->SetOpacity(target_opacity); user_label_->layer()->SetOpacity(target_opacity);
if (user_dropdown_) { if (dropdown_) {
std::unique_ptr<ui::ScopedLayerAnimationSettings> user_dropdown_settings = std::unique_ptr<ui::ScopedLayerAnimationSettings> dropdown_settings =
build_settings(user_dropdown_); build_settings(dropdown_);
user_dropdown_->layer()->SetOpacity(target_opacity); dropdown_->layer()->SetOpacity(target_opacity);
} }
if (user_domain_) { if (user_domain_) {
...@@ -612,8 +612,8 @@ void LoginUserView::SetLargeLayout() { ...@@ -612,8 +612,8 @@ void LoginUserView::SetLargeLayout() {
AddChildView(user_image_); AddChildView(user_image_);
AddChildView(user_label_); AddChildView(user_label_);
AddChildView(tap_button_); AddChildView(tap_button_);
if (user_dropdown_) if (dropdown_)
AddChildView(user_dropdown_); AddChildView(dropdown_);
if (user_domain_) if (user_domain_)
AddChildView(user_domain_); AddChildView(user_domain_);
...@@ -637,16 +637,16 @@ void LoginUserView::SetLargeLayout() { ...@@ -637,16 +637,16 @@ void LoginUserView::SetLargeLayout() {
views::ColumnSet* label_dropdown = views::ColumnSet* label_dropdown =
layout->AddColumnSet(kLabelDropdownColumnId); layout->AddColumnSet(kLabelDropdownColumnId);
label_dropdown->AddPaddingColumn(1.0f /*resize_percent*/, 0 /*width*/); label_dropdown->AddPaddingColumn(1.0f /*resize_percent*/, 0 /*width*/);
if (user_dropdown_) { if (dropdown_) {
label_dropdown->AddPaddingColumn( label_dropdown->AddPaddingColumn(
0 /*resize_percent*/, user_dropdown_->GetPreferredSize().width() + 0 /*resize_percent*/, dropdown_->GetPreferredSize().width() +
kDistanceBetweenUsernameAndDropdownDp); kDistanceBetweenUsernameAndDropdownDp);
} }
label_dropdown->AddColumn(views::GridLayout::CENTER, label_dropdown->AddColumn(views::GridLayout::CENTER,
views::GridLayout::CENTER, 0 /*resize_percent*/, views::GridLayout::CENTER, 0 /*resize_percent*/,
views::GridLayout::USE_PREF, 0 /*fixed_width*/, views::GridLayout::USE_PREF, 0 /*fixed_width*/,
0 /*min_width*/); 0 /*min_width*/);
if (user_dropdown_) { if (dropdown_) {
label_dropdown->AddPaddingColumn(0 /*resize_percent*/, label_dropdown->AddPaddingColumn(0 /*resize_percent*/,
kDistanceBetweenUsernameAndDropdownDp); kDistanceBetweenUsernameAndDropdownDp);
label_dropdown->AddColumn(views::GridLayout::CENTER, label_dropdown->AddColumn(views::GridLayout::CENTER,
...@@ -679,8 +679,8 @@ void LoginUserView::SetLargeLayout() { ...@@ -679,8 +679,8 @@ void LoginUserView::SetLargeLayout() {
// Label/dropdown. // Label/dropdown.
layout->StartRow(0 /*vertical_resize*/, kLabelDropdownColumnId); layout->StartRow(0 /*vertical_resize*/, kLabelDropdownColumnId);
layout->AddView(user_label_); layout->AddView(user_label_);
if (user_dropdown_) if (dropdown_)
layout->AddView(user_dropdown_); layout->AddView(dropdown_);
if (user_domain_) { if (user_domain_) {
add_padding(kVerticalSpacingBetweenUserNameAndDomainDp); add_padding(kVerticalSpacingBetweenUserNameAndDomainDp);
......
...@@ -115,8 +115,7 @@ class ASH_EXPORT LoginUserView : public views::View, ...@@ -115,8 +115,7 @@ class ASH_EXPORT LoginUserView : public views::View,
LoginDisplayStyle display_style_; LoginDisplayStyle display_style_;
UserImage* user_image_ = nullptr; UserImage* user_image_ = nullptr;
UserLabel* user_label_ = nullptr; UserLabel* user_label_ = nullptr;
// TODO(jdufault): Rename user_dropdown_ to dropdown_. LoginButton* dropdown_ = nullptr;
LoginButton* user_dropdown_ = nullptr;
TapButton* tap_button_ = nullptr; TapButton* tap_button_ = nullptr;
// TODO(jdufault): Rename user_menu_ to menu_ or popup_menu_. // TODO(jdufault): Rename user_menu_ to menu_ or popup_menu_.
std::unique_ptr<LoginBubble> user_menu_; std::unique_ptr<LoginBubble> user_menu_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment