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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 views::TrayBubbleView* bubble_view = | 394 views::TrayBubbleView* bubble_view = |
395 owner_->system_tray()->GetSystemBubble()->bubble_view(); | 395 owner_->system_tray()->GetSystemBubble()->bubble_view(); |
396 int max_card_width = | 396 int max_card_width = |
397 bubble_view->GetMaximumSize().width() - | 397 bubble_view->GetMaximumSize().width() - |
398 (2 * kTrayPopupPaddingHorizontal + kTrayPopupPaddingBetweenItems); | 398 (2 * kTrayPopupPaddingHorizontal + kTrayPopupPaddingBetweenItems); |
399 if (logout_button_) | 399 if (logout_button_) |
400 max_card_width -= logout_button_->GetPreferredSize().width(); | 400 max_card_width -= logout_button_->GetPreferredSize().width(); |
401 user_card_view_ = | 401 user_card_view_ = |
402 new UserCardView(login, max_card_width, multiprofile_index_); | 402 new UserCardView(login, max_card_width, multiprofile_index_); |
403 bool clickable = IsMultiProfileSupportedAndUserActive() || | 403 // The entry is clickable when no system modal dialog is open and one of the |
404 IsMultiAccountSupportedAndUserActive(); | 404 // multi user options is active. |
| 405 bool clickable = !Shell::GetInstance()->IsSystemModalWindowOpen() && |
| 406 (IsMultiProfileSupportedAndUserActive() || |
| 407 IsMultiAccountSupportedAndUserActive()); |
405 if (clickable) { | 408 if (clickable) { |
406 // To allow the border to start before the icon, reduce the size before and | 409 // To allow the border to start before the icon, reduce the size before and |
407 // add an inset to the icon to get the spacing. | 410 // add an inset to the icon to get the spacing. |
408 if (!multiprofile_index_) { | 411 if (!multiprofile_index_) { |
409 SetBorder(views::Border::CreateEmptyBorder( | 412 SetBorder(views::Border::CreateEmptyBorder( |
410 kTrayPopupUserCardVerticalPadding, | 413 kTrayPopupUserCardVerticalPadding, |
411 kTrayPopupPaddingHorizontal - kTrayUserTileHoverBorderInset, | 414 kTrayPopupPaddingHorizontal - kTrayUserTileHoverBorderInset, |
412 kTrayPopupUserCardVerticalPadding, | 415 kTrayPopupUserCardVerticalPadding, |
413 kTrayPopupPaddingHorizontal)); | 416 kTrayPopupPaddingHorizontal)); |
414 user_card_view_->SetBorder(views::Border::CreateEmptyBorder( | 417 user_card_view_->SetBorder(views::Border::CreateEmptyBorder( |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 focus_manager_ = NULL; | 558 focus_manager_ = NULL; |
556 if (user_card_view_->GetFocusManager()) | 559 if (user_card_view_->GetFocusManager()) |
557 user_card_view_->GetFocusManager()->ClearFocus(); | 560 user_card_view_->GetFocusManager()->ClearFocus(); |
558 popup_message_.reset(); | 561 popup_message_.reset(); |
559 mouse_watcher_.reset(); | 562 mouse_watcher_.reset(); |
560 add_menu_option_.reset(); | 563 add_menu_option_.reset(); |
561 } | 564 } |
562 | 565 |
563 } // namespace tray | 566 } // namespace tray |
564 } // namespace ash | 567 } // namespace ash |
OLD | NEW |