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/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/multi_profile_uma.h" | 10 #include "ash/common/multi_profile_uma.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 // Creates the view shown in the user switcher popup ("AddUserMenuOption"). | 68 // Creates the view shown in the user switcher popup ("AddUserMenuOption"). |
69 views::View* CreateAddUserView(AddUserSessionPolicy policy, | 69 views::View* CreateAddUserView(AddUserSessionPolicy policy, |
70 views::ButtonListener* listener) { | 70 views::ButtonListener* listener) { |
71 auto view = new views::View; | 71 auto view = new views::View; |
72 const int icon_padding = (kMenuButtonSize - kMenuIconSize) / 2; | 72 const int icon_padding = (kMenuButtonSize - kMenuIconSize) / 2; |
73 auto layout = | 73 auto layout = |
74 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, | 74 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, |
75 kTrayPopupLabelHorizontalPadding + icon_padding); | 75 kTrayPopupLabelHorizontalPadding + icon_padding); |
76 layout->set_minimum_cross_axis_size( | 76 layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); |
77 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); | |
78 view->SetLayoutManager(layout); | 77 view->SetLayoutManager(layout); |
79 view->set_background( | 78 view->set_background( |
80 views::Background::CreateSolidBackground(kBackgroundColor)); | 79 views::Background::CreateSolidBackground(kBackgroundColor)); |
81 | 80 |
82 int message_id = 0; | 81 int message_id = 0; |
83 switch (policy) { | 82 switch (policy) { |
84 case AddUserSessionPolicy::ALLOWED: { | 83 case AddUserSessionPolicy::ALLOWED: { |
85 message_id = IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT; | 84 message_id = IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT; |
86 | 85 |
87 auto icon = new views::ImageView(); | 86 auto icon = new views::ImageView(); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return; | 399 return; |
401 focus_manager_->RemoveFocusChangeListener(this); | 400 focus_manager_->RemoveFocusChangeListener(this); |
402 focus_manager_ = nullptr; | 401 focus_manager_ = nullptr; |
403 if (user_card_view_->GetFocusManager()) | 402 if (user_card_view_->GetFocusManager()) |
404 user_card_view_->GetFocusManager()->ClearFocus(); | 403 user_card_view_->GetFocusManager()->ClearFocus(); |
405 add_menu_option_.reset(); | 404 add_menu_option_.reset(); |
406 } | 405 } |
407 | 406 |
408 } // namespace tray | 407 } // namespace tray |
409 } // namespace ash | 408 } // namespace ash |
OLD | NEW |