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_card_view.h" | 5 #include "ash/system/user/user_card_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 UserCardView::~UserCardView() {} | 351 UserCardView::~UserCardView() {} |
352 | 352 |
353 void UserCardView::GetAccessibleState(ui::AXViewState* state) { | 353 void UserCardView::GetAccessibleState(ui::AXViewState* state) { |
354 state->role = ui::AX_ROLE_STATIC_TEXT; | 354 state->role = ui::AX_ROLE_STATIC_TEXT; |
355 std::vector<base::string16> labels; | 355 std::vector<base::string16> labels; |
356 for (int i = 0; i < child_count(); ++i) | 356 for (int i = 0; i < child_count(); ++i) |
357 GetAccessibleLabelFromDescendantViews(child_at(i), labels); | 357 GetAccessibleLabelFromDescendantViews(child_at(i), labels); |
358 state->name = JoinString(labels, base::ASCIIToUTF16(" ")); | 358 state->name = base::JoinString(labels, base::ASCIIToUTF16(" ")); |
359 } | 359 } |
360 | 360 |
361 void UserCardView::AddPublicModeUserContent(int max_width) { | 361 void UserCardView::AddPublicModeUserContent(int max_width) { |
362 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0); | 362 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0); |
363 AddChildView(icon); | 363 AddChildView(icon); |
364 int details_max_width = max_width - icon->GetPreferredSize().width() - | 364 int details_max_width = max_width - icon->GetPreferredSize().width() - |
365 kTrayPopupPaddingBetweenItems; | 365 kTrayPopupPaddingBetweenItems; |
366 AddChildView(new PublicAccountUserDetails(details_max_width)); | 366 AddChildView(new PublicAccountUserDetails(details_max_width)); |
367 } | 367 } |
368 | 368 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 content::BrowserContext* context = | 465 content::BrowserContext* context = |
466 delegate->GetBrowserContextByIndex(multiprofile_index); | 466 delegate->GetBrowserContextByIndex(multiprofile_index); |
467 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), | 467 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), |
468 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); | 468 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); |
469 } | 469 } |
470 return icon; | 470 return icon; |
471 } | 471 } |
472 | 472 |
473 } // namespace tray | 473 } // namespace tray |
474 } // namespace ash | 474 } // namespace ash |
OLD | NEW |