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

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

Issue 2505783002: chromeos: Migrate SignOut and RequestRestartForUpdate to mojo interface (Closed)
Patch Set: Created 4 years, 1 month 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/common/system/user/user_view.h" 5 #include "ash/common/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/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
11 #include "ash/common/multi_profile_uma.h" 11 #include "ash/common/multi_profile_uma.h"
12 #include "ash/common/popup_message.h" 12 #include "ash/common/popup_message.h"
13 #include "ash/common/session/session_state_delegate.h" 13 #include "ash/common/session/session_state_delegate.h"
14 #include "ash/common/shell_delegate.h" 14 #include "ash/common/shell_delegate.h"
15 #include "ash/common/system/tray/system_tray.h" 15 #include "ash/common/system/tray/system_tray.h"
16 #include "ash/common/system/tray/system_tray_controller.h"
16 #include "ash/common/system/tray/system_tray_delegate.h" 17 #include "ash/common/system/tray/system_tray_delegate.h"
17 #include "ash/common/system/tray/tray_constants.h" 18 #include "ash/common/system/tray/tray_constants.h"
18 #include "ash/common/system/tray/tray_popup_label_button.h" 19 #include "ash/common/system/tray/tray_popup_label_button.h"
19 #include "ash/common/system/tray/tray_popup_label_button_border.h" 20 #include "ash/common/system/tray/tray_popup_label_button_border.h"
20 #include "ash/common/system/tray/tray_popup_utils.h" 21 #include "ash/common/system/tray/tray_popup_utils.h"
21 #include "ash/common/system/user/button_from_view.h" 22 #include "ash/common/system/user/button_from_view.h"
22 #include "ash/common/system/user/login_status.h" 23 #include "ash/common/system/user/login_status.h"
23 #include "ash/common/system/user/rounded_image_view.h" 24 #include "ash/common/system/user/rounded_image_view.h"
24 #include "ash/common/system/user/user_card_view.h" 25 #include "ash/common/system/user/user_card_view.h"
25 #include "ash/common/wm_lookup.h" 26 #include "ash/common/wm_lookup.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 logout_button_->SetBoundsRect(logout_area); 375 logout_button_->SetBoundsRect(logout_area);
375 } else { 376 } else {
376 user_card_view_->SetBoundsRect(contents_area); 377 user_card_view_->SetBoundsRect(contents_area);
377 } 378 }
378 } 379 }
379 380
380 void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) { 381 void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) {
381 if (sender == logout_button_) { 382 if (sender == logout_button_) {
382 WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_SIGN_OUT); 383 WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_SIGN_OUT);
383 RemoveAddUserMenuOption(); 384 RemoveAddUserMenuOption();
384 WmShell::Get()->system_tray_delegate()->SignOut(); 385 WmShell::Get()->system_tray_controller()->SignOut();
385 } else if (sender == user_card_view_ && 386 } else if (sender == user_card_view_ &&
386 IsMultiProfileSupportedAndUserActive()) { 387 IsMultiProfileSupportedAndUserActive()) {
387 if (IsActiveUser()) { 388 if (IsActiveUser()) {
388 ToggleAddUserMenuOption(); 389 ToggleAddUserMenuOption();
389 } else { 390 } else {
390 RemoveAddUserMenuOption(); 391 RemoveAddUserMenuOption();
391 SwitchUser(user_index_); 392 SwitchUser(user_index_);
392 // Since the user list is about to change the system menu should get 393 // Since the user list is about to change the system menu should get
393 // closed. 394 // closed.
394 owner_->system_tray()->CloseSystemBubble(); 395 owner_->system_tray()->CloseSystemBubble();
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 focus_manager_ = nullptr; 657 focus_manager_ = nullptr;
657 if (user_card_view_->GetFocusManager()) 658 if (user_card_view_->GetFocusManager())
658 user_card_view_->GetFocusManager()->ClearFocus(); 659 user_card_view_->GetFocusManager()->ClearFocus();
659 popup_message_.reset(); 660 popup_message_.reset();
660 mouse_watcher_.reset(); 661 mouse_watcher_.reset();
661 add_menu_option_.reset(); 662 add_menu_option_.reset();
662 } 663 }
663 664
664 } // namespace tray 665 } // namespace tray
665 } // namespace ash 666 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698