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

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

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Update after review. Created 5 years, 2 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
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 8
9 #include "ash/multi_profile_uma.h" 9 #include "ash/multi_profile_uma.h"
10 #include "ash/popup_message.h" 10 #include "ash/popup_message.h"
11 #include "ash/session/session_state_delegate.h" 11 #include "ash/session/session_state_delegate.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "ash/shell_delegate.h" 13 #include "ash/shell_delegate.h"
14 #include "ash/system/tray/system_tray.h" 14 #include "ash/system/tray/system_tray.h"
15 #include "ash/system/tray/system_tray_delegate.h" 15 #include "ash/system/tray/system_tray_delegate.h"
16 #include "ash/system/tray/tray_popup_label_button.h" 16 #include "ash/system/tray/tray_popup_label_button.h"
17 #include "ash/system/tray/tray_popup_label_button_border.h" 17 #include "ash/system/tray/tray_popup_label_button_border.h"
18 #include "ash/system/user/button_from_view.h" 18 #include "ash/system/user/button_from_view.h"
19 #include "ash/system/user/config.h" 19 #include "ash/system/user/config.h"
20 #include "ash/system/user/rounded_image_view.h" 20 #include "ash/system/user/rounded_image_view.h"
21 #include "ash/system/user/user_card_view.h" 21 #include "ash/system/user/user_card_view.h"
22 #include "components/signin/core/account_id/account_id.h"
22 #include "components/user_manager/user_info.h" 23 #include "components/user_manager/user_info.h"
23 #include "grit/ash_resources.h" 24 #include "grit/ash_resources.h"
24 #include "grit/ash_strings.h" 25 #include "grit/ash_strings.h"
25 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
26 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
27 #include "ui/views/layout/fill_layout.h" 28 #include "ui/views/layout/fill_layout.h"
28 #include "ui/views/painter.h" 29 #include "ui/views/painter.h"
29 #include "ui/wm/core/shadow_types.h" 30 #include "ui/wm/core/shadow_types.h"
30 31
31 namespace ash { 32 namespace ash {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (ash::Shell::GetInstance() 71 if (ash::Shell::GetInstance()
71 ->session_state_delegate() 72 ->session_state_delegate()
72 ->IsUserSessionBlocked()) 73 ->IsUserSessionBlocked())
73 return; 74 return;
74 75
75 DCHECK(user_index > 0); 76 DCHECK(user_index > 0);
76 ash::SessionStateDelegate* delegate = 77 ash::SessionStateDelegate* delegate =
77 ash::Shell::GetInstance()->session_state_delegate(); 78 ash::Shell::GetInstance()->session_state_delegate();
78 ash::MultiProfileUMA::RecordSwitchActiveUser( 79 ash::MultiProfileUMA::RecordSwitchActiveUser(
79 ash::MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY); 80 ash::MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY);
80 delegate->SwitchActiveUser(delegate->GetUserInfo(user_index)->GetUserID()); 81 delegate->SwitchActiveUser(
82 delegate->GetUserInfo(user_index)->GetAccountId().GetUserEmail());
81 } 83 }
82 84
83 class LogoutButton : public TrayPopupLabelButton { 85 class LogoutButton : public TrayPopupLabelButton {
84 public: 86 public:
85 // If |placeholder| is true, button is used as placeholder. That means that 87 // If |placeholder| is true, button is used as placeholder. That means that
86 // button is inactive and is not painted, but consume the same ammount of 88 // button is inactive and is not painted, but consume the same ammount of
87 // space, as if it was painted. 89 // space, as if it was painted.
88 LogoutButton(views::ButtonListener* listener, 90 LogoutButton(views::ButtonListener* listener,
89 const base::string16& text, 91 const base::string16& text,
90 bool placeholder) 92 bool placeholder)
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 focus_manager_ = NULL; 551 focus_manager_ = NULL;
550 if (user_card_view_->GetFocusManager()) 552 if (user_card_view_->GetFocusManager())
551 user_card_view_->GetFocusManager()->ClearFocus(); 553 user_card_view_->GetFocusManager()->ClearFocus();
552 popup_message_.reset(); 554 popup_message_.reset();
553 mouse_watcher_.reset(); 555 mouse_watcher_.reset();
554 add_menu_option_.reset(); 556 add_menu_option_.reset();
555 } 557 }
556 558
557 } // namespace tray 559 } // namespace tray
558 } // namespace ash 560 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698