OLD | NEW |
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" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // as user card for default view. That's why we wrap it in a button | 444 // as user card for default view. That's why we wrap it in a button |
445 // without click listener and special hover behavior. | 445 // without click listener and special hover behavior. |
446 button = new ButtonFromView(contents_view, NULL, false, insets); | 446 button = new ButtonFromView(contents_view, NULL, false, insets); |
447 } | 447 } |
448 // A click on the button should not trigger a focus change. | 448 // A click on the button should not trigger a focus change. |
449 button->set_request_focus_on_press(false); | 449 button->set_request_focus_on_press(false); |
450 user_card_view_ = button; | 450 user_card_view_ = button; |
451 is_user_card_button_ = true; | 451 is_user_card_button_ = true; |
452 } | 452 } |
453 AddChildViewAt(user_card_view_, 0); | 453 AddChildViewAt(user_card_view_, 0); |
454 // Card for locally managed user can consume more space than currently | 454 // Card for supervised user can consume more space than currently |
455 // available. In that case we should increase system bubble's width. | 455 // available. In that case we should increase system bubble's width. |
456 if (login == user::LOGGED_IN_PUBLIC) | 456 if (login == user::LOGGED_IN_PUBLIC) |
457 bubble_view->SetWidth(GetPreferredSize().width()); | 457 bubble_view->SetWidth(GetPreferredSize().width()); |
458 } | 458 } |
459 | 459 |
460 void UserView::ToggleAddUserMenuOption() { | 460 void UserView::ToggleAddUserMenuOption() { |
461 if (add_menu_option_.get()) { | 461 if (add_menu_option_.get()) { |
462 RemoveAddUserMenuOption(); | 462 RemoveAddUserMenuOption(); |
463 return; | 463 return; |
464 } | 464 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 focus_manager_ = NULL; | 544 focus_manager_ = NULL; |
545 if (user_card_view_->GetFocusManager()) | 545 if (user_card_view_->GetFocusManager()) |
546 user_card_view_->GetFocusManager()->ClearFocus(); | 546 user_card_view_->GetFocusManager()->ClearFocus(); |
547 popup_message_.reset(); | 547 popup_message_.reset(); |
548 mouse_watcher_.reset(); | 548 mouse_watcher_.reset(); |
549 add_menu_option_.reset(); | 549 add_menu_option_.reset(); |
550 } | 550 } |
551 | 551 |
552 } // namespace tray | 552 } // namespace tray |
553 } // namespace ash | 553 } // namespace ash |
OLD | NEW |