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

Side by Side Diff: ash/system/user/user_view.cc

Issue 2099103002: Give Ash material design tray items the correct size and layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split shelf and tray constants Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/system/user/user_view.h" 5 #include "ash/system/user/user_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/system/tray/system_tray_delegate.h" 12 #include "ash/common/system/tray/system_tray_delegate.h"
13 #include "ash/common/system/tray/tray_constants.h"
13 #include "ash/common/system/tray/tray_popup_label_button.h" 14 #include "ash/common/system/tray/tray_popup_label_button.h"
14 #include "ash/common/system/tray/tray_popup_label_button_border.h" 15 #include "ash/common/system/tray/tray_popup_label_button_border.h"
15 #include "ash/common/system/user/button_from_view.h" 16 #include "ash/common/system/user/button_from_view.h"
16 #include "ash/common/system/user/login_status.h" 17 #include "ash/common/system/user/login_status.h"
17 #include "ash/common/system/user/rounded_image_view.h" 18 #include "ash/common/system/user/rounded_image_view.h"
18 #include "ash/common/wm_lookup.h" 19 #include "ash/common/wm_lookup.h"
19 #include "ash/common/wm_root_window_controller.h" 20 #include "ash/common/wm_root_window_controller.h"
20 #include "ash/common/wm_shell.h" 21 #include "ash/common/wm_shell.h"
21 #include "ash/common/wm_window.h" 22 #include "ash/common/wm_window.h"
22 #include "ash/multi_profile_uma.h" 23 #include "ash/multi_profile_uma.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 157
157 add_user_ = new views::View; 158 add_user_ = new views::View;
158 add_user_->SetBorder( 159 add_user_->SetBorder(
159 views::Border::CreateEmptyBorder(0, kTrayUserTileHoverBorderInset, 0, 0)); 160 views::Border::CreateEmptyBorder(0, kTrayUserTileHoverBorderInset, 0, 0));
160 161
161 add_user_->SetLayoutManager(new views::BoxLayout( 162 add_user_->SetLayoutManager(new views::BoxLayout(
162 views::BoxLayout::kHorizontal, 0, 0, kTrayPopupPaddingBetweenItems)); 163 views::BoxLayout::kHorizontal, 0, 0, kTrayPopupPaddingBetweenItems));
163 AddChildViewAt(add_user_, 0); 164 AddChildViewAt(add_user_, 0);
164 165
165 // Add the [+] icon which is also the anchor for messages. 166 // Add the [+] icon which is also the anchor for messages.
166 RoundedImageView* icon = new RoundedImageView(kTrayAvatarCornerRadius, true); 167 RoundedImageView* icon = new RoundedImageView(kTrayRoundedBorderRadius, true);
167 anchor_ = icon; 168 anchor_ = icon;
168 icon->SetImage(*ui::ResourceBundle::GetSharedInstance() 169 icon->SetImage(*ui::ResourceBundle::GetSharedInstance()
169 .GetImageNamed(IDR_AURA_UBER_TRAY_ADD_MULTIPROFILE_USER) 170 .GetImageNamed(IDR_AURA_UBER_TRAY_ADD_MULTIPROFILE_USER)
170 .ToImageSkia(), 171 .ToImageSkia(),
171 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); 172 gfx::Size(kTrayItemSize, kTrayItemSize));
172 add_user_->AddChildView(icon); 173 add_user_->AddChildView(icon);
173 174
174 // Add the command text. 175 // Add the command text.
175 views::Label* command_label = new views::Label( 176 views::Label* command_label = new views::Label(
176 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT)); 177 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT));
177 command_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 178 command_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
178 add_user_->AddChildView(command_label); 179 add_user_->AddChildView(command_label);
179 } 180 }
180 181
181 } // namespace 182 } // namespace
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 focus_manager_ = NULL; 513 focus_manager_ = NULL;
513 if (user_card_view_->GetFocusManager()) 514 if (user_card_view_->GetFocusManager())
514 user_card_view_->GetFocusManager()->ClearFocus(); 515 user_card_view_->GetFocusManager()->ClearFocus();
515 popup_message_.reset(); 516 popup_message_.reset();
516 mouse_watcher_.reset(); 517 mouse_watcher_.reset();
517 add_menu_option_.reset(); 518 add_menu_option_.reset();
518 } 519 }
519 520
520 } // namespace tray 521 } // namespace tray
521 } // namespace ash 522 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698